/* Modern Premium Variables */
:root {
    --bg-color: #050A14;
    /* Deep Navy Black */
    --card-bg: #0F172A;
    /* Darker Blue/Slate */
    --card-hover-bg: #1E293B;
    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;

    --accent-primary: #00F0FF;
    /* Electric Blue */
    --accent-secondary: #4361EE;
    /* Royal Blue */
    --accent-gold: #FFD700;
    /* Gold */

    --gradient-main: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    --gradient-gold: linear-gradient(135deg, #FFD700, #FDB931);

    --font-size-base: 1rem;
    --font-size-lg: 1.25rem;
    --font-size-xl: 1.5rem;
    --font-size-2xl: 2rem;
    --font-size-3xl: 3rem;
    --font-size-4xl: 4rem;
    --font-size-hero: 4.5rem;

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    --transition-speed: 0.3s;
    --border-radius: 16px;
    --container-width: 1200px;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    /* Base size */
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    font-size: var(--font-size-base);
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-speed);
}

img {
    max-width: 100%;
    display: block;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Typography Standardization */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: white;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 {
    font-size: var(--font-size-4xl);
    font-weight: 800;
}

h2 {
    font-size: var(--font-size-3xl);
    font-weight: 700;
}

h3 {
    font-size: var(--font-size-2xl);
    font-weight: 600;
}

h4 {
    font-size: var(--font-size-xl);
    font-weight: 600;
}

p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

/* Global Section Title */
.section-title {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    margin-bottom: 3rem;
    text-align: center;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
    color: white;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--gradient-gold);
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.gradient-text {
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Buttons */
.btn-primary {
    background: var(--gradient-main);
    color: #000;
    padding: 14px 35px;
    border-radius: 50px;
    font-weight: 700;
    display: inline-block;
    border: none;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.6);
}

.btn-secondary {
    background: transparent;
    color: var(--accent-gold);
    padding: 12px 33px;
    border-radius: 50px;
    font-weight: 700;
    border: 2px solid var(--accent-gold);
    display: inline-block;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

.btn-secondary:hover {
    background: rgba(255, 215, 0, 0.1);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(5, 10, 20, 0.85);
    backdrop-filter: blur(15px);
    z-index: 1000;
    padding: 20px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: white;
}

.logo .highlight {
    color: var(--accent-gold);
}

.nav-links {
    display: flex;
    gap: 40px;
    align-items: center;
    list-style: none;
}

.nav-links a:not(.btn-primary) {
    font-weight: 500;
    font-size: 1rem;
    color: var(--text-secondary);
}

.nav-links a:not(.btn-primary):hover,
.nav-links a:not(.btn-primary).active {
    color: var(--accent-primary);
}

.nav-links a:not(.btn-primary).active {
    position: relative;
    text-decoration: none;
    /* We will use ::after for a better underline control or just border-bottom */
}

/* Custom underline for active state */
/* Custom underline for active state */
.nav-links a:not(.btn-primary).active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--accent-primary);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.8);
}

/* Active state for the Contact button */
.btn-primary.active {
    background: white;
    color: var(--bg-color);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.hamburger {
    display: none;
    cursor: pointer;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    background-color: white;
    margin: 5px auto;
    transition: all 0.3s ease;
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    padding-top: 80px;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(67, 97, 238, 0.15) 0%, transparent 60%);
    animation: pulseBg 10s infinite alternate;
    z-index: -1;
}

@keyframes pulseBg {
    0% {
        transform: scale(1);
    }

    100% {
        transform: scale(1.1);
    }
}

.hero h1 {
    font-size: var(--font-size-hero);
    line-height: 1.1;
    margin-bottom: 25px;
    font-weight: 800;
}

.hero p {
    font-size: 1.4rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 50px;
}

.hero-btns {
    display: flex;
    gap: 20px;
    justify-content: center;
}

/* Services */
.services {
    padding: 100px 0;
    background: #080E1C;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
}

.service-card {
    background: var(--card-bg);
    padding: 50px 40px;
    border-radius: var(--border-radius);
    transition: var(--transition-speed);
    border: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
}

.service-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent-primary);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.icon-box {
    font-size: 3.5rem;
    margin-bottom: 25px;
    background: rgba(255, 255, 255, 0.05);
    width: 100px;
    height: 100px;
    line-height: 100px;
    border-radius: 50%;
    margin: 0 auto 25px;
}

.service-card h3 {
    margin-bottom: 15px;
    font-size: 1.6rem;
}

.service-card p {
    color: var(--text-secondary);
}

/* Portfolio */
.portfolio {
    padding: 120px 0;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 40px;
}

.project-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: all 0.4s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    position: relative;
    /* group: project-card; - Removed invalid property */
}

.project-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent-gold);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.card-image {
    width: 100%;
    height: 250px;
    overflow: hidden;
    position: relative;
    background: #020408;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Changed from cover to contain to prevent cropping */
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Custom fit for screenshots if needed, usually contain looks cleaner for app screens */
.card-image img[src*="home.png"] {
    object-fit: contain;
    padding: 10px;
}

.project-card:hover .card-image img {
    transform: scale(1.08);
}

.card-content {
    padding: 35px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-content h3 {
    font-size: 1.5rem;
    margin-bottom: 8px;
    font-weight: 600;
}

.project-category {
    color: var(--accent-gold);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 700;
    margin-bottom: 18px;
}

.project-desc {
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-size: 0.95rem;
    flex-grow: 1;
}

.text-link {
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    display: inline-flex;
    align-items: center;
}

.text-link:hover {
    color: var(--accent-primary);
}

/* Modal Styles */
/* Modal Visibility Fix */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    opacity: 1;
    /* Changed from 0 to 1 to ensure visibility */
    transition: opacity 0.3s ease;
}

/* .show class kept for potential future use but not required for basic visibility now */
.modal.show {
    display: block;
    opacity: 1;
}

.modal-content {
    background-color: var(--card-bg);
    margin: 5% auto;
    padding: 0;
    border: 1px solid var(--accent-gold);
    width: 90%;
    max-width: 900px;
    border-radius: var(--border-radius);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal.show .modal-content {
    transform: scale(1);
}

.close-modal {
    color: #aaa;
    float: right;
    font-size: 30px;
    font-weight: bold;
    position: absolute;
    right: 25px;
    top: 15px;
    z-index: 10;
    cursor: pointer;
    transition: 0.2s;
}

.close-modal:hover {
    color: var(--accent-gold);
}

.modal-header {
    padding: 40px;
    display: flex;
    align-items: center;
    gap: 30px;
    background: linear-gradient(to right, rgba(255, 215, 0, 0.05), transparent);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#modal-img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 20px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.modal-title-group h2 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.modal-body {
    padding: 40px;
    max-height: 60vh;
    overflow-y: auto;
    font-size: 1.1rem;
    color: #cbd5e1;
    white-space: normal;
    /* Changed from pre-wrap to normal to fix formatting issues with indented HTML */
}

.modal-body h3 {
    margin-bottom: 0.5rem;
    margin-top: 0;
}

.modal-body p {
    margin-bottom: 0.8rem;
}

/* About & Contact */
.about,
.contact {
    padding: 100px 0;
}

.about {
    background: #080E1C;
}

.stats .number {
    color: var(--accent-primary);
}

.contact-info {
    text-align: center;
    width: 100%;
    background: var(--card-bg);
    padding: 60px;
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.contact-info h4 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--accent-gold);
}

.contact-info p {
    font-size: 1.2rem;
    margin-bottom: 30px;
}

/* Footer */
footer {
    padding: 50px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Animations */
/* Animations Restored */
/* Animations Removed for Stability */

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        right: -100%;
        top: 80px;
        flex-direction: column;
        background: var(--card-bg);
        width: 100%;
        height: calc(100vh - 80px);
        padding: 50px 0;
        transition: 0.3s;
    }

    .nav-links.active {
        right: 0;
    }

    .hamburger {
        display: block;
    }

    .hero h1 {
        font-size: 3rem;
    }

    .modal-header {
        flex-direction: column;
        text-align: center;
    }
}

/* Project Page Styles */
.project-page .navbar {
    background: var(--bg-color);
    position: relative;
    padding: 15px 0;
}

.project-hero {
    padding: 120px 0 80px 0;
    /* Increased top padding significantly to prevent cutting */
    min-height: auto;
    /* Remove rigid height constraint */
    display: flex;
    align-items: center;
    background: radial-gradient(circle at top right, rgba(0, 240, 255, 0.1), transparent 40%);
    position: relative;
    /* For absolute positioning if needed */
}

/* Back Arrow - Fixed to viewport to ensure visibility */
.back-nav {
    position: fixed;
    /* Changed to fixed so it's always visible */
    top: 90px;
    left: 20px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    /* Force white for contrast */
    background: rgba(0, 0, 0, 0.5);
    /* Add background for readability */
    padding: 8px 16px;
    border-radius: 50px;
    font-weight: 500;
    transition: 0.3s;
    backdrop-filter: blur(5px);
}

.back-nav:hover {
    background: var(--accent-primary);
    color: #000;
    transform: translateX(5px);
}

.back-nav i,
.back-nav span {
    font-size: 1.1rem;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    /* Text wider than image */
    gap: 50px;
    align-items: center;
}

.hero-text h1 {
    font-size: var(--font-size-hero);
    /* Unify with main hero */
    margin: 15px 0;
    line-height: 1.1;
    background: linear-gradient(to right, #fff, var(--text-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-text .subtitle {
    font-size: var(--font-size-xl);
    color: var(--text-secondary);
    margin-bottom: 30px;
    max-width: 90%;
}

/* Fixed Gallery Grid */
.gallery-compact-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-top: 40px;
}

.gallery-compact-grid img {
    width: 100%;
    height: 400px;
    /* Taller to allow phone screens to be larger */
    object-fit: contain;
    border-radius: 8px;
    background: transparent;
    /* Remove dark box if it looks like 'cutting' */
    border: none;
    /* Clean look */
    transition: transform 0.3s ease;
    cursor: pointer;
    /* Show it's clickable */
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
    /* Shadow directly on image */
}

.gallery-compact-grid img:hover {
    transform: scale(1.02);
    border-color: var(--accent-primary);
    z-index: 10;
}

/* Sidebar Button Spacing */
.info-card .btn-primary {
    display: block;
    /* Ensure it behaves as a block */
    margin-top: 50px !important;
    /* Massive space forced */
    width: 100%;
}

/* Lightbox Styles */
.lightbox {
    display: none;
    position: fixed;
    z-index: 10000;
    /* Highest Z-index */
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100vh;
    /* Viewport height */
    overflow: hidden;
    /* Prevent scrolling inside container if mistakenly set */
    background-color: rgba(0, 0, 0, 0.95);
    display: flex;
    /* Flex is set in JS but good to have here too if we toggle class */
    flex-direction: column;
    /* Ensure vertical centering works */
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
    visibility: hidden;
    /* Hidden by default */
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    display: flex;
    visibility: visible;
    opacity: 1;
}

.lightbox-content {
    margin: 0 auto;
    display: block;
    max-width: 90vw;
    max-height: 80vh;
    /* Limit height so it doesn't overflow screen */
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.2);
    animation: zoomIn 0.3s ease;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.lightbox-close:hover,
.lightbox-close:focus {
    color: var(--accent-primary);
    text-decoration: none;
    cursor: pointer;
}

@keyframes zoomIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* How It Works Section */
.how-it-works-title {
    margin-top: 40px;
    color: var(--accent-gold);
}

.how-it-works-list {
    margin-left: 20px;
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.8;
}

.how-it-works-list li {
    margin-bottom: 10px;
}

.process-container {
    border: none;
    padding: 0;
    background: none;
}

@media (max-width: 1024px) {
    .gallery-compact-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .gallery-compact-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .gallery-compact-grid img {
        height: 200px;
    }
}

.badge {
    background: rgba(0, 240, 255, 0.1);
    color: var(--accent-primary);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 1px solid rgba(0, 240, 255, 0.2);
}

.store-badge {
    height: 60px;
    /* Larger badge */
    cursor: pointer;
    transition: transform 0.2s;
}

.store-badge:hover {
    transform: scale(1.05);
}

.hero-image img {
    border-radius: 24px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-height: 600px;
    /* Limit height */
    width: auto;
    margin: 0 auto;
    display: block;
}

.project-details {
    padding: 100px 0;
    background: #080E1C;
    position: relative;
}

.details-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 80px;
}

.main-content h2 {
    font-size: 2.5rem;
    margin-bottom: 25px;
    color: white;
}

.main-content h3 {
    font-size: 1.8rem;
    margin-top: 40px;
    margin-bottom: 25px;
    color: var(--accent-gold);
}

.main-content p {
    margin-bottom: 20px;
    color: var(--text-secondary);
    font-size: 1.15rem;
    line-height: 1.8;
}

.features-list {
    margin-top: 40px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.feature-item {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 16px;
    display: flex;
    gap: 20px;
    align-items: flex-start;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition-speed);
}

.feature-item:hover {
    border-color: var(--accent-primary);
    background: rgba(30, 41, 59, 0.8);
}

.feature-item .icon {
    font-size: 2rem;
    background: rgba(255, 255, 255, 0.05);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.feature-item h4 {
    margin-bottom: 8px;
    font-size: 1.2rem;
    color: white;
}

.feature-item p {
    font-size: 0.95rem;
    margin-bottom: 0;
    line-height: 1.5;
}

.project-sidebar .info-box {
    position: sticky;
    top: 100px;
}

.info-box {
    background: var(--card-bg);
    padding: 35px;
    border-radius: 20px;
    border: 1px solid var(--accent-gold);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.info-box h3 {
    font-size: 1.4rem;
    margin-bottom: 25px;
    color: var(--accent-gold);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
}

.info-box ul {
    list-style: none;
}

.info-box ul li {
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-box ul li:last-child {
    border-bottom: none;
}

.project-gallery {
    padding: 100px 0;
}

.gallery-compact-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr) !important;
    /* Force 4 columns on desktop */
    gap: 10px;
}

.gallery-compact-grid img {
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    height: 200px !important;
    /* Force small uniform height */
    width: 100%;
    object-fit: cover;
    /* Use cover for neat thumbnails, user can click to see full if needed (future feature), for now cover makes it look modern/uniform */
    background: #0F172A;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Force 2 columns on mobile so they are NEVER "one after one" */
@media (max-width: 768px) {
    .gallery-compact-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .gallery-compact-grid img {
        height: 150px !important;
        /* Even smaller on mobile */
    }
}

.gallery-compact-grid img:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
    border-color: var(--accent-primary);
}



@media (max-width: 900px) {

    .hero-grid,
    .details-grid {
        grid-template-columns: 1fr;
    }

    .hero-text {
        text-align: center;
    }

    .hero-grid {
        gap: 40px;
    }

    .project-hero {
        padding-top: 40px;
        min-height: auto;
    }

    #modal-img {
        width: 100px;
        height: 100px;
    }
}