/* ==========================================================================
   GLOBAL RESET & VARIABLE SETUP (Matched with Home Page Theme)
   ========================================================================== */
:root {
    --bg-dark: #020403;              
    --card-bg: #111413;              
    --card-border: rgba(255, 255, 255, 0.05);
    --text-primary: #f0f6fc;
    --text-muted: #8b949e;
    --accent-purple: #8957e5;
    --accent-blue: #58a6ff;
    --accent-green: #3fb950;
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-body);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    padding: 1.5rem;
}

.main-container {
    width: 100%;
    max-width: 1200px;
    height: 90vh;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: repeat(10, 1fr);
    gap: 1.25rem;
}

/* Common Card Base Layout */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.25rem;
    overflow: hidden;
    position: relative;
    transition: border-color 0.2s ease;
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

/* --- LEFT SIDE: Main Project Workspace --- */
.left-content {
    grid-column: span 8;
    grid-row: span 10;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0 !important;
}

/* Sticky Navbar Inside Left Card */
.left-card-navbar {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--card-border);
    background: var(--card-bg);
    z-index: 10;
}

.left-card-navbar .nav-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.left-card-navbar .nav-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.project-title-box {
    flex: 0 0 auto;
}

.project-title-box h1 {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.tagline {
    font-family: var(--font-heading);
    color: var(--accent-blue);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.15rem;
    display: block;
}

/* Back Link Action Button */
.back-btn {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s ease, transform 0.2s ease;
}

.back-btn:hover {
    color: var(--accent-purple);
    transform: translateX(-3px);
}

/* Scrollable Content Area Inside Left Card */
.left-scroll-area {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

/* Custom Scrollbar for Left Card */
.left-scroll-area::-webkit-scrollbar {
    width: 5px;
}

.left-scroll-area::-webkit-scrollbar-track {
    background: transparent;
}

.left-scroll-area::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}

.left-scroll-area::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

.section-title {
    color: var(--accent-blue);
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.info-text {
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-muted);
}

.highlight {
    color: var(--text-primary);
    font-weight: 600;
}

/* ==========================================================================
   4-UP SCREENSHOT ROW (this project's image grid)
   ========================================================================== */
.image-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.shot-card {
    background: #0a0c0b;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.shot-label {
    background: var(--accent-purple);
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-align: center;
    padding: 7px 4px;
}

.shot-thumb {
    aspect-ratio: 4/3;
    width: 100%;
    object-fit: cover;
    display: block;
}

.shot-placeholder {
    aspect-ratio: 4/3;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(137, 87, 229, 0.08);
    color: var(--accent-purple);
    font-size: 1.6rem;
}

/* ==========================================================================
   DEMO / REPO BUTTONS
   ========================================================================== */
.demo-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.85rem;
    border-radius: 9px;
    padding: 11px 20px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: transform 0.15s ease, opacity 0.15s ease, border-color 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }

.btn-primary {
    background: var(--accent-purple);
    color: var(--text-primary);
}
.btn-primary:hover { background: #9869f0; }

.btn-outline {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    border-color: var(--card-border);
}
.btn-outline:hover { border-color: rgba(137, 87, 229, 0.4); color: var(--accent-purple); }

/* Small nav buttons for demo/repo in navbar */
.btn-sm {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.72rem;
    border-radius: 8px;
    padding: 7px 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
    white-space: nowrap;
}

.btn-sm:hover { transform: translateY(-1px); }

.btn-sm-primary {
    background: var(--accent-purple);
    color: var(--text-primary);
}
.btn-sm-primary:hover { background: #9869f0; }

.btn-sm-outline {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    border-color: var(--card-border);
}
.btn-sm-outline:hover { border-color: rgba(137, 87, 229, 0.4); color: var(--accent-purple); }

/* --- RIGHT SIDE: Sidebar Widgets --- */
/* Top Profile Widget (Approx 70% Sidebar Height) */
.identity-sidebar {
    grid-column: span 4;
    grid-row: span 7;
}

/* Asymmetrical Profile Layout matching Homepage */
.standard-profile-layout {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between;
    align-items: stretch;
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    padding-right: 0 !important;
}

.profile-left-info {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    width: 60%;
    padding: 0.2rem 0;
    z-index: 2;
}

.profile-top-meta {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.profile-single-line-name {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.sub-heading-text {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.sub-heading-text i {
    width: 14px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Horizontal Social Box Icons */
.identity-footer-row {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
}

.social-box {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.social-box:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Profile Photo Flush Right Zone */
.profile-right-image-zone {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 45%;
    height: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    pointer-events: none;
    z-index: 1;
}

.profile-split-image-large {
    height: 100%;
    width: auto;
    object-fit: contain;
    display: block;
    margin-right: -80px;
    -webkit-mask-image: linear-gradient(to top, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 12%);
    mask-image: linear-gradient(to top, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 12%);
}

/* Bottom Skills Card Widget (Approx 30% Sidebar Height) */
.skills-sidebar {
    grid-column: span 4;
    grid-row: span 3;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.skills-sidebar .section-tag {
    color: var(--accent-purple);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    display: block;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.skill-tag {
    background: rgba(137, 87, 229, 0.1);
    color: var(--accent-purple);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    border: 1px solid rgba(137, 87, 229, 0.2);
    font-weight: 500;
}

/* --- CHATBOT FLOATING ICON OVERLAY --- */
.chatbot-launcher {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 50px;
    height: 50px;
    background: var(--accent-purple);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    font-size: 1.35rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(137, 87, 229, 0.4);
    transition: all 0.2s ease;
    z-index: 999;
}

.chatbot-launcher:hover {
    transform: scale(1.1) rotate(5deg);
    background: #9869f0;
}

/* ==========================================================================
   VIDEO DEMO MODAL
   ========================================================================== */
.video-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(2, 4, 3, 0.85);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.video-modal-overlay.open { display: flex; }

.video-modal-box {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 16px;
    max-width: 900px;
    width: 100%;
    position: relative;
}

.video-modal-box video {
    width: 100%;
    border-radius: 10px;
    display: block;
    background: #000;
}

.video-modal-close {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--accent-purple);
    color: var(--text-primary);
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

/* ==========================================================================
   PROJECT MORE LINK
   ========================================================================== */
.project-more-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 6px 16px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
    background: rgba(221, 219, 208, 0.04);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    text-decoration: none;
    transition: color 0.25s ease, background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.project-more-link::after {
    font-size: 0.85rem;
    line-height: 1;
    transition: transform 0.25s ease;
}

.project-more-link:hover {
    color: #fff;
    background: rgba(137, 87, 229, 0.15);
    border-color: rgba(137, 87, 229, 0.4);
    transform: translateY(-2px);
}

.project-more-link:hover::after {
    transform: translateX(4px);
}

/* --- TEXT WRAPPING FIX --- */
.card, .left-content, .details-column, .left-scroll-area {
    min-width: 0 !important;
    max-width: 100% !important;
}

.info-text, p, h1, h3 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 992px) {
    body {
        height: auto !important;
        overflow-y: auto !important;
        display: block !important;
        padding: 15px !important;
    }

    .main-container {
        height: auto !important;
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        gap: 20px !important;
    }

    .left-content {
        overflow: visible !important;
        padding: 1.25rem !important;
    }

    .left-card-navbar {
        border-bottom: 1px solid var(--card-border);
        margin-bottom: 1rem;
        padding-bottom: 1rem;
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .left-card-navbar .nav-left,
    .left-card-navbar .nav-right {
        width: 100%;
    }

    .left-card-navbar .nav-right {
        justify-content: flex-start;
    }

    .left-scroll-area {
        overflow: visible !important;
        padding: 0 !important;
    }

    .left-content, .identity-sidebar, .skills-sidebar {
        width: 100% !important;
        grid-column: span 1 !important;
        grid-row: span 1 !important;
    }

    .identity-sidebar { min-height: auto; }

    .image-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .project-title-box h1 { font-size: 1.4rem !important; }
    .info-text { font-size: 0.95rem !important; line-height: 1.6 !important; }

    .profile-right-image-zone { display: none !important; }
}