/**
 * FileHub - Modern UI Theme
 * Enhanced styles for better visual appeal
 */

/* ===== CSS VARIABLES ===== */
:root {
    /* Primary Colors */
    --primary: #4f46e5;
    --primary-light: #818cf8;
    --primary-dark: #3730a3;
    --primary-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    
    /* Secondary Colors */
    --secondary: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    
    /* Background Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-dark: #0f172a;
    
    /* Text Colors */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    
    /* Border Colors */
    --border-light: #e2e8f0;
    --border-medium: #cbd5e1;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ===== GLOBAL STYLES ===== */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== ENHANCED CARDS ===== */
.card {
    border: none;
    border-radius: var(--radius-lg);
    background: var(--bg-primary);
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-light);
    padding: 1.25rem 1.5rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-light);
    padding: 1rem 1.5rem;
}

/* ===== ENHANCED BUTTONS ===== */
.btn {
    border: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    padding: 0.625rem 1.25rem;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.3);
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: var(--border-light);
    color: var(--text-primary);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-outline-primary {
    border: 2px solid var(--primary);
    color: var(--primary);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: white;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
}

/* ===== ENHANCED FORM CONTROLS ===== */
.form-control, .form-select {
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    transition: all var(--transition-fast);
    background: var(--bg-primary);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
    outline: none;
}

.form-control:hover, .form-select:hover {
    border-color: var(--border-medium);
}

.form-label {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--border-medium);
    transition: all var(--transition-fast);
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.25);
}

/* ===== ENHANCED NAVIGATION ===== */
.navbar {
    background: var(--bg-primary);
    box-shadow: var(--shadow-sm);
    padding: 0.75rem 1.5rem;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0.625rem 1rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.nav-link:hover {
    color: var(--primary);
    background: rgba(79, 70, 229, 0.05);
}

.nav-link.active {
    color: var(--primary);
    background: rgba(79, 70, 229, 0.1);
}

/* ===== SIDEBAR ENHANCEMENTS ===== */
.sidebar {
    background: var(--bg-primary);
    border-right: 1px solid var(--border-light);
    min-height: calc(100vh - 70px);
    padding: 1.5rem 1rem;
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    margin-bottom: 0.25rem;
    border-radius: var(--radius-md);
}

.sidebar .nav-link i {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
}

/* ===== ENHANCED TABLES ===== */
.table {
    border-collapse: separate;
    border-spacing: 0;
}

.table th {
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 1rem;
    border-bottom: 2px solid var(--border-light);
    background: var(--bg-secondary);
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background: var(--bg-secondary);
    transition: background var(--transition-fast);
}

/* ===== ENHANCED BADGES ===== */
.badge {
    font-weight: 500;
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
}

.badge.bg-success {
    background: rgba(16, 185, 129, 0.1) !important;
    color: var(--success);
}

.badge.bg-danger {
    background: rgba(239, 68, 68, 0.1) !important;
    color: var(--danger);
}

.badge.bg-warning {
    background: rgba(245, 158, 11, 0.1) !important;
    color: var(--warning);
}

.badge.bg-info {
    background: rgba(59, 130, 246, 0.1) !important;
    color: var(--info);
}

.badge.bg-primary {
    background: rgba(79, 70, 229, 0.1) !important;
    color: var(--primary);
}

.badge.bg-secondary {
    background: rgba(100, 116, 139, 0.1) !important;
    color: var(--secondary);
}

/* ===== ENHANCED ALERTS ===== */
.alert {
    border: none;
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
}

/* ===== ENHANCED MODALS ===== */
.modal-content {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
}

.modal-header {
    border-bottom: 1px solid var(--border-light);
    padding: 1.25rem 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--border-light);
    padding: 1rem 1.5rem;
}

/* ===== ENHANCED DROPDOWNS ===== */
.dropdown-menu {
    border: none;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
}

.dropdown-item {
    border-radius: var(--radius-sm);
    padding: 0.625rem 1rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.dropdown-item:hover {
    background: var(--bg-secondary);
}

.dropdown-item i {
    width: 20px;
    text-align: center;
}

/* ===== ENHANCED PROGRESS BARS ===== */
.progress {
    background: var(--bg-tertiary);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    border-radius: 10px;
    transition: width var(--transition-slow);
}

/* ===== ENHANCED PAGINATION ===== */
.pagination .page-link {
    border: none;
    border-radius: var(--radius-md);
    padding: 0.625rem 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin: 0 0.125rem;
    transition: all var(--transition-fast);
}

.pagination .page-link:hover {
    background: var(--bg-tertiary);
    color: var(--primary);
}

.pagination .page-item.active .page-link {
    background: var(--primary);
    color: white;
}

/* ===== ENHANCED TOASTS ===== */
.toast-container {
    z-index: 1060;
}

.toast {
    border: none;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

/* ===== UTILITY CLASSES ===== */
.text-gradient {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-gradient {
    background: var(--primary-gradient);
}

.shadow-soft {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.rounded-xl {
    border-radius: var(--radius-xl);
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

/* ===== FILE ITEM GRID DROPDOWN FIXES ===== */
.file-item-grid .dropdown-menu {
    z-index: 1050;
}

/* Ensure dropdowns in grid cards are visible and clickable */
.file-item-grid .dropdown {
    position: relative;
    z-index: 10;
}

.file-item-grid .dropdown .btn {
    position: relative;
    z-index: 11;
}

/* Ensure card-footer allows dropdown to overflow */
.file-item-grid .card-footer {
    position: relative;
    z-index: auto;
    overflow: visible;
}

.file-item-grid {
    overflow: visible;
}

.file-item-grid .col {
    overflow: visible;
}

/* ===== RESPONSIVE IMPROVEMENTS ===== */
@media (max-width: 768px) {
    .card {
        border-radius: var(--radius-md);
    }
    
    .sidebar {
        min-height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-light);
    }
}
