/* Custom CSS for Open Build */

/* Animation for code-like shapes */
@keyframes float {
    0%, 100% {
        transform: translate(0px, 0px) rotate(0deg);
        opacity: 0.1;
    }
    25% {
        transform: translate(20px, -30px) rotate(90deg);
        opacity: 0.15;
    }
    50% {
        transform: translate(-15px, 20px) rotate(180deg);
        opacity: 0.1;
    }
    75% {
        transform: translate(25px, 10px) rotate(270deg);
        opacity: 0.08;
    }
}

@keyframes code-drift {
    0%, 100% {
        transform: translateY(0px) translateX(0px) rotate(0deg);
        opacity: 0.05;
    }
    33% {
        transform: translateY(-20px) translateX(30px) rotate(45deg);
        opacity: 0.1;
    }
    66% {
        transform: translateY(15px) translateX(-25px) rotate(-45deg);
        opacity: 0.07;
    }
}

@keyframes tetris-fall {
    0% {
        transform: translateY(-50px) rotate(0deg);
        opacity: 0;
    }
    20% {
        opacity: 0.1;
    }
    80% {
        opacity: 0.1;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

.animate-float {
    animation: float 8s infinite ease-in-out;
}

.animate-code-drift {
    animation: code-drift 12s infinite ease-in-out;
}

.animate-tetris {
    animation: tetris-fall 15s infinite linear;
}

.animation-delay-2000 {
    animation-delay: 2s;
}

.animation-delay-4000 {
    animation-delay: 4s;
}

.animation-delay-6000 {
    animation-delay: 6s;
}

.animation-delay-8000 {
    animation-delay: 8s;
}

/* Code-themed elements styling */
.code-element {
    filter: drop-shadow(0 0 10px currentColor);
    user-select: none;
    pointer-events: none;
}

/* Tetris blocks styling */
.tetris-block {
    border-radius: 2px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Theme transition improvements */
* {
    transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 300ms;
}

/* Theme toggle button styling */
#theme-toggle {
    transition: all 0.3s ease;
}

#theme-toggle:hover {
    transform: scale(1.05);
}

/* Enhanced gradient text for both themes */
.gradient-text-light {
    background: linear-gradient(135deg, #2563eb, #7c3aed, #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gradient-text-dark {
    background: linear-gradient(135deg, #60a5fa, #34d399, #fbbf24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Code animation opacity adjustments for light theme */
html:not(.dark) .code-element {
    opacity: 0.15 !important;
}

html.dark .code-element {
    opacity: 0.1 !important;
}

/* Card shadows for both themes */
.card-light {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.card-dark {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #2563eb;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #1d4ed8;
}

/* Form styling enhancements */
input:focus, textarea:focus, select:focus {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Modal animations */
#application-modal {
    animation: fadeIn 0.3s ease-out;
}

#application-modal > div {
    animation: slideIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Navigation background transition */
#navbar.scrolled {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* Card hover effects */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Button hover effects */
.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

/* Loading animation */
.loading {
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success message styling */
.success-message {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
    display: none;
}

.error-message {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
    display: none;
}

/* Responsive typography */
@media (max-width: 640px) {
    h1 {
        font-size: 2.5rem;
        line-height: 1.2;
    }
    
    h2 {
        font-size: 2rem;
        line-height: 1.3;
    }
    
    .text-xl {
        font-size: 1.125rem;
    }
}

/* Intersection observer fade-in animation */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Pricing card special styling */
.pricing-card {
    position: relative;
    transition: all 0.3s ease;
}

.pricing-card.featured {
    transform: scale(1.05);
    z-index: 10;
}

.pricing-card.featured::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(45deg, #2563eb, #7c3aed, #06b6d4);
    border-radius: 1rem;
    z-index: -1;
}

/* Contact form enhancements */
.form-group {
    position: relative;
}

.form-label {
    position: absolute;
    top: 0;
    left: 0;
    padding: 0.75rem 1rem;
    pointer-events: none;
    transition: all 0.3s ease;
    color: #6b7280;
}

.form-input:focus + .form-label,
.form-input:not(:placeholder-shown) + .form-label {
    transform: translateY(-100%) scale(0.85);
    background: white;
    padding: 0 0.5rem;
    color: #2563eb;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .auto-dark {
        background-color: #1f2937;
        color: #f9fafb;
    }
    
    .auto-dark input,
    .auto-dark textarea,
    .auto-dark select {
        background-color: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    h1, h2, h3 {
        page-break-after: avoid;
    }
}

/* Performance optimizations */
.will-change-transform {
    will-change: transform;
}

.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}
