/* Admin Panel CSS - Complete Redesign */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #48bb78;
    --danger-color: #f56565;
    --warning-color: #ed8936;
    --info-color: #4299e1;
    --dark-color: #1a202c;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --sidebar-width: 240px;
    --sidebar-collapsed-width: 70px;
    --topbar-height: 70px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.6;
}

/* Topbar - Always Visible at Top */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--topbar-height);
    background: white;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    z-index: 1001;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.topbar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-logo img {
    width: 45px;
    height: 45px;
    border-radius: 8px;
}

.topbar-logo-text h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
}

.topbar-logo-text p {
    font-size: 12px;
    color: var(--gray-500);
    margin: 0;
}

.sidebar-toggle-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: none;
    background: var(--gray-100);
    color: var(--gray-700);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.sidebar-toggle-btn:hover {
    background: var(--primary-color);
    color: white;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.admin-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
}

.admin-profile:hover {
    background: var(--gray-100);
}

.admin-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 16px;
}

.admin-info h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0;
}

.admin-info p {
    font-size: 12px;
    color: var(--gray-500);
    margin: 0;
}

/* Sidebar - Fixed Position with Collapse */
.sidebar {
    position: fixed;
    left: 0;
    top: var(--topbar-height);
    width: var(--sidebar-width);
    height: calc(100vh - var(--topbar-height));
    background: white;
    border-right: 1px solid var(--gray-200);
    overflow-x: hidden;
    overflow-y: auto;
    transition: width 0.3s ease;
    z-index: 1000;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-menu {
    padding: 20px 0;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    margin: 4px 10px;
    color: var(--gray-600);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s;
    white-space: nowrap;
    position: relative;
}

.menu-item:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.menu-item.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.menu-item svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.menu-item span {
    font-size: 14px;
    font-weight: 500;
    transition: opacity 0.3s;
}

.sidebar.collapsed .menu-item {
    justify-content: center;
    padding: 12px;
}

.sidebar.collapsed .menu-item span {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

/* Tooltip for collapsed sidebar */
.sidebar.collapsed .menu-item:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 70px;
    background: var(--gray-900);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    white-space: nowrap;
    z-index: 1002;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Main Content Area */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--topbar-height);
    min-height: calc(100vh - var(--topbar-height));
    transition: margin-left 0.3s ease;
}

.sidebar.collapsed ~ .main-content {
    margin-left: var(--sidebar-collapsed-width);
}

.content-wrapper {
    padding: 30px;
    max-width: 1400px;
}

/* Page Header */
.page-header {
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0 0 8px 0;
}

.page-header p {
    font-size: 14px;
    color: var(--gray-500);
    margin: 0;
}

.page-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    border: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary-color);
}

.stat-card.stat-primary::before { background: var(--primary-color); }
.stat-card.stat-success::before { background: var(--success-color); }
.stat-card.stat-danger::before { background: var(--danger-color); }
.stat-card.stat-warning::before { background: var(--warning-color); }
.stat-card.stat-info::before { background: var(--info-color); }

.stat-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-primary .stat-icon { background: rgba(102, 126, 234, 0.1); color: var(--primary-color); }
.stat-success .stat-icon { background: rgba(72, 187, 120, 0.1); color: var(--success-color); }
.stat-danger .stat-icon { background: rgba(245, 101, 101, 0.1); color: var(--danger-color); }
.stat-warning .stat-icon { background: rgba(237, 137, 54, 0.1); color: var(--warning-color); }
.stat-info .stat-icon { background: rgba(66, 153, 225, 0.1); color: var(--info-color); }

.stat-content {
    flex: 1;
}

.stat-content h3 {
    font-size: 32px;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0 0 4px 0;
    line-height: 1;
}

.stat-content p {
    font-size: 13px;
    color: var(--gray-500);
    margin: 0;
    font-weight: 500;
}

/* Cards */
.card {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--gray-200);
    margin-bottom: 24px;
    overflow: hidden;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--gray-50);
}

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0;
}

.card-body {
    padding: 24px;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 24px;
}

/* List Items */
.list-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--gray-50);
    border-radius: 8px;
    transition: all 0.3s;
}

.list-item:hover {
    background: var(--gray-100);
}

.list-item.unread {
    background: rgba(102, 126, 234, 0.05);
    border-left: 3px solid var(--primary-color);
}

.list-item-content {
    flex: 1;
}

.list-item-content h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0 0 6px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.list-item-content p {
    font-size: 13px;
    color: var(--gray-500);
    margin: 0;
}

.list-item-meta small {
    font-size: 12px;
    color: var(--gray-400);
}

.unread-dot {
    width: 8px;
    height: 8px;
    background: var(--danger-color);
    border-radius: 50%;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-primary { background: rgba(102, 126, 234, 0.1); color: #4c51bf; }
.badge-success { background: rgba(72, 187, 120, 0.1); color: #276749; }
.badge-danger { background: rgba(245, 101, 101, 0.1); color: #c53030; }
.badge-warning { background: rgba(237, 137, 54, 0.1); color: #c05621; }
.badge-info { background: rgba(66, 153, 225, 0.1); color: #2c5282; }
.badge-secondary { background: var(--gray-200); color: var(--gray-700); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #38a169;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #e53e3e;
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-300);
}

.btn-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

.btn-link:hover {
    text-decoration: underline;
}

/* Icon Buttons */
.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-icon-primary {
    background: rgba(102, 126, 234, 0.1);
    color: #4c51bf;
}

.btn-icon-primary:hover {
    background: rgba(102, 126, 234, 0.2);
}

.btn-icon-success {
    background: rgba(72, 187, 120, 0.1);
    color: #276749;
}

.btn-icon-success:hover {
    background: rgba(72, 187, 120, 0.2);
}

.btn-icon-danger {
    background: rgba(245, 101, 101, 0.1);
    color: #c53030;
}

.btn-icon-danger:hover {
    background: rgba(245, 101, 101, 0.2);
}

.action-buttons {
    display: flex;
    gap: 8px;
}

/* Filter Tabs */
.filter-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 10px 18px;
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    color: var(--gray-600);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
}

.filter-tab:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.filter-tab.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Search Form */
.search-form {
    display: flex;
    gap: 12px;
    align-items: center;
}

.search-input-wrapper {
    flex: 1;
    position: relative;
}

.search-input-wrapper svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
}

.search-input {
    width: 100%;
    padding: 12px 14px 12px 44px;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.clear-search {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 20px;
    text-decoration: none;
    cursor: pointer;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: var(--gray-50);
}

.data-table th {
    padding: 14px 18px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--gray-200);
}

.data-table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--gray-200);
    font-size: 14px;
}

.data-table tbody tr:hover {
    background: var(--gray-50);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 24px;
}

.page-link {
    padding: 8px 12px;
    background: white;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    color: var(--gray-700);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.page-link:hover {
    background: var(--gray-100);
    border-color: var(--primary-color);
}

.page-link.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    margin: 60px auto;
    border-radius: 12px;
    max-width: 600px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease;
}

.modal-content.modal-lg {
    max-width: 900px;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.modal-close {
    font-size: 24px;
    font-weight: 400;
    color: var(--gray-400);
    background: none;
    border: none;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.3s;
}

.modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: var(--gray-50);
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 13px;
    color: var(--gray-700);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* Alerts */
.alert {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid;
    font-size: 14px;
}

.alert-success {
    background: rgba(72, 187, 120, 0.1);
    color: #276749;
    border-left-color: var(--success-color);
}

.alert-danger {
    background: rgba(245, 101, 101, 0.1);
    color: #c53030;
    border-left-color: var(--danger-color);
}

.alert-info {
    background: rgba(66, 153, 225, 0.1);
    color: #2c5282;
    border-left-color: var(--info-color);
}

/* Details Grid */
.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.detail-item {
    padding: 16px;
    background: var(--gray-50);
    border-radius: 8px;
}

.detail-item.full-width {
    grid-column: 1 / -1;
}

.detail-item label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.detail-item p {
    font-size: 14px;
    color: var(--gray-900);
    font-weight: 500;
    margin: 0;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--gray-500);
}

/* Utility Classes */
.text-center { text-align: center; }
.text-muted { color: var(--gray-500); }
.text-danger { color: var(--danger-color); }
.text-success { color: var(--success-color); }

/* Responsive */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width);
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0,0,0,0.2);
    }
    
    .main-content {
        margin-left: 0 !important;
    }
    
    .topbar {
        padding: 0 15px;
    }
    
    .topbar-logo-text {
        display: none;
    }
    
    .admin-info {
        display: none;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .content-wrapper {
        padding: 20px 15px;
    }
}

.sidebar.collapsed .menu-item[style*="margin-top: auto"] {
    margin-top: auto !important;
}

/* Mobile Sidebar Styles - Add to admin.css */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
        top: var(--topbar-height);
        height: calc(100vh - var(--topbar-height));
        transition: transform 0.3s ease;
        z-index: 1002;
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0,0,0,0.2);
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: var(--topbar-height);
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1001;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
    
    .main-content {
        margin-left: 0 !important;
    }
    
    /* Ensure menu items are visible in mobile */
    .sidebar.mobile-open .menu-item span {
        opacity: 1 !important;
        width: auto !important;
        overflow: visible !important;
    }
    
    .sidebar.mobile-open .menu-item {
        justify-content: flex-start !important;
        padding: 12px 20px !important;
    }
}

/* Full Details Styles */
.full-details-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.details-section {
    padding: 20px;
    background: var(--gray-50);
    border-radius: 8px;
    border: 1px solid var(--gray-200);
}

.details-section h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0 0 16px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--gray-200);
}

/* Image Gallery Styles */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.image-item {
    text-align: center;
}

.image-item label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.image-preview {
    position: relative;
    width: 100%;
    height: 150px;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
}

.image-preview:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.image-preview:hover .image-overlay {
    opacity: 1;
}

.image-overlay svg {
    color: white;
    width: 32px;
    height: 32px;
}

/* Image Modal Styles */
#imageModal .modal-content {
    background: transparent;
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

#imageModal .modal-close {
    background: rgba(0,0,0,0.7);
    color: white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#imageModal .modal-close:hover {
    background: rgba(0,0,0,0.9);
}

/* Enhanced Sidebar Tooltips */
.sidebar.collapsed .menu-item:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: var(--gray-900);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    white-space: nowrap;
    z-index: 1002;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    margin-left: 8px;
}

/* Mobile sidebar improvements */
@media (max-width: 768px) {
    .sidebar.collapsed .menu-item:hover::after {
        display: none; /* Hide tooltips on mobile */
    }
    
    .image-gallery {
        grid-template-columns: 1fr;
    }
    
    .image-preview {
        height: 200px;
    }
}

/* File Preview Styles */
.file-preview {
    position: relative;
    width: 100%;
    height: 150px;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--gray-50);
}

.file-preview:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.file-icon {
    color: var(--gray-500);
    margin-bottom: 8px;
}

.file-name {
    font-size: 11px;
    color: var(--gray-600);
    text-align: center;
    padding: 0 8px;
    word-break: break-all;
    max-height: 40px;
    overflow: hidden;
}

.file-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(102, 126, 234, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.file-preview:hover .file-overlay {
    opacity: 1;
}

/* Enhanced Image Modal */
#imageModal .modal-content {
    background: rgba(0,0,0,0.9);
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

#imageModal .modal-close {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 2px solid rgba(255,255,255,0.5);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2001;
    backdrop-filter: blur(10px);
}

#imageModal .modal-close:hover {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.8);
}

#modalImage {
    max-width: 85vw;
    max-height: 85vh;
    object-fit: contain;
}

/* Small image handling */
.image-preview img[style*="object-fit: contain"] {
    background: linear-gradient(45deg, var(--gray-100) 25%, transparent 25%), 
                linear-gradient(-45deg, var(--gray-100) 25%, transparent 25%), 
                linear-gradient(45deg, transparent 75%, var(--gray-100) 75%), 
                linear-gradient(-45deg, transparent 75%, var(--gray-100) 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

/* Loading states */
.image-preview, .file-preview {
    position: relative;
}

.image-preview.loading::before,
.file-preview.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
}

.image-preview.loading::after {
    content: 'Loading...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--gray-500);
}

/* Image Gallery Styles */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.image-item {
    text-align: center;
}

.image-item label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.image-preview {
    position: relative;
    width: 100%;
    height: 150px;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
}

.image-preview:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.image-preview:hover .image-overlay {
    opacity: 1;
}

.image-overlay svg {
    color: white;
    width: 32px;
    height: 32px;
}

/* File Preview Styles */
.file-preview {
    position: relative;
    width: 100%;
    height: 150px;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--gray-50);
}

.file-preview:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.file-icon {
    color: var(--gray-500);
    margin-bottom: 8px;
}

.file-name {
    font-size: 11px;
    color: var(--gray-600);
    text-align: center;
    padding: 0 8px;
    word-break: break-all;
    max-height: 40px;
    overflow: hidden;
}

.file-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(102, 126, 234, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.file-preview:hover .file-overlay {
    opacity: 1;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    margin: 60px auto;
    border-radius: 12px;
    max-width: 600px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease;
}

.modal-close {
    font-size: 24px;
    font-weight: 400;
    color: var(--gray-400);
    background: none;
    border: none;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.3s;
}

.modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .image-gallery {
        grid-template-columns: 1fr;
    }
    
    .image-preview,
    .file-preview {
        height: 200px;
    }
}