/* MET-DATA IMD Systems - Professional Stylesheet
   Focus: Stability, Clean Scrolling, & User Experience
*/

:root {
    /* Advanced Dark Theme Color Palette */
    --bg-main: #020617;
    /* Very dark navy */
    --sidebar-bg: #0f172a;
    /* Dark navy */
    --sidebar-active: rgba(37, 99, 235, 0.4);
    --primary: #2563eb;
    --primary-soft: rgba(37, 99, 235, 0.15);
    --text-main: #f8fafc;
    /* White-ish */
    --text-muted: #94a3b8;
    /* Slate gray */
    --glass: rgba(15, 23, 42, 0.9);
    --border: rgba(255, 255, 255, 0.1);
    --success: #22c55e;
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);

    /* Dimensions & Radius */
    --sidebar-width: 280px;
    --sidebar-collapsed: 80px;
    --header-height: 70px;
    --radius: 16px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

/* 1. Global Reset & Scrollbar */
* {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    overflow: hidden;
    /* Prevent body from scrolling, only main content scrolls */
}

/* Custom Scrollbar for Chrome/Safari */
::-webkit-scrollbar {
    width: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* 2. Layout Structure */
.app-shell {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* 3. Sidebar (Fixed Left) */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: white;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    flex-shrink: 0;
    z-index: 1000;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.5rem;
    margin-bottom: 2.5rem;
}

.logo-box {
    background: var(--primary);
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 1.4rem;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.brand-text .main-logo {
    display: block;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

.brand-text .sub-logo {
    font-size: 0.7rem;
    color: #94a3b8;
    text-transform: uppercase;
    font-weight: 600;
}

/* Sidebar Navigation */
.side-nav {
    flex-grow: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 12px;
    margin-bottom: 6px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.nav-item i {
    font-size: 1.25rem;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.nav-item.active {
    background: var(--sidebar-active);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.sidebar-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    color: #94a3b8;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 12px var(--success);
}

/* 4. Main Content Area (Scrollable) */
.main-content {
    flex: 1;
    overflow-y: auto;
    /* Proper scrolling container */
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Sticky Top Header */
.top-header {
    position: sticky;
    top: 0;
    background: rgba(15, 23, 42, 0.85);
    /* Dark Glass */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 3rem;
    border-bottom: 1px solid var(--border);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.crumb-current {
    color: var(--text-main);
    font-weight: 600;
}

.date-display {
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 18px;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-main);
}

/* 5. Form & Content Body */
.content-body {
    padding: 3rem;
    display: flex;
    justify-content: center;
}

.glass-card {
    background: var(--glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: var(--glass-shadow);
    width: 100%;
    max-width: 850px;
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-intro h2 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    color: #facc15;
    /* Yellow highlight like advanced UI */
}

.card-intro p {
    color: var(--text-muted);
    margin: 0.5rem 0 2.5rem;
}

/* 6. Form Elements */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.field-group.full-width {
    grid-column: 1 / -1;
}

.field-group label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #475569;
    padding-left: 4px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper i {
    position: absolute;
    left: 16px;
    color: var(--text-muted);
    font-size: 1.2rem;
    pointer-events: none;
}

.input-wrapper input,
.input-wrapper select,
textarea {
    width: 100%;
    padding: 14px 16px 14px 48px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-size: 1rem;
    background: rgba(0, 0, 0, 0.4);
    transition: all 0.2s ease;
    font-family: inherit;
    color: white;
}

textarea {
    padding: 16px;
    min-height: 180px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 1.05rem;
    line-height: 1.6;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.6);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
}

.hint-bar {
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(37, 99, 235, 0.1);
    border: 1px solid rgba(37, 99, 235, 0.2);
    border-radius: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* 7. Action Buttons */
.form-actions {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 24px;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 16px 36px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-link {
    background: none;
    border: none;
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s;
}

.btn-link:hover {
    color: var(--text-main);
    text-decoration: underline;
}

/* 8. Responsive Design */
@media (max-width: 1024px) {
    .sidebar {
        width: var(--sidebar-collapsed);
        padding: 1.5rem 0.5rem;
        align-items: center;
    }

    .brand-text,
    .nav-item span,
    .sidebar-footer span,
    .hint-bar span:last-child {
        display: none;
    }

    .nav-item {
        justify-content: center;
        width: 50px;
        height: 50px;
        padding: 0;
    }

    .main-content {
        margin-left: 0;
    }

    .top-header,
    .content-body {
        padding: 1.5rem;
    }
}

@media (max-width: 640px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .glass-card {
        padding: 1.5rem;
    }

    .form-actions {
        flex-direction: column;
        width: 100%;
    }

    .btn-primary {
        width: 100%;
        justify-content: center;
    }
}