/* Google Material Design 3 - Professional Light Theme */
:root {
    /* Color Palette - Material 3 Inspired */
    --md-sys-color-primary: #0b57d0;
    /* Google Blue 600 */
    --md-sys-color-on-primary: #ffffff;
    --md-sys-color-primary-container: #d3e3fd;
    /* Blue 100 */
    --md-sys-color-on-primary-container: #041e49;
    /* Blue 900 */

    --md-sys-color-secondary: #5e5e5e;
    /* Grey 700 */
    --md-sys-color-on-secondary: #ffffff;

    --md-sys-color-background: #f8f9fa;
    /* Grey 50 */
    --md-sys-color-on-background: #1f1f1f;
    /* Grey 900 */

    --md-sys-color-surface: #ffffff;
    --md-sys-color-on-surface: #1f1f1f;
    --md-sys-color-on-surface-variant: #444746;
    /* Grey 700 */

    --md-sys-color-outline: #747775;
    /* Grey 500 */
    --md-sys-color-outline-variant: #c4c7c5;
    /* Grey 300 */

    --md-sys-color-error: #b3261e;

    /* Elevation / Shadows */
    --md-sys-elevation-1: 0 1px 2px 0 rgba(0, 0, 0, 0.3), 0 1px 3px 1px rgba(0, 0, 0, 0.15);
    --md-sys-elevation-2: 0 1px 2px 0 rgba(0, 0, 0, 0.3), 0 2px 6px 2px rgba(0, 0, 0, 0.15);

    /* Typography */
    --font-family-base: 'Roboto', sans-serif;
    --font-family-brand: 'Google Sans', 'Roboto', sans-serif;

    /* Shape */
    --shape-corner-small: 4px;
    --shape-corner-medium: 12px;
    --shape-corner-large: 16px;
    --shape-corner-full: 9999px;

    /* Layout */
    --header-height: 64px;
    --drawer-width: 280px;
}

* {
    box-sizing: border-box;
}

body {
    background-color: var(--md-sys-color-background);
    color: var(--md-sys-color-on-background);
    font-family: var(--font-family-base);
    font-size: 16px;
    /* M3 Body Large */
    line-height: 1.5;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    height: 100vh;
    overflow: hidden;
    /* App Shell handles scrolling */
}

/* App Shell Grid Layout */
.app-shell {
    display: grid;
    grid-template-columns: var(--drawer-width) 1fr;
    grid-template-rows: var(--header-height) 1fr;
    grid-template-areas:
        "header header"
        "drawer main";
    height: 100vh;
    width: 100vw;
}

/* Top App Bar */
.top-app-bar {
    grid-area: header;
    background-color: var(--md-sys-color-surface);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
    z-index: 1000;
}

.start-section {
    display: flex;
    align-items: center;
    gap: 16px;
}

.icon-button {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    color: var(--md-sys-color-on-surface-variant);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.icon-button:hover {
    background-color: rgba(0, 0, 0, 0.08);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

#siteLogo {
    height: 28px;
    width: auto;
}

.site-title {
    font-family: var(--font-family-brand);
    font-size: 22px;
    color: var(--md-sys-color-on-surface-variant);
    font-weight: 400;
    letter-spacing: -0.5px;
}

/* Navigation Drawer */
.navigation-drawer {
    grid-area: drawer;
    background-color: var(--md-sys-color-surface);
    border-right: 1px solid var(--md-sys-color-outline-variant);
    /* Optional: Divider */
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
}

.nav-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-section-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--md-sys-color-on-surface-variant);
    padding: 16px 16px 8px 16px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    /* M3 specs: 56px height, 16px padding */
    height: 56px;
    border-radius: var(--shape-corner-full);
    text-decoration: none;
    color: var(--md-sys-color-on-surface-variant);
    font-family: var(--font-family-brand);
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s, color 0.2s;
}

.nav-item:hover {
    background-color: rgba(0, 0, 0, 0.04);
    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 .material-symbols-outlined {
    font-size: 24px;
}

.divider {
    height: 1px;
    background-color: var(--md-sys-color-outline-variant);
    margin: 8px 0;
}

/* Main Content */
.main-content {
    grid-area: main;
    background-color: var(--md-sys-color-background);
    overflow-y: auto;
    padding: 24px;
    border-radius: var(--shape-corner-large) 0 0 0;
    /* Optional: Rounded corner for content area */
}

.content-container {
    max-width: 1600px;
    margin: 0 auto;
}

.content-header {
    margin-bottom: 24px;
}

.content-header h1 {
    font-family: var(--font-family-brand);
    font-size: 28px;
    font-weight: 400;
    color: var(--md-sys-color-on-surface);
    margin: 0;
}

/* Cards */
.card {
    background-color: var(--md-sys-color-surface);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--shape-corner-medium);
    box-shadow: none;
    /* Flat outlined card */
    overflow: hidden;
}

.card-header {
    background-color: transparent;
    border-bottom: none;
    padding: 24px 24px 0 24px;
}

.card-header h5 {
    font-family: var(--font-family-brand);
    font-size: 20px;
    color: var(--md-sys-color-on-surface);
    margin: 0;
}

.card-body {
    padding: 24px;
}

/* Material Text Fields (Floating Label) */
.md-text-field {
    position: relative;
    border: 1px solid var(--md-sys-color-outline);
    border-radius: 4px;
    height: 56px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: var(--md-sys-color-surface);
}

.md-text-field:focus-within {
    border-color: var(--md-sys-color-primary);
    border-width: 2px;
    padding: 0 15px;
    /* Adjust for border width increase */
}

.md-text-field input,
.md-text-field textarea {
    border: none;
    background: transparent;
    width: 100%;
    height: 100%;
    font-family: var(--font-family-base);
    font-size: 16px;
    color: var(--md-sys-color-on-surface);
    outline: none;
    padding: 0;
    margin: 0;
    z-index: 1;
    /* Above label when focused/filled */
}

.md-text-field label {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--md-sys-color-surface);
    padding: 0 4px;
    color: var(--md-sys-color-on-surface-variant);
    font-size: 16px;
    transition: all 0.2s ease-out;
    pointer-events: none;
    z-index: 0;
}

/* Floating Label Logic */
.md-text-field input:focus+label,
.md-text-field input:not(:placeholder-shown)+label,
.md-text-field textarea:focus+label,
.md-text-field textarea:not(:placeholder-shown)+label {
    top: 0;
    left: 12px;
    font-size: 12px;
    color: var(--md-sys-color-primary);
    font-weight: 500;
    z-index: 2;
}

.md-text-field input:not(:focus):not(:placeholder-shown)+label,
.md-text-field textarea:not(:focus):not(:placeholder-shown)+label {
    color: var(--md-sys-color-on-surface-variant);
    /* Reset color when not focused but filled */
}

/* Textarea specific adjustments */
.md-text-field.textarea {
    height: auto;
    align-items: flex-start;
    padding-top: 16px;
}

.md-text-field.textarea label {
    top: 24px;
}

.md-text-field.textarea input:focus+label,
.md-text-field.textarea textarea:focus+label {
    top: -8px;
    /* Adjust for border */
}

/* Select Field */
.md-select-field {
    position: relative;
    border: 1px solid var(--md-sys-color-outline);
    border-radius: 4px;
    height: 56px;
}

.md-select-field:focus-within {
    border-color: var(--md-sys-color-primary);
    border-width: 2px;
}

.md-select-field .form-select {
    border: none;
    height: 100%;
    padding: 16px 16px 0 16px;
    /* Push text down */
    font-size: 16px;
    background-color: transparent;
    box-shadow: none;
}

.md-select-field .floating-label {
    position: absolute;
    top: 8px;
    left: 16px;
    font-size: 12px;
    color: var(--md-sys-color-on-surface-variant);
    pointer-events: none;
}

/* Helper Text */
.helper-text {
    font-size: 12px;
    color: var(--md-sys-color-on-surface-variant);
    margin-top: 4px;
    margin-left: 16px;
}

/* Buttons */
.btn {
    height: 40px;
    border-radius: var(--shape-corner-full);
    padding: 0 24px;
    font-family: var(--font-family-brand);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.1px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.btn-filled {
    background-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
}

.btn-filled:hover {
    background-color: #0b4eb5;
    /* Darker shade */
    box-shadow: var(--md-sys-elevation-1);
}

.btn-outlined {
    background-color: transparent;
    border: 1px solid var(--md-sys-color-outline);
    color: var(--md-sys-color-primary);
}

.btn-outlined:hover {
    background-color: rgba(11, 87, 208, 0.08);
    border-color: var(--md-sys-color-primary);
}

.btn-text {
    background-color: transparent;
    color: var(--md-sys-color-primary);
    padding: 0 12px;
}

.btn-text:hover {
    background-color: rgba(11, 87, 208, 0.08);
}

/* Range Slider */
.form-range {
    height: 4px;
    background-color: var(--md-sys-color-primary-container);
    border-radius: 2px;
}

.form-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    background: var(--md-sys-color-primary);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.1s;
    box-shadow: var(--md-sys-elevation-1);
}

.form-range::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.range-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--md-sys-color-on-surface);
    margin-bottom: 8px;
    display: block;
}

/* Utilities */
.d-none {
    display: none !important;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .app-shell {
        grid-template-columns: 1fr;
        grid-template-areas:
            "header"
            "main";
    }

    .navigation-drawer {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        width: 280px;
        z-index: 2000;
        transition: left 0.3s ease;
        box-shadow: var(--md-sys-elevation-2);
    }

    .navigation-drawer.open {
        left: 0;
    }

    .main-content {
        padding: 16px;
    }
}

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

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #dadce0;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #bdc1c6;
}

/* Footer */
.site-footer {
    text-align: center;
    padding: 24px;
    color: var(--md-sys-color-on-surface-variant);
    font-size: 12px;
    margin-top: auto;
    width: 100%;
}