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

/* CSS Variables */
:root {
    --background: 240 10% 4%;
    --foreground: 0 0% 100%;
    --card: 240 10% 6%;
    --card-foreground: 0 0% 100%;
    --popover: 240 10% 6%;
    --popover-foreground: 0 0% 100%;
    --primary: 315 100% 50%;
    --primary-foreground: 0 0% 100%;
    --secondary: 180 100% 50%;
    --secondary-foreground: 240 10% 4%;
    --muted: 240 5% 15%;
    --muted-foreground: 240 5% 70%;
    --accent: 280 80% 60%;
    --accent-foreground: 0 0% 100%;
    --destructive: 0 100% 50%;
    --destructive-foreground: 0 0% 100%;
    --border: 240 5% 20%;
    --input: 240 5% 20%;
    --ring: 315 100% 50%;
    --radius: 0.75rem;
}

/* Base Styles */
body {
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(76, 29, 149, 0.15), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(255, 0, 128, 0.1), transparent 25%);
    font-family: Inter, sans-serif;
}

/* Text Effects */
.text-stroke-1 {
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.3);
    color: transparent;
}

.text-stroke-0 {
    -webkit-text-stroke: 0;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.delay-1000 {
    animation-delay: 1000ms;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: hsl(var(--background));
}

::-webkit-scrollbar-thumb {
    background: hsl(var(--muted));
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: hsl(var(--primary));
}

/* ========================================
   MOBILE MENU STYLES
   ======================================== */

/* Mobile Menu Container */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100vh;
    background: rgba(14, 14, 14, 0.93);
    z-index: 100;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px);
    transition: opacity 0.4s ease, transform 0.4s ease, visibility 0.4s;
}

/* Mobile Menu Open State */
.mobile-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Mobile Menu Header */
.mobile-menu-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    background: rgba(14, 14, 14, 0.93);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 101;
}

/* Mobile Menu Close Button */
.mobile-menu-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.5rem;
    background: transparent;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mobile-menu-close:hover {
    border-color: hsl(var(--primary));
    background: rgba(255, 0, 128, 0.1);
    color: hsl(var(--primary));
}

/* Mobile Menu Content */
.mobile-menu-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-top: 5rem;
    padding-bottom: 2rem;
    -webkit-overflow-scrolling: touch;
}

/* Mobile Navigation */
.mobile-nav {
    padding: 1rem 2rem;
    max-width: 100%;
}

/* Mobile Nav Section */
.mobile-nav-section {
    margin-bottom: 2rem;
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

.mobile-menu.active .mobile-nav-section:nth-child(1) {
    animation-delay: 0.1s;
}

.mobile-menu.active .mobile-nav-section:nth-child(2) {
    animation-delay: 0.15s;
}

.mobile-menu.active .mobile-nav-section:nth-child(3) {
    animation-delay: 0.2s;
}

.mobile-menu.active .mobile-nav-section:nth-child(4) {
    animation-delay: 0.25s;
}

.mobile-menu.active .mobile-nav-section:nth-child(5) {
    animation-delay: 0.3s;
}

.mobile-menu.active .mobile-nav-section:nth-child(6) {
    animation-delay: 0.35s;
}

.mobile-menu.active .mobile-nav-cta {
    animation-delay: 0.4s;
}

/* Mobile Nav Title */
.mobile-nav-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    font-family: 'Space Grotesk', sans-serif;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem 0;
    transition: color 0.3s ease;
    text-align: left;
}

.mobile-nav-title:hover {
    color: hsl(var(--primary));
}

/* Dropdown Icon */
.dropdown-icon {
    width: 1.25rem;
    height: 1.25rem;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.mobile-nav-title.active .dropdown-icon {
    transform: rotate(180deg);
}

/* Mobile Nav Links */
.mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-left: 1rem;
    border-left: 2px solid rgba(255, 255, 255, 0.1);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease, margin-bottom 0.3s ease;
    opacity: 0;
    margin-bottom: 0;
}

.mobile-nav-links.active {
    max-height: 500px;
    opacity: 1;
    margin-bottom: 1rem;
}

/* Mobile Links */
.mobile-link {
    display: block;
    font-size: 1rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    text-decoration: none;
}

.mobile-link:hover {
    color: hsl(var(--primary));
    background: rgba(255, 0, 128, 0.1);
    padding-left: 1rem;
}

/* Mobile Link Small */
.mobile-link-sm {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
    padding-left: 1.25rem;
}

.mobile-link-sm:hover {
    padding-left: 1.5rem;
}

/* Mobile CTA */
.mobile-nav-cta {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

/* Mobile CTA Button */
.mobile-cta-btn {
    display: block;
    width: 100%;
    padding: 1rem 2rem;
    background: hsl(var(--primary));
    color: white;
    font-size: 1.125rem;
    font-weight: 700;
    text-align: center;
    border-radius: 9999px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(255, 0, 128, 0.4);
}

.mobile-cta-btn:hover {
    background: hsl(var(--primary) / 0.9);
    box-shadow: 0 0 30px rgba(255, 0, 128, 0.6);
    transform: translateY(-2px);
}

/* Body Scroll Lock */
body.mobile-menu-open {
    overflow: hidden;
    height: 100vh;
}

/* Mobile Menu Scrollbar */
.mobile-menu-content::-webkit-scrollbar {
    width: 6px;
}

.mobile-menu-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.mobile-menu-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.mobile-menu-content::-webkit-scrollbar-thumb:hover {
    background: hsl(var(--primary));
}

/* ========================================
   ADDITIONAL COMPONENT STYLES
   ======================================== */

/* Stat Card */
.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 0, 128, 0.05), rgba(0, 255, 255, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card:hover::before {
    opacity: 1;
}

/* Lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.lightbox.active .lightbox-content {
    transform: scale(1);
}

.lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Gallery */
.gallery-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border-radius: 1.5rem;
}

.gallery-item img {
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.5rem;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

/* Category Filter */
.category-btn {
    transition: all 0.3s ease;
}

.category-btn.active {
    background: hsl(var(--primary));
    color: white;
    border-color: hsl(var(--primary));
}

/* Project Card */
.project-card {
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 0, 128, 0.1), rgba(0, 255, 255, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-card:hover::before {
    opacity: 1;
}

.project-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    display: flex;
    align-items: flex-end;
    padding: 2rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-card:hover .project-overlay {
    opacity: 1;
}

/* Service Card */
.service-card {
    transition: all 0.3s ease;
}

.service-card:hover {
    transform: translateY(-8px);
}

/* Pricing Feature */
.pricing-feature::before {
    content: "✓";
    color: hsl(var(--primary));
    font-weight: bold;
    margin-right: 0.75rem;
}

/* Sticky Sidebar */
.sticky-sidebar {
    position: sticky;
    top: 100px;
}

/* Gradient Background */
.gradient-bg {
    background: linear-gradient(-45deg, #1a0b2e, #16213e, #0f3460, #1a0b2e);
    background-size: 400% 400%;
    animation: gradient-shift 15s ease infinite;
}

/* Glass Card */
.glass-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Input Glow */
.input-glow:focus {
    box-shadow: 0 0 0 3px rgba(255, 0, 128, 0.2);
}

/* Floating Orbs */
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.6;
    animation: float 6s ease-in-out infinite;
}

.orb-1 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 0, 128, 0.4), transparent);
    top: 10%;
    right: 10%;
    animation-delay: 0s;
}

.orb-2 {
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(0, 255, 255, 0.3), transparent);
    bottom: 20%;
    left: 15%;
    animation-delay: 2s;
}

.orb-3 {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(128, 0, 255, 0.3), transparent);
    top: 50%;
    left: 50%;
    animation-delay: 4s;
}

/* Masonry Grid */
.masonry-grid {
    column-count: 1;
    column-gap: 1.5rem;
}

@media (min-width: 640px) {
    .masonry-grid {
        column-count: 2;
    }
}

@media (min-width: 1024px) {
    .masonry-grid {
        column-count: 3;
    }
}

.masonry-item {
    break-inside: avoid;
    margin-bottom: 1.5rem;
}

/* ========================================
   ANIMATIONS
   ======================================== */

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

@keyframes gradient-shift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
    }
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

/* Hide mobile menu on desktop */
@media (min-width: 1024px) {
    .mobile-menu {
        display: none !important;
    }
}

/* Lightbox Responsive */
@media (max-width: 1024px) {
    .lightbox-content {
        flex-direction: column;
        max-height: none;
    }

    .lightbox-details {
        width: 100%;
        max-height: 300px;
    }

    .lightbox img {
        max-height: 50vh;
    }
}

/* ========================================
   PERFORMANCE OPTIMIZATIONS
   ======================================== */

/* Optimize animations for better performance */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Optimize images for better performance */
img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Optimize font rendering */
body {
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
