/* Force Scrollable Layout */
html {
    /* controlled by JS for speed */
}

body {
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

/* Offset for Fixed Navbar */
section,
.lightbox-wrapper {
    scroll-margin-top: 80px !important;
}

/* TRANSFORM THE LIGHTBOXES INTO SECTIONS */
.lightbox-wrapper {
    display: block !important;
    position: relative !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    width: 100% !important;
    height: auto !important;
    background: #111 !important;
    /* Match body bg */
    z-index: 1 !important;
    padding-top: 0px;
    padding-bottom: 30px;
    /* Reduced from 80px */
    overflow: visible !important;
}

/* Tighten Section Spacing */
.single-section {
    padding-bottom: 30px !important;
    padding-top: 0px !important;
    /* Remove top padding if any */
}

/* FIX: Remove the huge 100px margin between internal sections on mobile/desktop */
.lightbox-wrapper .lightbox-content .single-section:not(:last-child) {
    margin-bottom: 30px !important;
}

/* Reduce gap after Headings */
.section-heading {
    margin-bottom: 30px !important;
    margin-top: 20px !important;
}

/* Specific overrides for containers */
.portfolio-section,
.contact-section,
.blog-section,
.resume-section,
.skills-section,
.services-section,
.info-section {
    padding-bottom: 10px !important;
}

/* FORCE REMOVE GAP BETWEEN BLOG AND CONTACT */
#blog.lightbox-wrapper,
section#blog {
    margin-bottom: 0px !important;
    padding-bottom: 0px !important;
}

#contact.lightbox-wrapper,
section#contact {
    margin-top: 0px !important;
    /* Removed negative margin to prevent overlap */
    padding-top: 0px !important;
}

#blog .lightbox-content {
    margin-bottom: 30px !important;
    /* Add space for shadow/hover effects */
    padding-bottom: 20px !important;
}

#contact .lightbox-content {
    margin-top: 0px !important;
    padding-top: 0px !important;
}

.lightbox-close {
    display: none !important;
}

/* Ensure content/container is visible */
.lightbox-content {
    height: auto !important;
    overflow: visible !important;
}

/* Ensure sections are stacked and visible */
section,
.single-section {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    position: relative !important;
    transform: none !important;
    height: auto !important;
    min-height: auto !important;
}

/* Keep Home Full Screen */
.home-area {
    height: 100vh !important;
    min-height: 100vh !important;
}

/* Navbar Styling */
.navbar {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: transparent;
    /* Initial Transparent */
    padding: 15px 0;
    transition: background 0.3s ease, padding 0.3s ease;
}

/* Scrolled state (added via JS) */
.navbar.scrolled {
    background: rgba(0, 0, 0, 0.6) !important;
    /* Glassy Dark */
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 10px 0;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.navbar-brand img {
    height: 70px !important;
    width: auto !important;
    object-fit: contain;
}

/* Active Menu Item Style */
.nav-item.active .nav-link {
    color: #2ecc71 !important;
    /* Main Theme Green or use var(--primary) */
    font-weight: 600;
}

/* MOBILE NAV STYLES */
@media (max-width: 991.98px) {

    /* Hamburger Position Fix & Layout */
    .navbar-menu {
        display: flex !important;
        flex-direction: column;
        justify-content: center;
        align-items: flex-end;
        width: 30px;
        height: 30px;
        cursor: pointer;
        background: transparent !important;
        margin-right: 15px !important;
    }

    /* Icon Lines */
    .btn-line {
        width: 20px;
        /* Middle line (Short) */
        height: 2px;
        background-color: #fff !important;
        position: relative;
        transition: all 0.3s ease;
        right: 0;
    }

    .btn-line::before,
    .btn-line::after {
        content: '';
        position: absolute;
        height: 2px;
        background-color: #fff;
        right: 0;
        transition: all 0.3s ease;
    }

    .btn-line::before {
        top: -8px;
        width: 30px;
    }

    /* Top */
    .btn-line::after {
        top: 8px;
        width: 30px;
    }

    /* Bottom */

    /* Consistent Floating Dropdown (Top & Sticky) */
    .navbar-collapse {
        position: absolute;
        top: 75%;
        left: auto;
        /* Don't stretch */
        right: 0;
        /* Align Right */
        width: 250px;
        /* Specific Width Box */

        /* Match theme dark */
        z-index: 1000;

        padding: 15px;
        text-align: left;
        /* Align text left inside box */
    }

    /* Align items inside the box */
    .navbar-nav {
        align-items: flex-start;
        /* Start align */
        padding-left: 20px;
    }

    .nav-item {
        margin: 5px 0;
    }
}

/* Scroll Down Mouse Animation */
.scroll-down {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.mouse {
    width: 30px;
    height: 50px;
    border: 2px solid white;
    border-radius: 20px;
    position: relative;
}

.wheel {
    width: 4px;
    height: 8px;
    background: white;
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
    animation: scroll 1.5s infinite;
}

@keyframes scroll {
    0% {
        top: 10px;
        opacity: 1;
    }

    100% {
        top: 30px;
        opacity: 0;
    }
}

/* Particles Container */
#particles-js {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 1;
    /* Behind content (z-index 2) */
}

/* Ensure Home Content is Clickable */
.home-content,
.home-name,
.home-headline,
.wrapper-text {
    position: relative;
    z-index: 2;
}

/* Custom Magnetic Cursor */
.cursor,
.cursor2 {
    position: fixed;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    left: -100px;
    top: 50%;
    z-index: 9999;
    display: none;
    /* Hidden by default, shown via JS on desktop */
}

@media (min-width: 992px) {

    .cursor,
    .cursor2 {
        display: block;
    }

    body {
        cursor: none;
        /* Hide default cursor only on desktop */
    }

    a,
    button,
    .btn,
    input,
    textarea {
        cursor: none;
    }
}

.cursor {
    background-color: #fff;
    height: 8px;
    width: 8px;
}

.cursor2 {
    border: 1px solid rgba(255, 255, 255, 0.5);
    height: 40px;
    width: 40px;
    transition: width 0.3s, height 0.3s, background-color 0.3s, border-color 0.3s, transform 0.1s linear;
    /* Linear transform for smooth following without lag */
}

.cursor2.hover {
    width: 60px;
    height: 60px;
    background-color: rgba(255, 255, 255, 0.1);
    border-color: transparent;
    backdrop-filter: blur(2px);
}

/* Scroll to Top Button */
.scroll-to-top-btn {
    position: fixed !important;
    bottom: 30px !important;
    right: 30px !important;
    z-index: 100000 !important;
    width: 50px !important;
    height: 50px !important;
    background: #2ecc71 !important;
    color: #fff !important;
    border-radius: 50% !important;
    text-align: center !important;
    line-height: 50px !important;
    font-size: 24px !important;
    cursor: pointer !important;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out !important;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3) !important;
    display: block;
}

.scroll-to-top-btn.show {
    opacity: 1 !important;
    visibility: visible !important;
    bottom: 30px !important;
}

.scroll-to-top-btn:hover {
    background: #27ae60 !important;
    transform: translateY(-5px);
    color: #fff !important;
}
/* Restore default cursor when Lity Modal is open */
.lity-wrap, .lity-container, .lity-content, .lity-opened {
    cursor: auto !important;
}
.lity-wrap a, .lity-wrap button, .lity-wrap .btn {
    cursor: pointer !important;
}

/* Fix Social Media Icons Z-Index Click Issue */
.home-area .fixed-wrapper {
    z-index: 100 !important;
}
.social-icons i.icon {
    position: relative;
    z-index: 101;
    cursor: pointer;
}

/* --- PERFECT EQUAL-HEIGHT & ALIGNED SERVICE CARDS --- */
.services-section .row {
    display: flex;
    flex-wrap: wrap;
}

.services-section .col-lg-4,
.services-section .col-md-6 {
    display: flex !important;
}

.services-section .single-service {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    border-radius: 8px;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease-in-out;
}

.services-section .single-service:hover {
    border-bottom: 2px solid #2ecc71 !important;
    transform: translateY(-5px);
}

.services-section .single-service .service-icon {
    font-size: 52px;
    margin-bottom: 20px;
    display: inline-block;
    color: #2ecc71;
}

.services-section .single-service .service-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 14px;
    color: #f3f3f3;
}

.services-section .single-service .service-description {
    font-size: 14px;
    line-height: 1.65;
    color: #9e9e9e;
    flex-grow: 1;
    margin-bottom: 0;
}


/* ==========================================================================
   PERFECT RESPONSIVE SIZING FOR PROJECT & BLOG MODAL POPUPS
   ========================================================================== */

/* Fix Scroll-To-Top Button Z-Index so it never covers open modals */
.scroll-to-top-btn {
    z-index: 999 !important;
}

/* Hide Scroll-to-Top Button when any modal is opened */
.lity, .lity-wrap, .lity-opened {
    z-index: 99999 !important;
}

body.lity-active .scroll-to-top-btn,
.lity-opened ~ .scroll-to-top-btn {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Lity Global Container Positioning */
.lity-wrap {
    z-index: 99999 !important;
    text-align: center !important;
    padding: 0 !important;
}

.lity-wrap:before {
    height: 100% !important;
    vertical-align: middle !important;
}

.lity-container {
    z-index: 100000 !important;
    text-align: left !important;
    vertical-align: middle !important;
    display: inline-block !important;
    max-width: 90% !important;
    max-height: 92vh !important;
    margin: 0 auto !important;
}

/* --- PROJECT MODAL STYLING & SIZING --- */
.lity-content .project-details-box {
    background-color: #1a1a1a !important;
    border: 1px solid #333 !important;
    color: #eee !important;
    padding: 35px 40px !important;
    max-width: 820px !important;
    width: 100% !important;
    max-height: 88vh !important;
    border-radius: 12px !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8) !important;
    overflow-y: auto !important;
    box-sizing: border-box !important;
}

.project-details-box .modal-title {
    font-size: 26px !important;
    font-weight: 700 !important;
    color: #fff !important;
    margin-bottom: 15px !important;
    line-height: 1.3 !important;
}

.project-details-box .modal-description {
    font-size: 15px !important;
    line-height: 1.7 !important;
    color: #d1d5db !important;
    margin-bottom: 20px !important;
}

.project-details-box .modal-subtitle {
    font-size: 17px !important;
    font-weight: 600 !important;
    color: #2ecc71 !important;
    margin-top: 25px !important;
    margin-bottom: 12px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

.project-details-box .modal-list {
    list-style: none !important;
    padding: 0 !important;
    margin-bottom: 20px !important;
}

.project-details-box .modal-list li {
    position: relative !important;
    padding: 10px 15px 10px 35px !important;
    margin-bottom: 8px !important;
    background: rgba(255, 255, 255, 0.03) !important;
    border-radius: 8px !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    color: #e5e7eb !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
}

.project-details-box .modal-list li:before {
    content: '›' !important;
    position: absolute !important;
    left: 15px !important;
    top: 8px !important;
    color: #2ecc71 !important;
    font-size: 20px !important;
    font-weight: bold !important;
    line-height: 1 !important;
}

.project-details-box .modal-tags {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    margin-bottom: 20px !important;
}

.project-details-box .modal-tags span {
    background: #111 !important;
    border: 1px solid #2ecc71 !important;
    color: #fff !important;
    font-size: 13px !important;
    padding: 6px 14px !important;
    border-radius: 6px !important;
    font-weight: 500 !important;
}

/* --- BLOG MODAL (LITY IFRAME) SIZING --- */
/* OVERRIDES THE DEFAULT 16:9 VIDEO RATIO (56.25% padding-top) ON BLOG MODAL */
.lity-iframe .lity-container {
    width: 90% !important;
    max-width: 860px !important;
    max-height: 90vh !important;
    margin: auto !important;
}

.lity-iframe-container {
    width: 100% !important;
    height: 88vh !important;
    max-height: 88vh !important;
    padding-top: 0 !important; /* CRITICAL FIX: Eliminates 16:9 squat box */
    border-radius: 12px !important;
    background: #121212 !important;
    overflow: hidden !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8) !important;
}

.lity-iframe-container iframe {
    width: 100% !important;
    height: 100% !important;
    background: #121212 !important;
    border: none !important;
    border-radius: 12px !important;
}

/* --- LITY CLOSE BUTTON --- */
.lity-close {
    top: 15px !important;
    right: 15px !important;
    width: 42px !important;
    height: 42px !important;
    font-size: 28px !important;
    line-height: 40px !important;
    background: rgba(0, 0, 0, 0.75) !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    border-radius: 50% !important;
    color: #fff !important;
    text-align: center !important;
    z-index: 100005 !important;
    transition: all 0.25s ease !important;
    cursor: pointer !important;
}

.lity-close:hover {
    background: #dc3545 !important;
    border-color: #dc3545 !important;
    transform: rotate(90deg) scale(1.05) !important;
    color: #fff !important;
}

/* --- RESPONSIVE VIEW FOR MOBILE & TABLETS (max-width: 768px) --- */
@media (max-width: 768px) {
    .lity-wrap:before {
        height: 96% !important;
    }

    .lity-container {
        width: 95% !important;
        max-width: 95% !important;
        margin: 10px auto !important;
        max-height: 88vh !important;
    }

    /* Project Modal Responsive on Mobile */
    .lity-content .project-details-box {
        padding: 22px 16px !important;
        max-height: 85vh !important;
        border-radius: 10px !important;
    }

    .project-details-box .modal-title {
        font-size: 19px !important;
        line-height: 1.35 !important;
        margin-bottom: 12px !important;
        padding-right: 25px !important;
    }

    .project-details-box .modal-description {
        font-size: 13.5px !important;
        line-height: 1.6 !important;
        margin-bottom: 15px !important;
    }

    .project-details-box .modal-subtitle {
        font-size: 14px !important;
        margin-top: 18px !important;
        margin-bottom: 10px !important;
    }

    .project-details-box .modal-list li {
        font-size: 12.5px !important;
        padding: 8px 12px 8px 28px !important;
        margin-bottom: 6px !important;
    }

    .project-details-box .modal-list li:before {
        left: 10px !important;
        top: 6px !important;
        font-size: 16px !important;
    }

    .project-details-box .modal-tags span {
        font-size: 11.5px !important;
        padding: 4px 10px !important;
    }

    /* Blog Modal Responsive on Mobile */
    .lity-iframe .lity-container {
        width: 95% !important;
        max-width: 95% !important;
        max-height: 88vh !important;
    }

    .lity-iframe-container {
        height: 86vh !important;
        max-height: 86vh !important;
        border-radius: 10px !important;
    }

    /* Mobile Close Button Placement */
    .lity-close {
        top: 10px !important;
        right: 10px !important;
        width: 36px !important;
        height: 36px !important;
        font-size: 22px !important;
        line-height: 34px !important;
    }
}
