/* ========== RESET & VARIABLES ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg:            #04040a;
    --menu-bg:       #0c0c18;
    --sidebar-bg:    #08080f;
    --border:        rgba(160, 80, 220, 0.28);
    --border-soft:   rgba(160, 80, 220, 0.13);
    --purple:        #a855f7;
    --purple-dim:    rgba(168, 85, 247, 0.65);
    --pink:          #d946a8;
    --gradient:      linear-gradient(135deg, #a855f7, #d946a8);
    --text:          #ede8f7;
    --muted:         #6b5d7e;
    --hover-bg:      rgba(168, 85, 247, 0.08);
    --active-bg:     rgba(168, 85, 247, 0.16);
    --item-bg:       rgba(255, 255, 255, 0.025);
    --glow:          0 0 8px rgba(168, 85, 247, 0.18), 0 0 80px rgba(168, 85, 247, 0.08);
    --radius:        8px;
}

body {
    background: var(--bg);
    min-height: 100vh;
    font-family: 'Inter', sans-serif;
    color: var(--text);
    overflow: hidden;
    user-select: none;
}

/* ========== BACKGROUND EFFECTS ========== */
.bg-grid {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(168, 85, 247, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(168, 85, 247, 0.04) 1px, transparent 1px);
    background-size: 44px 44px;
    pointer-events: none;
    z-index: 0;
}

.bg-orb-1 {
    position: fixed;
    width: 650px;
    height: 650px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.09) 0%, transparent 70%);
    top: -220px;
    right: -120px;
    pointer-events: none;
    z-index: 0;
    animation: drift 10s ease-in-out infinite;
}

.bg-orb-2 {
    position: fixed;
    width: 450px;
    height: 450px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(217, 70, 168, 0.07) 0%, transparent 70%);
    bottom: -120px;
    left: -80px;
    pointer-events: none;
    z-index: 0;
    animation: drift 13s ease-in-out infinite reverse;
}

@keyframes drift {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-25px); }
}

.bg-watermark {
    position: fixed;
    bottom: 18px;
    right: 18px;
    font-family: 'Fira Code', monospace;
    font-size: 0.68rem;
    color: rgba(168, 85, 247, 0.18);
    letter-spacing: 0.1em;
    z-index: 0;
}

/* ========== MOBILE HEADER ========== */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(12, 12, 24, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    z-index: 100;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.mh-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.menu-toggle {
    background: transparent;
    border: none;
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
}

/* ========== MENU WINDOW ========== */
.menu {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 760px;
    height: 510px;
    background: var(--menu-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--glow), 0 24px 64px rgba(0, 0, 0, 0.85);
    z-index: 10;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: height 0.22s ease;
}

.menu.collapsed {
    height: 42px;
}

/* ========== TITLE BAR ========== */
.titlebar {
    height: 42px;
    background: linear-gradient(90deg, #0a0616 0%, #130920 100%);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 10px;
    cursor: grab;
    flex-shrink: 0;
}

.titlebar:active {
    cursor: grabbing;
}

.title-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gradient);
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.9);
    flex-shrink: 0;
}

.title-name {
    font-family: 'Fira Code', monospace;
    font-size: 0.82rem;
    font-weight: 600;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.05em;
}

.title-version {
    font-family: 'Fira Code', monospace;
    font-size: 0.67rem;
    color: var(--muted);
    margin-right: auto;
}

.title-status {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.7rem;
    color: #4ade80;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 7px #4ade80;
    animation: blink 2.2s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.35; }
}

.win-btns {
    display: flex;
    gap: 5px;
    margin-left: 10px;
}

.win-btn {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    font-family: 'Fira Code', monospace;
}

.win-btn:hover {
    background: var(--hover-bg);
    color: var(--text);
    border-color: var(--purple-dim);
}

/* ========== MENU BODY ========== */
.menu-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ========== SIDEBAR ========== */
.sidebar {
    width: 175px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-soft);
    padding: 10px 0;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.sidebar-label {
    padding: 7px 14px 4px;
    font-family: 'Fira Code', monospace;
    font-size: 0.61rem;
    color: var(--muted);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.tab {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 14px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--muted);
    transition: all 0.15s;
    border-left: 2px solid transparent;
    margin: 1px 0;
}

.tab:hover {
    background: var(--hover-bg);
    color: var(--text);
}

.tab.active {
    background: var(--active-bg);
    color: var(--text);
    border-left-color: var(--purple);
}

.tab-icon {
    font-size: 0.88rem;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-spacer {
    flex: 1;
}

/* ========== CONTENT AREA ========== */
.content {
    flex: 1;
    overflow-y: auto;
    padding: 16px 18px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.content::-webkit-scrollbar       { width: 4px; }
.content::-webkit-scrollbar-track { background: transparent; }
.content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.panel {
    display: none;
}

.panel.active {
    display: block;
}

/* ========== PANEL HEADER ========== */
.panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-soft);
}

.panel-title {
    font-family: 'Fira Code', monospace;
    font-size: 0.77rem;
    font-weight: 600;
    color: var(--purple);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.panel-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--border-soft), transparent);
}

/* ========== PROFILE PANEL ========== */
.profile-top {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.avatar {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    object-fit: cover;
    object-position: top;
    flex-shrink: 0;
    box-shadow: 0 0 22px rgba(168, 85, 247, 0.45);
    border: 2px solid rgba(168, 85, 247, 0.4);
}

.profile-name {
    font-size: 1.1rem;
    font-weight: 700;
}

.profile-role {
    font-size: 0.78rem;
    color: var(--muted);
    margin-top: 3px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 6px;
    padding: 2px 9px;
    border-radius: 4px;
    font-family: 'Fira Code', monospace;
    font-size: 0.67rem;
    font-weight: 600;
}

.badge-green {
    background: rgba(74, 222, 128, 0.1);
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.22);
}

.info-rows {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 11px;
    background: var(--item-bg);
    border: 1px solid var(--border-soft);
    border-radius: 5px;
    font-size: 0.8rem;
    transition: border-color 0.15s;
}

.info-row:hover {
    border-color: var(--border);
}

.info-key {
    font-family: 'Fira Code', monospace;
    font-size: 0.72rem;
    color: var(--muted);
}

.info-val {
    font-weight: 500;
    color: var(--text);
    text-align: right;
}

.info-val.accent {
    color: var(--purple);
}

/* ========== SKILLS PANEL ========== */
.skill-group {
    font-family: 'Fira Code', monospace;
    font-size: 0.67rem;
    color: var(--muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin: 13px 0 6px;
}

.skill-group:first-child {
    margin-top: 0;
}

.skill-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 11px;
    background: var(--item-bg);
    border: 1px solid var(--border-soft);
    border-radius: 5px;
    margin-bottom: 5px;
    transition: all 0.15s;
}

.skill-item:hover {
    background: var(--hover-bg);
    border-color: var(--border);
}

.skill-name {
    font-family: 'Fira Code', monospace;
    font-size: 0.78rem;
    color: var(--text);
    flex: 1;
}

.skill-bar-container {
    width: 95px;
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    overflow: hidden;
    flex-shrink: 0;
}

.skill-fill {
    height: 100%;
    background: var(--gradient);
    border-radius: 2px;
}

.skill-num {
    font-family: 'Fira Code', monospace;
    font-size: 0.67rem;
    color: var(--purple);
    width: 26px;
    text-align: right;
    flex-shrink: 0;
}

/* ========== PROJECTS PANEL ========== */
.module {
    border: 1px solid var(--border-soft);
    border-radius: 5px;
    margin-bottom: 6px;
    overflow: hidden;
    transition: border-color 0.15s;
}

.module:hover {
    border-color: var(--border);
}

.module.open {
    border-color: var(--purple-dim);
}

.module-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    cursor: pointer;
    background: var(--item-bg);
    transition: background 0.15s;
}

.module-head:hover {
    background: var(--hover-bg);
}

.mod-toggle {
    width: 15px;
    height: 15px;
    border-radius: 3px;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.58rem;
    color: var(--purple);
    flex-shrink: 0;
    transition: all 0.15s;
}

.module.open .mod-toggle {
    background: var(--gradient);
    border-color: transparent;
    color: #fff;
}

.mod-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    flex: 1;
}

.mod-tag {
    font-family: 'Fira Code', monospace;
    font-size: 0.62rem;
    color: var(--purple);
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.22);
    padding: 1px 7px;
    border-radius: 3px;
    flex-shrink: 0;
}

.module-body {
    display: none;
    padding: 10px 12px;
    border-top: 1px solid var(--border-soft);
    background: rgba(0, 0, 0, 0.25);
}

.module.open .module-body {
    display: block;
}

.mod-desc {
    font-size: 0.78rem;
    color: var(--muted);
    line-height: 1.55;
    margin-bottom: 8px;
}

.mod-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.stack-chip {
    font-family: 'Fira Code', monospace;
    font-size: 0.63rem;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 2px 8px;
    border-radius: 3px;
}

/* ========== CONTACT PANEL ========== */
.contact-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 13px;
    background: var(--item-bg);
    border: 1px solid var(--border-soft);
    border-radius: 5px;
    margin-bottom: 7px;
    text-decoration: none;
    color: var(--text);
    transition: all 0.15s;
}

.contact-link:hover {
    background: var(--hover-bg);
    border-color: var(--purple);
    color: var(--purple);
}

.contact-ico {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.contact-lbl {
    font-size: 0.82rem;
    font-weight: 500;
    flex: 1;
}

.contact-val {
    font-family: 'Fira Code', monospace;
    font-size: 0.7rem;
    color: var(--muted);
    transition: color 0.15s;
}

.contact-link:hover .contact-val {
    color: var(--purple);
}

/* ========== STATUS BAR ========== */
.statusbar {
    height: 26px;
    background: var(--sidebar-bg);
    border-top: 1px solid var(--border-soft);
    display: flex;
    align-items: center;
    padding: 0 14px;
    gap: 14px;
    flex-shrink: 0;
}

.sb-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: 'Fira Code', monospace;
    font-size: 0.62rem;
    color: var(--muted);
}

.sb-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--purple);
}

.sb-sep {
    width: 1px;
    height: 11px;
    background: var(--border-soft);
}

.sb-right {
    margin-left: auto;
}

/* ========== MOBILE OVERLAY ========== */
.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 15;
    opacity: 0;
    transition: opacity 0.3s ease;
}


/* ========== RESPONSIVE DESIGN ========== */
@media (max-width: 800px) {
    /* Hide desktop specific elements */
    .titlebar, .statusbar, .bg-watermark {
        display: none;
    }

    /* Show mobile specific elements */
    .mobile-header {
        display: flex;
    }

    body {
        overflow-y: auto; /* Allow scrolling on mobile body */
    }

    /* Redesign Menu Container for Mobile */
    .menu {
        position: relative;
        top: auto;
        left: auto;
        transform: none !important; /* Override JS drag transform */
        width: 100%;
        max-width: 600px;
        height: auto;
        min-height: calc(100vh - 100px);
        margin: 80px auto 20px;
        border: none;
        border-radius: 0;
        box-shadow: none;
        background: transparent;
        overflow: visible;
    }

    .menu.collapsed {
        height: auto;
    }

    .menu-body {
        flex-direction: column;
        background: var(--menu-bg);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        overflow: hidden;
        box-shadow: var(--glow);
    }

    /* Transform Sidebar into Mobile Drawer */
    .sidebar {
        position: fixed;
        top: 60px;
        right: -250px;
        bottom: 0;
        width: 250px;
        background: var(--sidebar-bg);
        border-left: 1px solid var(--border);
        border-right: none;
        z-index: 20;
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        padding: 20px 0;
    }

    .sidebar.open {
        right: 0;
    }

    .sidebar-spacer {
        display: none; /* remove spacer in mobile to keep links together */
    }

    .sidebar-label {
        margin-top: 15px;
    }

    /* Make content fill area */
    .content {
        padding: 20px 15px;
        overflow-y: visible; /* Let body handle scrolling if needed */
    }

    /* Adjust specific elements for smaller screens */
    .info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .info-val {
        text-align: left;
    }

    .skill-item {
        flex-wrap: wrap;
    }

    .skill-bar-container {
        width: 100%;
        order: 3;
        margin-top: 5px;
    }

    .skill-name {
        flex: 1;
    }

    .skill-num {
        order: 2;
    }

    .contact-link {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .contact-val {
        margin-left: 32px; /* align with label text */
    }
}