@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200');

/* ==========================================================================
   Google Material Design 3 Style Sheet - Enterprise Asset Management
   ========================================================================== */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--md-font-family);
    background-color: var(--md-sys-color-background);
    color: var(--md-sys-color-on-background);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Typography styles */
h1, h2, h3, h4, h5, h6 {
    font-weight: 500;
    color: var(--md-sys-color-on-background);
}

a {
    color: var(--md-sys-color-primary);
    text-decoration: none;
    transition: color var(--md-transition-duration) var(--md-transition-easing);
}

a:hover {
    color: var(--md-sys-color-primary-container);
}

.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    vertical-align: middle;
}


/* ----------------------------------------------------
   AUTHENTICATION LAYOUT
   ---------------------------------------------------- */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 24px;
    background: radial-gradient(circle at 0% 0%, var(--md-sys-color-primary-container) 0%, var(--md-sys-color-background) 60%);
}

.auth-card {
    background-color: var(--md-sys-color-surface); /* M3 surface container */
    border-radius: var(--md-shape-corner-extra-large);
    box-shadow: var(--md-elevation-3);
    padding: 40px;
    width: 100%;
    max-width: 460px;
    transition: transform var(--md-transition-duration) var(--md-transition-easing);
}

.auth-card:hover {
    transform: translateY(-2px);
}

.auth-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 700;
    color: var(--md-sys-color-primary);
    margin-bottom: 24px;
    justify-content: center;
}

.auth-title {
    font-size: 28px;
    font-weight: 500;
    margin-bottom: 8px;
    text-align: center;
}

.auth-subtitle {
    font-size: 14px;
    color: var(--md-sys-color-on-surface-variant);
    margin-bottom: 32px;
    text-align: center;
}

/* Inputs & Form Controls */
.form-field {
    position: relative;
    margin-bottom: 20px;
    width: 100%;
}

.form-input, .form-select {
    width: 100%;
    padding: 16px;
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-shape-corner-small);
    background-color: transparent;
    font-family: inherit;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus, .form-select:focus {
    border-color: var(--md-sys-color-primary);
    border-width: 2px;
    box-shadow: 0 0 0 3px rgba(103, 80, 164, 0.15);
}

.form-label {
    position: absolute;
    left: 12px;
    top: -8px;
    background-color: var(--md-sys-color-surface);
    padding: 0 6px;
    font-size: 12px;
    color: var(--md-sys-color-primary);
    pointer-events: none;
}

/* M3 Filled/Outline Buttons */
.btn-primary {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 14px 24px;
    background-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    border: none;
    border-radius: var(--md-shape-corner-full);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color var(--md-transition-duration), box-shadow var(--md-transition-duration);
}

.btn-primary:hover {
    background-color: #533f8a;
    box-shadow: var(--md-elevation-1);
}

.btn-text {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 12px;
    background: none;
    border: none;
    color: var(--md-sys-color-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--md-shape-corner-full);
}

.btn-text:hover {
    background-color: rgba(103, 80, 164, 0.08);
}

/* Notifications inside forms */
.alert {
    padding: 12px 16px;
    border-radius: var(--md-shape-corner-small);
    font-size: 14px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-error {
    background-color: var(--md-sys-color-error-container);
    color: var(--md-sys-color-on-error-container);
}

.alert-success {
    background-color: #d1e7dd;
    color: #0f5132;
}

/* ----------------------------------------------------
   MAIN APP / DASHBOARD LAYOUT
   ==================================================== */
.app-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

/* Navigation Drawer */
.sidebar {
    background-color: var(--md-sys-color-surface);
    border-right: 1px solid var(--md-sys-color-outline-variant);
    padding: 24px 12px;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
}

.brand-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    font-size: 20px;
    font-weight: 600;
    color: var(--md-sys-color-primary);
    margin-bottom: 32px;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--md-sys-color-on-surface-variant);
    padding-left: 16px;
    margin-bottom: 8px;
    letter-spacing: 0.8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    color: var(--md-sys-color-on-surface-variant);
    border-radius: var(--md-shape-corner-full);
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    margin-bottom: 4px;
    transition: background-color 0.15s, color 0.15s;
}

.nav-item:hover {
    background-color: rgba(98, 91, 113, 0.08);
    color: var(--md-sys-color-on-surface);
}

.nav-item.active {
    background-color: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
}

.nav-item .badge {
    margin-left: auto;
    background-color: var(--md-sys-color-primary);
    color: #FFFFFF;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
}

/* User Profile Section in Sidebar */
.user-profile-section {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-top: 1px solid var(--md-sys-color-outline-variant);
    padding-top: 16px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--md-shape-corner-full);
    background-color: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
}

.user-meta {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
}

.user-role {
    font-size: 12px;
    color: var(--md-sys-color-on-surface-variant);
}

/* Header & Search Bar */
.main-content {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background-color: var(--md-sys-color-background); /* Sleek dynamic background */
}

.header {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
    background-color: var(--md-sys-color-surface);
    position: sticky;
    top: 0;
    z-index: 10;
}

.search-bar-container {
    position: relative;
    width: 100%;
    max-width: 540px;
}

.search-input {
    width: 100%;
    padding: 10px 16px 10px 48px;
    border: none;
    border-radius: var(--md-shape-corner-full);
    background-color: var(--md-sys-color-surface);
    font-size: 15px;
    outline: none;
    transition: background-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
    background-color: var(--md-sys-color-surface);
    box-shadow: var(--md-elevation-1);
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--md-sys-color-on-surface-variant);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.icon-btn {
    border: none;
    background: none;
    color: var(--md-sys-color-on-surface-variant);
    padding: 8px;
    border-radius: var(--md-shape-corner-full);
    cursor: pointer;
    transition: background-color 0.2s;
    position: relative;
}

.icon-btn:hover {
    background-color: rgba(98, 91, 113, 0.08);
}

.icon-btn .dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    border-radius: var(--md-shape-corner-full);
    background-color: var(--md-sys-color-error);
}

/* ----------------------------------------------------
   PANELS & WORKSPACES
   ==================================================== */
.workspace-panel {
    padding: 32px;
}

.welcome-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.welcome-title {
    font-size: 28px;
    margin-bottom: 4px;
}

.welcome-subtitle {
    font-size: 14px;
    color: var(--md-sys-color-on-surface-variant);
}

.action-row {
    display: flex;
    gap: 16px;
}

/* Metric Cards Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.metric-card {
    background-color: var(--md-sys-color-surface);
    border-radius: var(--md-shape-corner-large);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    border: 1px solid var(--md-sys-color-outline-variant);
}

.metric-icon-box {
    width: 48px;
    height: 48px;
    border-radius: var(--md-shape-corner-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
}

.metric-info {
    display: flex;
    flex-direction: column;
}

.metric-label {
    font-size: 12px;
    color: var(--md-sys-color-on-surface-variant);
}

.metric-value {
    font-size: 22px;
    font-weight: 600;
}

/* Dashboard Sections */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 32px;
}

.dashboard-card {
    background-color: var(--md-sys-color-surface);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-shape-corner-large);
    padding: 24px;
    margin-bottom: 24px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card-title {
    font-size: 18px;
    font-weight: 500;
}

/* Lists and Tables */
.asset-table {
    width: 100%;
    border-collapse: collapse;
}

.asset-table th {
    text-align: left;
    padding: 12px;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--md-sys-color-on-surface-variant);
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.asset-table td {
    padding: 16px 12px;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
    font-size: 14px;
    color: var(--md-sys-color-on-surface);
}

.asset-table tr:hover {
    background-color: rgba(98, 91, 113, 0.04);
}

.file-name-cell {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

.file-icon {
    color: var(--md-sys-color-primary);
}

.status-badge {
    padding: 4px 10px;
    border-radius: var(--md-shape-corner-full);
    font-size: 12px;
    font-weight: 500;
    text-transform: capitalize;
}

.status-draft { background-color: #E7E0EC; color: #49454F; }
.status-submitted { background-color: #E8DEF8; color: #1D192B; }
.status-review { background-color: #FFD8E4; color: #31111D; }
.status-approved { background-color: #d1e7dd; color: #0f5132; }
.status-rejected { background-color: #f8d7da; color: #842029; }

/* Upload Area */
.upload-dropzone {
    border: 2px dashed var(--md-sys-color-outline);
    border-radius: var(--md-shape-corner-large);
    padding: 40px;
    text-align: center;
    background-color: var(--md-sys-color-surface);
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
    margin-bottom: 24px;
}

.upload-dropzone:hover {
    border-color: var(--md-sys-color-primary);
    background-color: var(--md-sys-color-primary-container);
}

.upload-icon {
    font-size: 48px;
    color: var(--md-sys-color-primary);
    margin-bottom: 16px;
}

/* Modals / Dialogs */
.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.4);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.dialog {
    background-color: var(--md-sys-color-surface);
    border-radius: var(--md-shape-corner-extra-large);
    box-shadow: var(--md-elevation-4);
    padding: 32px;
    width: 100%;
    max-width: 500px;
    position: relative;
    animation: scaleUp 0.3s cubic-bezier(0.2, 0, 0, 1);
}

@keyframes scaleUp {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.dialog-header {
    margin-bottom: 20px;
}

.dialog-title {
    font-size: 22px;
    font-weight: 500;
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 32px;
}

.btn-secondary {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 12px 24px;
    background-color: transparent;
    color: var(--md-sys-color-primary);
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-shape-corner-full);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.btn-secondary:hover {
    background-color: rgba(103, 80, 164, 0.08);
}

/* ----------------------------------------------------
   RESPONSIVE OVERRIDES
   ---------------------------------------------------- */
@media(max-width: 1024px) {
    .app-layout {
        grid-template-columns: 80px 1fr;
    }
    .sidebar {
        padding: 24px 6px;
    }
    .brand-header span:not(.material-symbols-outlined),
    .nav-section-title,
    .nav-item span:not(.material-symbols-outlined),
    .user-meta {
        display: none;
    }
    .nav-item {
        justify-content: center;
        padding: 12px;
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   DARK MODE STYLE OVERRIDES
   Premium M3 dark theme with layered tinted surfaces
   ============================================================ */
[data-theme="dark"] body {
    color-scheme: dark;
}

/* Auth pages — deep gradient background */
[data-theme="dark"] .auth-container {
    background: radial-gradient(circle at 0% 0%, #2D2440 0%, #121016 60%);
}

/* Sidebar — subtle tinted surface above background */
[data-theme="dark"] .sidebar {
    background-color: #1D1A22;
    border-right-color: #49454F;
}

/* Nav items — hover/active with tinted surfaces */
[data-theme="dark"] .nav-item:hover {
    background-color: rgba(208, 188, 255, 0.08);
    color: #E6E0E9;
}

[data-theme="dark"] .nav-item.active {
    background-color: #4F378B;
    color: #EADDFF;
}

/* Header bar — elevated tinted surface */
[data-theme="dark"] .header {
    background-color: #211F26;
    border-bottom-color: #49454F;
}

/* Search — darker input well */
[data-theme="dark"] .search-input {
    background-color: #2B2930;
    color: #E6E0E9;
    border: 1px solid #49454F;
}

[data-theme="dark"] .search-input:focus {
    background-color: #322F37;
    border-color: #D0BCFF;
    box-shadow: 0 0 0 3px rgba(208, 188, 255, 0.15);
}

[data-theme="dark"] .search-input::placeholder {
    color: #938F99;
}

/* Cards — elevated tinted surfaces over background */
[data-theme="dark"] .dashboard-card {
    background-color: #211F26;
    border-color: #49454F;
}

[data-theme="dark"] .metric-card {
    background-color: #211F26;
    border-color: #49454F;
}

/* Metric icon boxes — deeper tinted containers */
[data-theme="dark"] .metric-icon-box {
    background-color: #4F378B;
    color: #EADDFF;
}

/* Tables — dark rows with subtle hover tinting */
[data-theme="dark"] .asset-table th {
    color: #CAC4D0;
    border-bottom-color: #49454F;
}

[data-theme="dark"] .asset-table td {
    border-bottom-color: #322F37;
    color: #E6E0E9;
}

[data-theme="dark"] .asset-table tr:hover {
    background-color: rgba(208, 188, 255, 0.05);
}

/* Status badges — muted dark containers */
[data-theme="dark"] .status-draft { background-color: #322F37; color: #CAC4D0; }
[data-theme="dark"] .status-submitted { background-color: #4F378B; color: #EADDFF; }
[data-theme="dark"] .status-review { background-color: #633B48; color: #FFD8E4; }
[data-theme="dark"] .status-approved { background-color: #1B3A2A; color: #A6D4B4; }
[data-theme="dark"] .status-rejected { background-color: #5C1E1E; color: #F2B8B5; }

/* Buttons — ensure proper contrast */
[data-theme="dark"] .btn-primary {
    background-color: #D0BCFF;
    color: #381E72;
}

[data-theme="dark"] .btn-primary:hover {
    background-color: #E0D0FF;
    box-shadow: 0 2px 8px rgba(208, 188, 255, 0.25);
}

[data-theme="dark"] .btn-secondary {
    border-color: #938F99;
    color: #D0BCFF;
}

[data-theme="dark"] .btn-secondary:hover {
    background-color: rgba(208, 188, 255, 0.08);
}

[data-theme="dark"] .btn-text {
    color: #D0BCFF;
}

[data-theme="dark"] .btn-text:hover {
    background-color: rgba(208, 188, 255, 0.08);
}

/* Icon buttons */
[data-theme="dark"] .icon-btn {
    color: #CAC4D0;
}

[data-theme="dark"] .icon-btn:hover {
    background-color: rgba(208, 188, 255, 0.12);
}

/* Alerts */
[data-theme="dark"] .alert-error {
    background-color: #5C1E1E;
    color: #F2B8B5;
}

[data-theme="dark"] .alert-success {
    background-color: #1B3A2A;
    color: #A6D4B4;
}

/* Upload dropzone */
[data-theme="dark"] .upload-dropzone {
    border-color: #49454F;
    background-color: #1D1A22;
}

[data-theme="dark"] .upload-dropzone:hover {
    border-color: #D0BCFF;
    background-color: rgba(208, 188, 255, 0.08);
}

/* Dialogs — floating tinted surface */
[data-theme="dark"] .dialog {
    background-color: #2B2930;
    border: 1px solid #49454F;
}

[data-theme="dark"] .dialog-overlay {
    background-color: rgba(0, 0, 0, 0.65);
}

/* Form fields in dark mode */
[data-theme="dark"] .form-input,
[data-theme="dark"] .form-select {
    background-color: #1D1A22;
    color: #E6E0E9;
    border-color: #938F99;
}

[data-theme="dark"] .form-input:focus,
[data-theme="dark"] .form-select:focus {
    border-color: #D0BCFF;
    box-shadow: 0 0 0 3px rgba(208, 188, 255, 0.2);
}

[data-theme="dark"] .form-label {
    background-color: #2B2930;
    color: #D0BCFF;
}

/* User profile section */
[data-theme="dark"] .user-profile-section {
    border-top-color: #49454F;
}

[data-theme="dark"] .user-avatar {
    background-color: #4F378B;
    color: #EADDFF;
}

/* Badge count */
[data-theme="dark"] .nav-item .badge {
    background-color: #D0BCFF;
    color: #381E72;
}

/* File icons */
[data-theme="dark"] .file-icon {
    color: #D0BCFF;
}

/* Selection color */
[data-theme="dark"] ::selection {
    background-color: rgba(208, 188, 255, 0.35);
    color: #FFFFFF;
}

/* Scrollbar styling for dark mode */
[data-theme="dark"] ::-webkit-scrollbar {
    width: 8px;
}
[data-theme="dark"] ::-webkit-scrollbar-track {
    background: #121016;
}
[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #49454F;
    border-radius: 4px;
}
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #938F99;
}

/* ----------------------------------------------------
   FOLDERS GRID & CARDS (M3 spec)
   ---------------------------------------------------- */
.folder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
    margin-top: 16px;
}

.folder-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background-color: var(--md-sys-color-surface);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-shape-corner-medium);
    cursor: pointer;
    transition: background-color var(--md-transition-duration) var(--md-transition-easing), transform var(--md-transition-duration) var(--md-transition-easing);
}

.folder-card:hover {
    background-color: var(--md-sys-color-surface-variant);
    transform: translateY(-2px);
}

.folder-card .folder-icon {
    font-size: 32px;
    color: var(--md-sys-color-primary);
}

.folder-card .folder-info {
    display: flex;
    flex-direction: column;
}

.folder-card .folder-name {
    font-weight: 500;
    font-size: 14px;
    color: var(--md-sys-color-on-surface);
}

.folder-card .folder-meta {
    font-size: 11px;
    color: var(--md-sys-color-on-surface-variant);
    margin-top: 2px;
}

/* Dark mode specific override for folder icons */
[data-theme="dark"] .folder-card .folder-icon {
    color: #D0BCFF;
}

