/* Theme Variables */
:root {
    /* Layout */
    --sidebar-width: 250px;
    --sidebar-collapsed-width: 70px;
    --header-height: 60px;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-lg: 16px;

    /* Colors - Light Theme */
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --secondary-color: #6b7280;
    --accent-color: #06b6d4;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    
    /* Background Colors - Light Theme */
    --bg-body: #f9fafb;
    --bg-card: #ffffff;
    --bg-sidebar: #1e1b4b;
    --bg-hover: rgba(79, 70, 229, 0.05);
    --bg-active: rgba(79, 70, 229, 0.1);
    
    /* Text Colors - Light Theme */
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
    --text-light: #f3f4f6;
    
    /* Border Colors - Light Theme */
    --border-color: #e5e7eb;
    --border-light: rgba(255, 255, 255, 0.1);
    
    /* Shadow */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-regular: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    
    /* Transitions */
    --transition-speed: 0.2s;
    --transition-ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Theme Variables */
[data-theme="dark"] {
    /* Background Colors - Dark Theme */
    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --bg-sidebar: #0f172a;
    --bg-hover: rgba(148, 163, 184, 0.05);
    --bg-active: rgba(148, 163, 184, 0.1);
    
    /* Text Colors - Dark Theme */
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --text-light: #f1f5f9;
    
    /* Border Colors - Dark Theme */
    --border-color: #334155;
    --border-light: rgba(148, 163, 184, 0.1);
    
    /* Accent Colors Adjustments */
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --secondary-color: #64748b;
    
    /* Shadow Adjustments */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-regular: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.3);
}

/* Layout */
/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-body);
    color: var(--text-primary);
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    transition: background-color var(--transition-speed) var(--transition-ease),
                color var(--transition-speed) var(--transition-ease);
}

.dashboard-container {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* Main Content Styles */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem 2.5rem;
    transition: margin var(--transition-speed) var(--transition-ease);
    max-width: 1600px;
}

.main-content.expanded {
    margin-left: var(--sidebar-collapsed-width);
}

.content-header {
    margin-bottom: 2.5rem;
}

.content-header h1 {
    font-size: 1.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.content-header p {
    color: var(--text-secondary);
    font-size: 1rem;
}

.card {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    transition: box-shadow var(--transition-speed) var(--transition-ease),
                transform var(--transition-speed) var(--transition-ease);
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Search Bar */
.search-bar {
    margin-bottom: 2rem;
    position: relative;
    max-width: 600px;
}

.search-input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 2.75rem;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all var(--transition-speed) var(--transition-ease);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-color-light);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.search-input::placeholder {
    color: var(--text-muted);
}

/* Utility Classes */
.d-flex {
    display: flex !important;
}

.align-items-center {
    align-items: center !important;
}

.justify-content-between {
    justify-content: space-between !important;
}

.gap-2 {
    gap: 0.5rem !important;
}

.gap-3 {
    gap: 0.75rem !important;
}

.gap-4 {
    gap: 1rem !important;
}

.mb-2 {
    margin-bottom: 0.5rem !important;
}

.mb-3 {
    margin-bottom: 0.75rem !important;
}

.mb-4 {
    margin-bottom: 1rem !important;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: var(--border-radius-sm);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-speed) var(--transition-ease);
    border: 1px solid transparent;
}

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

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

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

.btn-secondary:hover {
    background-color: var(--text-muted);
}

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

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

.btn-icon {
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-sm);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.813rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

/* File Grid */
.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.file-card {
    background: var(--bg-card);
    border-radius: var(--border-radius-md);
    padding: 1rem;
    border: 1px solid var(--border-light);
    transition: all var(--transition-speed) var(--transition-ease);
}

.file-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.file-icon {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
}

.file-name {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    word-break: break-word;
}

.file-info {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Bootstrap Overrides */
.btn-primary {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.btn-primary:hover {
    background-color: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
}

.form-control {
    background-color: var(--bg-input) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

.form-control:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 0.2rem var(--primary-color-light) !important;
}

.nav-tabs {
    border-bottom-color: var(--border-color);
}

.nav-tabs .nav-link {
    color: var(--text-secondary);
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    padding: 0.75rem 1rem;
    margin-bottom: -1px;
    transition: all var(--transition-speed) var(--transition-ease);
}

.nav-tabs .nav-link:hover {
    color: var(--text-primary);
    border-bottom-color: var(--border-color);
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: transparent;
}

.list-group-item {
    background-color: var(--bg-card) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

.dropdown-menu {
    background-color: var(--bg-card) !important;
    border-color: var(--border-light) !important;
    box-shadow: var(--shadow-lg) !important;
    padding: 0.5rem !important;
}

.dropdown-item {
    color: var(--text-primary) !important;
    padding: 0.5rem 1rem !important;
    border-radius: var(--border-radius-sm) !important;
}

.dropdown-item:hover {
    background-color: var(--bg-hover) !important;
    color: var(--primary-color) !important;
}

.alert {
    background-color: var(--bg-card) !important;
    border-color: var(--border-light) !important;
    color: var(--text-primary) !important;
}

.alert-primary {
    background-color: var(--primary-color-light) !important;
    border-color: var(--primary-color) !important;
    color: var(--primary-color) !important;
}

.badge {
    font-weight: 500 !important;
    padding: 0.35em 0.65em !important;
}

.badge-primary {
    background-color: var(--primary-color) !important;
    color: var(--text-light) !important;
}

.table {
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

.table th, 
.table td {
    border-color: var(--border-color) !important;
}

.modal-content {
    background-color: var(--bg-card) !important;
    color: var(--text-primary) !important;
}

.modal-header, 
.modal-footer {
    border-color: var(--border-color) !important;
}

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    color: var(--text-light);
    transition: all var(--transition-speed) var(--transition-ease);
    position: fixed;
    height: 100vh;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-header {
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-header h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-nav {
    padding: 0.5rem 0;
    flex-grow: 1;
}

.nav-link {
    padding: 0.75rem 1rem;
    margin: 0.25rem 0;
    border-radius: var(--border-radius-sm);
    color: var(--text-light);
    opacity: 0.8;
    transition: all var(--transition-speed) var(--transition-ease);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
}

.nav-link:hover {
    background: var(--bg-hover);
    opacity: 1;
    color: var(--text-light);
}

.nav-link.active {
    background: var(--bg-active);
    color: var(--primary-color);
    opacity: 1;
}

.nav-link i {
    font-size: 1.1em;
    width: 1.5rem;
    text-align: center;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 2rem;
    transition: all var(--transition-speed) ease;
}

.main-content.expanded {
    margin-left: var(--sidebar-collapsed-width);
}

/* Cards and Widgets */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-speed) ease;
}

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

.card-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.stats-card {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
}

/* Theme Specific Elements */
.bg-light {
    background-color: var(--bg-body) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

.border {
    border-color: var(--border-color) !important;
}

.table {
    color: var(--text-primary);
}

.table-light {
    background-color: var(--bg-hover);
}

.breadcrumb-item a {
    color: var(--accent-color);
}

.breadcrumb-item.active {
    color: var(--text-primary);
}

.dropdown-menu {
    background-color: var(--bg-card);
    border-color: var(--border-color);
}

.dropdown-item {
    color: var(--text-primary);
}

.dropdown-item:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

/* File Manager */
.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    padding: 1rem 0;
}

.file-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
}

.file-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-regular);
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    padding: 0.5rem;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all var(--transition-speed) ease;
}

.theme-toggle:hover {
    box-shadow: var(--shadow-regular);
}

/* Form Elements */
.form-control, .form-select {
    background-color: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.form-control:focus, .form-select:focus {
    background-color: var(--bg-card);
    border-color: var(--accent-color);
    color: var(--text-primary);
}

.input-group-text {
    background-color: var(--bg-hover);
    border-color: var(--border-color);
    color: var(--text-primary);
}

/* Modal Styles */
.modal-content {
    background-color: var(--bg-card);
    border-color: var(--border-color);
}

.modal-header, .modal-footer {
    border-color: var(--border-color);
}

/* Alert Styles */
.alert {
    background-color: var(--bg-card);
    border-color: var(--border-color);
}

.file-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Drag and Drop */
.drop-zone {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    margin: 1rem 0;
    transition: all 0.2s ease;
}

.drop-zone.drag-active {
    border-color: var(--accent-color);
    background: rgba(52, 152, 219, 0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 100%;
        max-width: 300px;
    }
    
    .sidebar.show {
        transform: translateX(0);
        box-shadow: 2px 0 10px rgba(0,0,0,0.2);
    }
    
    .main-content {
        margin-left: 0;
        padding: 1rem;
    }
    
    .file-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 0.75rem;
    }

    .stats-card {
        padding: 1rem;
    }

    .nav-item {
        padding: 0.75rem 1rem;
    }

    .breadcrumb {
        font-size: 0.875rem;
        padding: 0.5rem 0;
    }

    .file-item {
        padding: 0.75rem;
    }

    .drop-zone {
        padding: 1rem;
    }
}

/* Small Mobile Devices */
@media (max-width: 576px) {
    .sidebar {
        max-width: 100%;
    }

    .main-content {
        padding: 0.75rem;
    }

    .file-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.5rem;
    }

    .file-item {
        padding: 0.5rem;
    }

    .file-item:hover {
        transform: none;
    }

    .context-menu {
        width: 200px;
    }

    .drop-zone {
        padding: 0.75rem;
        margin: 0.5rem 0;
    }
}

/* Utilities */
.progress-thin {
    height: 4px;
}

.storage-info {
    font-size: 0.875rem;
}

/* Context Menu */
.context-menu {
    position: fixed;
    background: white;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    padding: 0.5rem 0;
    z-index: 1000;
}

.context-menu-item {
    padding: 0.5rem 1rem;
    cursor: pointer;
}

.context-menu-item:hover {
    background: var(--light-bg);
}

/* Modal styles */
.custom-modal {
    background: rgba(0,0,0,0.5);
}

.modal-content {
    border-radius: 8px;
    border: none;
}

/* Animations */
.fade-enter {
    opacity: 0;
}

.fade-enter-active {
    opacity: 1;
    transition: opacity 200ms ease-in;
}

.fade-exit {
    opacity: 1;
}

.fade-exit-active {
    opacity: 0;
    transition: opacity 200ms ease-in;
}

/* Profile-specific responsive tweaks */
@media (max-width: 768px) {
    .profile-header,
    .profile-info,
    .profile-cards {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    .profile-avatar {
        margin: 0 auto 1rem auto !important;
        display: block !important;
    }
    .profile-actions {
        flex-direction: column !important;
        gap: 0.75rem !important;
    }
    .main-content {
        padding: 1rem !important;
    }
    .card {
        padding: 1rem !important;
    }
}
@media (max-width: 576px) {
    .main-content {
        padding: 0.5rem !important;
    }
    .card {
        padding: 0.5rem !important;
    }
    .profile-header {
        font-size: 1.1rem !important;
    }
}