/* Base Styles */
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    margin: 0;
    padding: 0;
    font-family: 'Oxygen', sans-serif;
}

/* Allow selection in specific areas */
footer, #codeEditor {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* Currency button styles */
.currency-btn {
    background-color: transparent;
    color: #6b7280;
}

.currency-btn.active {
    background-color: #000 !important;
    color: #fff !important;
}

.currency-btn.active:hover {
    background-color: #1f2937 !important;
}

/* Auto-detect button special styling */
.currency-auto {
    background-color: #f3f4f6;
    color: #4b5563;
}

.currency-auto.active {
    background-color: #3b82f6 !important;
    color: #fff !important;
}

.currency-auto.active:hover {
    background-color: #2563eb !important;
}

/* Typography Styles */
/* Improved typography hierarchy */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
    font-weight: 900 !important;
    font-stretch: condensed;
}

.hero-title {
    line-height: 0.9;
    letter-spacing: -0.04em;
}

.section-title {
    line-height: 1.1;
    letter-spacing: -0.03em;
}

/* Layout Utilities */
.content-spacing {
    margin-bottom: 2rem;
}

.section-padding {
    padding: 5rem 0;
}

.card-spacing {
    padding: 2rem;
}

/* Hero Components */
.hero-3d-container {
    background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
    border-radius: 32px;
    position: relative;
    overflow: hidden;
}

.hero-3d-container-bg {
    background: #000000;
    background-image: 
        radial-gradient(ellipse at center, transparent 0%, transparent 40%, rgba(0,0,0,0.3) 70%, rgba(0,0,0,0.8) 100%),
        url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M40 0v40H0V0h40z' stroke='%23ffffff' stroke-opacity='0.1' stroke-width='1'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    background-size: 100% 100%, 40px 40px;
    width: 100%;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 1;
}

.abstract-3d {
    background: linear-gradient(135deg, 
        #8b5cf6 0%, 
        #ec4899 20%, 
        #f97316 40%, 
        #ef4444 60%, 
        #8b5cf6 80%, 
        #6366f1 100%);
    background-size: 300% 300%;
    animation: gradientFlow 8s ease-in-out infinite;
    border-radius: 50px;
    position: relative;
}

@keyframes gradientFlow {
    0%, 100% { background-position: 0% 50%; }
    33% { background-position: 100% 50%; }
    66% { background-position: 50% 100%; }
}

.abstract-3d::before {
    content: '';
    position: absolute;
    top: 10%;
    left: 10%;
    right: 10%;
    bottom: 10%;
    background: linear-gradient(45deg, 
        rgba(255,255,255,0.3) 0%, 
        rgba(255,255,255,0.1) 50%, 
        rgba(255,255,255,0.3) 100%);
    border-radius: 40px;
    animation: shimmer 4s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { opacity: 0.3; transform: translateY(0px) scale(1); }
    50% { opacity: 0.6; transform: translateY(-5px) scale(1.02); }
}

/* UI Component Styles */
.company-logo {
    filter: grayscale(100%) opacity(0.6);
    transition: all 0.3s ease;
}

.company-logo:hover {
    filter: grayscale(0%) opacity(1);
    transform: translateY(-2px);
}

/* Glass morphism styles for sections */
.glass-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    transition: all 0.3s ease;
}

.glass-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateY(-4px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* Navigation Styles */
/* Mobile menu hamburger animation */
#mobileMenuBtn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

#mobileMenuBtn.active span:nth-child(2) {
    opacity: 0;
}

#mobileMenuBtn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Mobile menu panel animation */
#mobileMenu.show #mobileMenuPanel {
    transform: translateY(0);
}

/* Navigation links */
.nav-link {
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
}

.nav-link:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
}

/* Navbar Styles */
#navbar {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    background-color: white;
}

.navbar-gradient {
    background: linear-gradient(-45deg, #f9fafb, #f3f4f6, #e5e7eb, #f9fafb);
    background-size: 400% 400%;
    animation: gradientShift 8s ease-in-out infinite;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.navbar-scrolled {
    backdrop-filter: blur(20px) saturate(180%);
    background: rgba(255, 255, 255, 0.9) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    padding: 0.5rem 2rem !important;
    position: relative;
}

.navbar-scrolled::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.6) 50%, 
        transparent 100%);
}

/* Animations */
/* Hero section animations */
@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(5deg); }
}

/* Enhanced micro-interactions and hover states */
.hover-lift {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
    transform: translateY(-2px);
}

.feature-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0.75rem;
    border-radius: 12px;
    margin: -0.75rem;
}

.feature-item:hover {
    background: rgba(59, 130, 246, 0.05);
    transform: translateY(-4px);
}

/* Smooth animations for all interactive elements */
button, a, input, textarea, .skill-card, .glass-card, .company-logo {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Enhanced page transition animations */
.page-transition {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.page-transition.visible {
    opacity: 1;
    transform: translateY(0);
}

.page-transition.slide-up {
    transform: translateY(50px);
}

.page-transition.slide-up.visible {
    transform: translateY(0);
}

/* Staggered animation for child elements */
.stagger-children > * {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.stagger-children.animate > *:nth-child(1) { transition-delay: 0.1s; }
.stagger-children.animate > *:nth-child(2) { transition-delay: 0.2s; }
.stagger-children.animate > *:nth-child(3) { transition-delay: 0.3s; }
.stagger-children.animate > *:nth-child(4) { transition-delay: 0.4s; }
.stagger-children.animate > *:nth-child(5) { transition-delay: 0.5s; }
.stagger-children.animate > *:nth-child(6) { transition-delay: 0.6s; }

.stagger-children.animate > * {
    opacity: 1;
    transform: translateY(0);
}

/* Section transitions */
section {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Skill card animations */
.skill-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.skill-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* Form Styles */
.form-input {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-input:focus {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* Custom Select Dropdown Styling */
select.form-input {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

select.form-input:focus {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%233b82f6' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
}

select.form-input option {
    padding: 12px 16px;
    background-color: white;
    color: #1f2937;
    font-size: 14px;
    border: none;
    transition: all 0.2s ease;
}

select.form-input option:hover {
    background-color: #f3f4f6;
    color: #111827;
}

select.form-input option:checked {
    background-color: #3b82f6;
    color: white;
    font-weight: 500;
}

select.form-input option:disabled {
    color: #9ca3af;
    background-color: #f9fafb;
    cursor: not-allowed;
}

/* Custom Checkbox Styling */
input[type="checkbox"] {
    accent-color: #3b82f6;
    cursor: pointer;
}

input[type="checkbox"]:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

input[type="checkbox"] + label {
    cursor: pointer;
}

/* Button Styles */
/* Contact button animation */
.contact-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.contact-btn .arrow-icon {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.contact-btn:hover .arrow-icon {
    transform: translateX(2px);
}

/* Launch project button animation */
.launch-btn .arrow-icon {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.launch-btn:hover .arrow-icon {
    transform: translateX(2px);
}

/* Back to Top Button Styles */
#backToTop {
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform: translateY(10px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

#backToTop.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

#backToTop:hover {
    transform: translateY(-2px) scale(1.1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

#backToTop:active {
    transform: translateY(0) scale(0.95);
}

/* Pulse animation when first appearing */
#backToTop.pulse {
    animation: backToTopPulse 0.6s ease-out;
}

@keyframes backToTopPulse {
    0% {
        transform: translateY(10px) scale(0.8);
        opacity: 0;
    }
    50% {
        transform: translateY(-5px) scale(1.1);
        opacity: 0.8;
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

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

::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
    transition: background 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Dark scrollbar for code editor */
#codeEditor::-webkit-scrollbar {
    width: 6px;
}

#codeEditor::-webkit-scrollbar-track {
    background: #2d3748;
}

#codeEditor::-webkit-scrollbar-thumb {
    background: #4a5568;
    border-radius: 3px;
}

#codeEditor::-webkit-scrollbar-thumb:hover {
    background: #718096;
}

/* Firefox Scrollbar */
html {
    scrollbar-width: thin;
    scrollbar-color: #d1d5db #f5f5f5;
}

/* Text Effects */
/* Scanning text animation */
.scan-text {
    background: linear-gradient(
        90deg,
        #1f2937 0%,
        #1f2937 40%,
        #6b7280 50%,
        #1f2937 60%,
        #1f2937 100%
    );
    background-size: 300% 100%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: textScan 8s linear infinite;
}

@keyframes textScan {
    0% {
        background-position: -300% 0;
    }
    100% {
        background-position: 300% 0;
    }
}

/* Animated heading styles */
.animated-heading {
    position: relative;
    overflow: hidden;
}

.animated-heading .line {
    display: block;
    opacity: 0.5;
    transition: all 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    color: rgba(255, 255, 255, 0.5);
}

.animated-heading .line.highlighted {
    opacity: 1;
    transform: translateY(-2px);
    color: #ffffff;
}

.animated-heading .line::after {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 0;
    background: linear-gradient(to bottom, #3b82f6, #8b5cf6);
    transition: all 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 2px;
}

.animated-heading .line.highlighted::after {
    height: 80%;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

/* SEO Demo Styles */
/* SEO Demo Chart Styles */
#trafficChart {
    height: 300px !important;
}

.case-study-btn.active {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Footer Animations */
/* Enhanced Footer Animations */
.animate-pulse-slow {
    animation: pulse-slow 3s ease-in-out infinite;
}

.animate-fade-in-up {
    animation: fade-in-up 0.8s ease-out 0.2s both;
}

@keyframes pulse-slow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Social Links Float Animations */
.animate-float-delay-0 {
    animation: float 6s ease-in-out infinite;
}

.animate-float-delay-1 {
    animation: float 6s ease-in-out infinite 2s;
}

.animate-float-delay-2 {
    animation: float 6s ease-in-out infinite 4s;
}

/* Footer Visual Enhancements */
.animate-gradient-flow {
    animation: gradient-flow-border 4s ease-in-out infinite;
    background-size: 300% 100%;
}

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

/* Breathing animation for footer elements */
.footer-breathe {
    animation: breathe 4s ease-in-out infinite;
}

@keyframes breathe {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.02); opacity: 0.9; }
}

/* Responsive Design */
/* Improved hero container responsive design */
@media (max-width: 1024px) {
    .hero-3d-container {
        height: 400px;
    }
    
    /* Mobile responsiveness for SEO demo */
    #seo-demo .grid.lg\\:grid-cols-2 {
        gap: 3rem;
    }
    
    #trafficChart {
        height: 250px !important;
    }
}

@media (max-width: 768px) {
    .hero-3d-container {
        height: 300px;
        padding: 1.5rem;
    }
    
    .abstract-3d {
        width: 200px;
        height: 200px;
    }
    
    #seo-demo h2.hero-title {
        font-size: 3rem;
        line-height: 0.9;
    }
    
    #seo-demo h3.section-title {
        font-size: 2rem;
    }
    
    #trafficChart {
        max-width: 100%;
    }
    
    .bg-gray-50.rounded-3xl .relative {
        height: 220px !important;
    }
    
    .case-study-btn, .snippet-btn {
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
    }
    
    .rich-snippet-example {
        padding: 1rem;
    }
    
    #seo-demo .grid.lg\\:grid-cols-2 {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    #seo-demo .max-w-7xl {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    #seo-demo .section-padding {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Mobile form spacing adjustments - Force override Tailwind space-y-6 */
@media screen and (max-width: 768px) {
    form#contactForm.space-y-6 > div.relative:not(:first-child),
    form#contactForm.space-y-6 > .relative + .relative,
    #contactForm.space-y-6 > div:not(:first-child),
    #contactForm > div.relative:nth-child(n+2) {
        margin-top: 0.75rem !important;
    }
    
    /* Reduce form div heights on mobile - exclude checkboxes */
    #contactForm .relative:has(input:not([type="checkbox"])),
    #contactForm .relative:has(select),
    #contactForm .relative:has(textarea) {
        height: 65px !important;
    }
    
    /* Add spacing for privacy consent checkbox */
    #contactForm .flex.items-start.space-x-3 {
        margin-top: 5rem !important;
    }
}

@media screen and (max-width: 480px) {
    /* Further reduce form spacing on very small screens */
    form#contactForm.space-y-6 > div.relative:not(:first-child),
    form#contactForm.space-y-6 > .relative + .relative,
    #contactForm.space-y-6 > div:not(:first-child),
    #contactForm > div.relative:nth-child(n+2) {
        margin-top: 0.5rem !important;
    }
    
    /* Keep same div height for small mobile - exclude checkboxes */
    #contactForm .relative:has(input:not([type="checkbox"])),
    #contactForm .relative:has(select),
    #contactForm .relative:has(textarea) {
        height: 65px !important;
    }
    
    /* Keep same spacing for privacy consent checkbox */
    #contactForm .flex.items-start.space-x-3 {
        margin-top: 5rem !important;
    }
    
    #seo-demo .bg-gray-50.rounded-3xl {
        padding: 1rem !important;
        border-radius: 1rem !important;
    }
    
    .bg-gray-50.rounded-3xl .relative {
        height: 180px !important;
    }
    
    .case-study-btn, .snippet-btn {
        font-size: 0.75rem;
        padding: 0.375rem 0.5rem;
    }
    
    #seo-demo h2.hero-title {
        font-size: 2.5rem;
    }
    
    #seo-demo h3.section-title {
        font-size: 1.5rem;
    }
    
    /* Ensure no horizontal overflow */
    #seo-demo * {
        max-width: 100%;
        box-sizing: border-box;
    }
    
    #seo-demo canvas {
        max-width: 100% !important;
        height: auto !important;
    }
    
    #seo-demo .max-w-7xl,
    #seo-demo .max-w-6xl,
    #seo-demo .max-w-3xl,
    #seo-demo .max-w-2xl {
        max-width: 100%;
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    #seo-demo .snippet-example {
        overflow-wrap: break-word;
        word-wrap: break-word;
        hyphens: auto;
    }
    
    #seo-demo .snippet-example div {
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }
}