/* ==========================================================================
   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 Workspaces (70% Width) --- */
.left-content {
    grid-column: span 8;
    grid-row: span 10;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

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

.tagline {
    font-family: var(--font-heading);
    color: var(--accent-blue);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
    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);
}

/* Image Visual Array Setup */
.img-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    height: 160px;
    width: 100%;
}

.img-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--card-border);
}

/* Portrait Flex Layout System Wrapper */
.project-main-flex {
    display: flex;
    gap: 1.5rem;
    align-items: stretch;
    flex-grow: 1;
    height: calc(100% - 90px);
}

.details-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

/* Vertical Mobile Video Viewport Box Layout */
.video-column {
    flex: 0 0 210px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.portrait-video-frame {
    width: 100%;
    height: 100%;
    max-height: 350px;
    aspect-ratio: 9 / 16;
    background: #000;
    border-radius: 20px;
    border: 3px solid #1c1f1e;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    position: relative;
}

.portrait-video-frame video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
}
.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.45;
    color: var(--text-muted);
}

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

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

/* Asymmetrical Profile Layout matching Homepage (image_7f276b.jpg) */
.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;
}

/* Responsive Scaling Overrides */
@media (max-width: 992px) {
    body { height: auto; overflow: auto; padding: 1rem; }
    .main-container { grid-template-columns: 1fr; height: auto; display: flex; flex-direction: column; }
    .profile-right-image-zone { display: none; }
    .profile-left-info { width: 100%; }
}


/* --- MOBILE RESPONSIVE FIXES FOR PROJECT PAGE --- */

@media (max-width: 992px) {
    /* 1. Body ko scrollable banayein */
    body {
        height: auto !important;
        overflow-y: auto !important;
        display: block !important;
        padding: 1rem !important;
    }

    /* 2. Main container ko vertical flex mein badlein */
    .main-container {
        height: auto !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 1rem !important;
    }

    /* 3. Left Content (Project Details) fix */
    .left-content {
        grid-column: span 1 !important; /* Grid property override */
        width: 100% !important;
        gap: 1rem !important;
    }

    .project-main-flex {
        flex-direction: column !important; 
        height: auto !important;
        gap: 1rem !important;
    }

    /* 4. Video column ko full width dein */
    .video-column {
        flex: 0 0 auto !important;
        width: 100% !important;
        order: -1; /* Video ko sabse upar laane ke liye */
    }

    .portrait-video-frame {
        max-height: 400px !important;
        aspect-ratio: auto !important;
    }

    /* 5. Right Sidebar (Identity & Skills) fix */
    .identity-sidebar, .skills-sidebar {
        grid-column: span 1 !important;
        width: 100% !important;
        min-height: auto !important;
    }

    /* 6. Text readability */
    .project-title-box h1 { font-size: 1.5rem !important; }
    .info-text { font-size: 0.9rem !important; line-height: 1.6 !important; }
    
    /* 7. Hide image decoration to save space */
    .profile-right-image-zone { display: none !important; }
}

/* --- TEXT WRAPPING FIX (Kahin bhi text bahar na nikle) --- */
.card, .left-content, .details-column {
    min-width: 0 !important;
    max-width: 100% !important;
}

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

/* --- FIXED MOBILE RESPONSIVE LAYOUT FOR PROJECT PAGE --- */

@media (max-width: 992px) {
    /* 1. Body ko 100vh se hata kar auto height par lana taake scroll ho sake */
    body {
        height: auto !important;
        overflow-y: auto !important;
        display: block !important;
        padding: 15px !important;
    }

    /* 2. Main container ko flex-column karna taake sab kuch ek line mein aaye */
    .main-container {
        height: auto !important;
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        gap: 20px !important;
    }

    /* 3. Grid aur Flex structure ko override karna */
    .project-main-flex {
        flex-direction: column !important;
        height: auto !important;
        gap: 20px !important;
    }

    /* 4. Left aur Right column ko full width dena */
    .left-content, .identity-sidebar, .skills-sidebar {
        width: 100% !important;
        height: auto !important;
        grid-column: span 1 !important;
    }

    /* 5. Video player ka size fix karna */
    .video-column {
        width: 100% !important;
        height: auto !important;
        order: -1; /* Video ko sabse upar laane ke liye */
    }

    .portrait-video-frame {
        width: 100% !important;
        height: 250px !important;
        object-fit: cover !important;
    }

    /* 6. Text ki readability badhana */
    .project-title-box h1 { font-size: 1.5rem !important; }
    .info-text { font-size: 0.95rem !important; line-height: 1.6 !important; }

    /* 7. Faltu elements jo mobile par jagah gher rahe hain */
    .profile-right-image-zone { display: none !important; }
}



.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);
}