/* ============================================
   DESIGN SYSTEM & COLOR PALETTE
   ============================================ */

:root {
    /* Color Palette - Deep Space Theme */
    --bg-dark: #0f172a;
    --bg-darker: #020617;
    --accent-primary: #38bdf8;
    --accent-secondary: #818cf8;
    --accent-glow: rgba(56, 189, 248, 0.4);

    /* Text Colors */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;

    /* UI Elements */
    --line-color: rgba(148, 163, 184, 0.3);
    --border-color: rgba(255, 255, 255, 0.1);
    --glass-bg: rgba(15, 23, 42, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);

    /* Typography */
    --font-main: 'Outfit', sans-serif;
}

/* ============================================
   GLOBAL STYLES
   ============================================ */

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

body {
    font-family: var(--font-main);
    background: radial-gradient(circle at 50% -20%, #1e293b 0%, var(--bg-darker) 100%);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

/* Background canvas for particle animation */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ============================================
   LAYOUT & STRUCTURE
   ============================================ */

.tree-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 1400px;
    padding: 2rem;
    position: relative;
}

/* Icon styling */
.diamond-icon-wrapper {
    margin-bottom: 0;
    z-index: 10;
}

.diamond-icon {
    width: 90px;
    height: 90px;
    border: 4px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
}

.diamond-icon svg {
    width: 40px;
    height: 40px;
    color: var(--text-color);
}

/* Connecting Lines */
.vertical-line-1 {
    width: 4px;
    height: 70px;
    /* More spacing */
    background-color: var(--line-color);
}

.horizontal-line-1 {
    width: 70%;
    /* Wider lines */
    height: 3px;
    background-color: var(--line-color);
    margin-bottom: 3rem;
}

.main-content {
    text-align: center;
    margin-bottom: 3rem;
    z-index: 10;
}

.main-title {
    font-size: 4rem;
    /* Significantly larger */
    font-weight: 800;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    text-shadow: 0 0 30px rgba(56, 189, 248, 0.2);
}

.sub-tags {
    font-size: 1.1rem;
    /* Larger sub-text */
    letter-spacing: 0.2em;
    text-transform: uppercase;
    line-height: 2;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 500;
}

.horizontal-line-2 {
    width: 70%;
    height: 3px;
    background-color: var(--line-color);
}

.vertical-line-2 {
    width: 4px;
    height: 70px;
    background-color: var(--line-color);
    margin-bottom: 0;
}

/* Navigation Grid */
.nav-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    /* Back to 4 columns for size */
    width: 100%;
    border-top: 4px solid var(--border-color);
}

.footer-container {
    margin-top: 2rem;
    text-align: center;
    width: 100%;
    border-top: 3px solid var(--border-color);
    padding-top: 1rem;
    opacity: 0;
    animation: fadeInUp 0.5s ease 2.5s forwards;
    /* Delay to appear after everything else */
}

.footer-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    letter-spacing: 0.1em;
    font-weight: 400;
}

.nav-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
    /* Generous padding */
    text-decoration: none;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 1.1rem;
    /* MUCH Larger font content */
    line-height: 1.2;
    text-align: center;
    letter-spacing: 0.15em;
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
    border-right: 2px solid var(--border-color);
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0);
    backdrop-filter: blur(0px);
    position: relative;
    overflow: hidden;
}

/* Correct Border Logic for 4-column grid */
.nav-item:nth-child(4n) {
    border-right: 2px solid var(--border-color);
    /* Keep right border for symmetry or remove? Usually remove for edge. Let's keep grid style or remove rightmost. */
    /* Actually, user wanted thicker borders. Standard grid usually has borders between. */
    /* Let's try to enclose them properly. */
}

/* Ensure the first item of every row has a left border */
.nav-item:nth-child(4n+1) {
    border-left: 2px solid var(--border-color);
}


.nav-item:hover {
    color: var(--accent-primary);
    background: rgba(255, 255, 255, 0.05);
    text-shadow: 0 0 15px var(--accent-glow);
    box-shadow: inset 0 0 30px rgba(56, 189, 248, 0.1);
}

.nav-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    /* Thicker hover line */
    background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.nav-item:hover::after {
    transform: translateX(100%);
}



/* Responsiveness */
@media (max-width: 1000px) {
    .main-title {
        font-size: 2.5rem;
        letter-spacing: 0.15em;
    }

    .tree-container {
        padding: 1rem;
    }

    .horizontal-line-1,
    .horizontal-line-2 {
        width: 90%;
    }

    .nav-grid {
        grid-template-columns: repeat(2, 1fr);
        /* 2 columns on tablet */
    }

    .nav-item {
        font-size: 1rem;
        padding: 1rem;
    }

    /* Reset borders for 2 columns */
    .nav-item {
        border-left: none;
    }

    .nav-item:nth-child(2n+1) {
        border-left: 2px solid var(--border-color);
    }
}

@media (max-width: 600px) {
    .nav-grid {
        grid-template-columns: 1fr;
        /* Stack on mobile */
    }

    .nav-item {
        border-left: 2px solid var(--border-color) !important;
        border-right: 2px solid var(--border-color) !important;
    }


    .sub-tags {
        font-size: 0.85rem;
    }
}

/* ============================================
   MODAL DIALOG STYLES
   ============================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background: #1f2937;
    /* Match theme or slightly lighter */
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    width: 90%;
    max-width: 600px;
    padding: 2.5rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-height: 80vh;
    overflow-y: auto;
}

.modal-overlay.active .modal-container {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: #ef4444;
    /* Red hover for close */
}

/* Modal Content Typography */
.modal-body h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #ffffff;
    border-bottom: 1px solid var(--line-color);
    padding-bottom: 0.5rem;
    font-weight: 700;
}

.modal-body h3 {
    font-size: 1.5rem;
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
    color: rgba(255, 255, 255, 0.9);
}

.modal-body p {
    line-height: 1.6;
    margin-bottom: 1rem;
    color: rgba(255, 255, 255, 0.8);
}

.modal-body ul {
    list-style-type: none;
    padding: 0;
}

.modal-body li {
    margin-bottom: 0.5rem;
    padding-left: 1.2rem;
    position: relative;
    color: rgba(255, 255, 255, 0.8);
}

.modal-body li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--line-color);
}

/* Filter Container */
.filter-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.filter-section {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.filter-label {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-primary);
    min-width: 80px;
}

.filter-btn {
    padding: 0.5rem 1.25rem;
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
    font-family: var(--font-primary);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.filter-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: rgba(100, 255, 218, 0.05);
}

.filter-btn.active {
    border-color: var(--accent-primary);
    background: var(--accent-primary);
    color: var(--bg-primary);
}

/* Hidden class for filtering */
.hidden {
    display: none !important;
}


/* Project card styles */
.project-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    transition: transform 0.2s ease;
}

.project-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.08);
}

.project-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #fff;
}

.project-desc {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.project-tech {
    font-size: 0.8rem;
    opacity: 0.7;
    font-family: monospace;
}

/* Modal scrollbar styling */
.modal-container::-webkit-scrollbar {
    width: 8px;
}

.modal-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.modal-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.modal-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ============================================
   CONTENT TYPOGRAPHY & FORMATTING
   ============================================ */

/* Highlights */
.highlight-text {
    font-size: 1.2rem;
    font-weight: 300;
    color: var(--accent-primary);
    letter-spacing: 0.05em;
    margin-bottom: 1.5rem !important;
    border-left: 3px solid var(--accent-secondary);
    padding-left: 1rem;
}

/* ============================================
   TIMELINE STYLES (Experience Section)
   ============================================ */

.timeline {
    position: relative;
    padding-left: 2rem;
    border-left: 2px solid var(--border-color);
    margin-top: 2rem;
}

.timeline-item {
    position: relative;
    margin-bottom: 2.5rem;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

/* Timeline dot indicator */
.timeline-item::before {
    content: '';
    position: absolute;
    left: -2.6rem;
    top: 0.5rem;
    width: 1rem;
    height: 1rem;
    background: var(--bg-dark);
    border: 2px solid var(--accent-primary);
    border-radius: 50%;
    z-index: 1;
}

.timeline-date {
    font-size: 0.85rem;
    color: var(--accent-secondary);
    font-weight: 600;
    margin-bottom: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.timeline-content h3 {
    margin-top: 0 !important;
    font-size: 1.3rem !important;
    color: #fff !important;
}

.company {
    display: block;
    margin-bottom: 0.5rem;
    font-style: italic;
    color: var(--text-secondary);
}

/* Grid Layout */
.grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.card-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.card-item:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--accent-primary);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

.card-item h3 {
    font-size: 1.2rem !important;
    margin-top: 0.5rem !important;
    border: none !important;
    padding: 0 !important;
}

.tag {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background: rgba(56, 189, 248, 0.1);
    color: var(--accent-primary);
    font-size: 0.7rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 1rem;
}

/* Styled List */
.styled-list li {
    background: rgba(255, 255, 255, 0.03);
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem !important;
    padding-left: 1rem !important;
    border-left: 3px solid var(--accent-secondary);
}

.styled-list li::before {
    display: none;
}

.styled-list strong {
    color: #fff;
    display: block;
    margin-bottom: 0.3rem;
    font-size: 1.1rem;
}

/* Contact Buttons */
.contact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
}

.contact-btn {
    padding: 0.8rem 1.5rem;
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
    text-decoration: none;
    border-radius: 30px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
}

.contact-btn:hover {
    background: var(--accent-primary);
    color: var(--bg-dark);
    box-shadow: 0 0 15px var(--accent-glow);
}

.btn-primary {
    display: inline-block;
    padding: 0.8rem 2rem;
    background: var(--accent-primary);
    color: var(--bg-dark);
    text-decoration: none;
    font-weight: 700;
    border-radius: 30px;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: #fff;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

/* ============================================
   ANIMATIONS & TRANSITIONS
   ============================================ */

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

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

.animate-in {
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}

/* ============================================
   ENHANCED PROJECT CARD STYLES
   ============================================ */

.project-header {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.5rem;
}

.project-tenure {
    font-size: 0.75rem;
    color: var(--accent-secondary);
    font-family: monospace;
    opacity: 0.8;
}

.project-meta {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.project-company,
.project-client,
.project-role {
    color: var(--text-secondary);
}

.project-meta .label {
    color: var(--accent-primary);
    font-weight: 600;
    margin-right: 0.3rem;
    font-size: 0.75rem;
    text-transform: uppercase;
}

/* Update title to fit header */
.project-title {
    margin-bottom: 0 !important;
    font-size: 1.1rem !important;
}

/* =========================================
   CINEMATIC LOADING ANIMATIONS (TRANSITION BASED)
   ========================================= */

/* BACKGROUND FADE OVERLAY */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: #000000;
    z-index: 9999;
    /* On top of everything */
    opacity: 0;
    pointer-events: none;
    transition: opacity 2.5s ease-in-out;
}

body.is-preload::before {
    opacity: 1;
    /* Full black overlay when preloading */
}

/* INITIAL HIDDEN STATES (is-preload) */
body.is-preload .diamond-icon-wrapper,
body.is-preload .vertical-line-1,
body.is-preload .horizontal-line-1,
body.is-preload #profile-name,
body.is-preload #profile-title,
body.is-preload .horizontal-line-2,
body.is-preload .vertical-line-2,
body.is-preload .nav-item {
    opacity: 0;
}

body.is-preload .diamond-icon-wrapper {
    transform: scale(0.5);
}

body.is-preload .vertical-line-1,
body.is-preload .vertical-line-2 {
    height: 0;
}

body.is-preload .horizontal-line-1,
body.is-preload .horizontal-line-2 {
    width: 0;
}

body.is-preload #profile-name,
body.is-preload #profile-title,
body.is-preload .nav-item {
    transform: translateY(20px);
    filter: blur(5px);
}

/* TRANSITIONS (When is-preload is removed) */

/* 1. Icon */
.diamond-icon-wrapper {
    transform: scale(1);
    opacity: 1;
    transition: transform 0.75s ease, opacity 0.75s ease;
    transition-delay: 0s;
}

/* 2. Vertical Line 1 */
.vertical-line-1 {
    height: 60px;
    opacity: 1;
    transition: height 0.75s ease, opacity 0.325s ease-in-out;
    transition-delay: 0.2s;
}

/* 3. Horizontal Line 1 */
.horizontal-line-1 {
    width: 60%;
    opacity: 1;
    transition: width 0.75s ease, opacity 0.325s ease-in-out;
    transition-delay: 0.5s;
}

/* 4. Name */
#profile-name {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
    transition: opacity 0.325s ease-in-out, transform 0.325s ease-in-out, filter 0.325s ease-in-out;
    transition-delay: 0.75s;
}

/* 5. Title */
#profile-title {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
    transition: opacity 0.325s ease-in-out, transform 0.325s ease-in-out, filter 0.325s ease-in-out;
    transition-delay: 0.9s;
}

/* 6. Horizontal Line 2 */
.horizontal-line-2 {
    width: 60%;
    opacity: 1;
    transition: width 0.75s ease, opacity 0.325s ease-in-out;
    transition-delay: 1.1s;
}

/* 7. Vertical Line 2 */
.vertical-line-2 {
    height: 60px;
    opacity: 1;
    transition: height 0.75s ease, opacity 0.325s ease-in-out;
    transition-delay: 1.4s;
}

/* 8. Nav Items */
.nav-item {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
    transition: opacity 0.325s ease-in-out, transform 0.325s ease-in-out, filter 0.325s ease-in-out;
}

/* Stagger Nav Items via nth-child selectors for pure CSS control */
.nav-item:nth-child(1) {
    transition-delay: 1.6s;
}

.nav-item:nth-child(2) {
    transition-delay: 1.7s;
}

.nav-item:nth-child(3) {
    transition-delay: 1.8s;
}

.nav-item:nth-child(4) {
    transition-delay: 1.9s;
}

.nav-item:nth-child(5) {
    transition-delay: 2.0s;
}

.nav-item:nth-child(6) {
    transition-delay: 2.1s;
}

.nav-item:nth-child(7) {
    transition-delay: 2.2s;
}

/* Ensure desc has space */
.project-desc {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.5;
}

/* Skills Styles */
.project-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.skill-tag {
    font-size: 0.7rem;
    background: rgba(56, 189, 248, 0.1);
    color: var(--accent-primary);
    padding: 0.2rem 0.6rem;
    border-radius: 99px;
    border: 1px solid rgba(56, 189, 248, 0.2);
    font-weight: 500;
}

/* ============================================
   PROJECTS SECTION STYLES
   ============================================ */

/* Projects filter controls */
.projects-filters {
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-group select,
.filter-group input {
    padding: 0.75rem 1rem;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.95rem;
    transition: all 0.3s ease;
    min-width: 200px;
}

.filter-group select:hover,
.filter-group input:hover {
    border-color: var(--accent-primary);
    background: rgba(15, 23, 42, 0.95);
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.1);
}

.reset-filters-btn {
    padding: 0.75rem 1.5rem;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-family: var(--font-main);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.reset-filters-btn:hover {
    background: rgba(56, 189, 248, 0.2);
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.3);
}

.filter-results-info {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 1rem;
    text-align: center;
}

.no-results {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.no-results p {
    font-size: 1.1rem;
}