/* GLOBAL RESET */
:root {
    --bg-black: #050505;
    --bg-card: #111111;
    --sidebar-bg: #0a0a0a;
    --border: #222222;
    --text-white: #ffffff;
    --text-muted: #888888;
    --accent: #ffffff;
    --danger: #ff4d4d;
    --sidebar-width: 260px; /* Constant width variable */
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    background-color: var(--bg-black);
    color: var(--text-white);
    font-family: 'Inter', -apple-system, sans-serif;
    overflow-x: hidden;
}

/* 
   FIX: Sidebar Container Reservation 
   Ye line content ko stretch hone se rokegi
*/
#sidebar-container {
    width: var(--sidebar-width);
    min-height: 100vh;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    flex-shrink: 0; /* Isse sidebar pichakne se ruk jayega */
    display: block;
}

/* LAYOUT STRUCTURE */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* SIDEBAR STYLING */
.sidebar {
    width: 100%; /* Parent container ka width lega */
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    animation: fadeInSidebar 0.4s ease-out;
}

@keyframes fadeInSidebar {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

.sidebar-brand {
    padding: 30px;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--text-white);
    border-bottom: 1px solid var(--border);
    text-transform: uppercase;
}

.sidebar-nav {
    flex-grow: 1;
    padding: 20px 10px;
}

.nav-link {
    display: block;
    padding: 12px 20px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    border-radius: 6px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.nav-link:hover, .nav-link.active {
    background-color: var(--bg-card);
    color: var(--text-white);
    transform: translateX(5px);
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border);
}

/* MAIN CONTENT AREA */
.main-content-area {
    flex: 1;
    padding: 60px;
    max-width: calc(100vw - var(--sidebar-width));
    animation: fadeInContent 0.5s ease-out;
}

@keyframes fadeInContent {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* CARDS & GRIDS */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 30px;
    transition: border-color 0.3s ease;
}

.card:hover {
    border-color: #333;
}

.card h3 {
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 600;
}

/* COMPONENTS */
.platform-logo {
    position: fixed;
    top: 30px;
    right: 40px;
    width: 100px;
    z-index: 1000;
    pointer-events: none; /* Logo clicks ko rokne ke liye */
}

.btn {
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border);
    font-size: 14px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
}

.btn-primary { background: var(--accent); color: #000; border-color: var(--accent); }
.btn-outline { background: transparent; color: var(--text-white); }
.btn-primary:hover { opacity: 0.8; transform: translateY(-1px); }
.btn-outline:hover { background: #1a1a1a; border-color: #444; }

.logout-btn {
    width: 100%;
    padding: 12px;
    background: #1a0505;
    color: var(--danger);
    border: 1px solid #331111;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.2s;
}

.logout-btn:hover { background: #2a0a0a; border-color: #551111; }

input, select {
    width: 100%;
    padding: 14px;
    background: #000;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: white;
    margin: 10px 0;
    outline: none;
    transition: border-color 0.2s;
}

input:focus { border-color: #555; }

/* SSUID BOX */
.ssuid-display-box {
    background: #000;
    border: 1px solid var(--border);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    font-family: 'Roboto Mono', monospace;
    font-size: 24px;
    letter-spacing: 2px;
    margin: 15px 0;
    transition: background 0.3s;
}

/* MOBILE VIEW */
@media (max-width: 900px) {
    .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    #sidebar-container {
        width: 100%;
        height: 65px;
        position: fixed;
        bottom: 0;
        top: auto;
        border-right: none;
        border-top: 1px solid var(--border);
        z-index: 1000;
    }

    .sidebar {
        height: 65px;
        flex-direction: row;
        animation: none;
    }

    .sidebar-brand, .sidebar-footer { display: none; }

    .sidebar-nav {
        display: flex;
        overflow-x: auto;
        padding: 5px;
        width: 100%;
        justify-content: space-around;
        align-items: center;
    }

    .nav-link {
        padding: 8px 12px;
        font-size: 11px;
        white-space: nowrap;
        margin-bottom: 0;
        text-align: center;
    }

    .nav-link:hover, .nav-link.active {
        transform: none;
        background: transparent;
        color: #fff;
        border-bottom: 2px solid #fff;
        border-radius: 0;
    }

    .main-content-area {
        padding: 30px 20px 100px 20px;
        max-width: 100vw;
    }

    .platform-logo {
        width: 80px;
        top: 15px;
        right: 15px;
    }
}