/* Custom CSS for CodeAssist.dev */

/* Glassmorphic Effects */
.glassmorphic {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.glassmorphic-dark {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.glassmorphic-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
}

/* Unique Background Effects */
.neural-network-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

.neural-network-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(120, 219, 255, 0.3) 0%, transparent 50%),
        linear-gradient(135deg, #0c0c0c 0%, #1a1a2e 50%, #16213e 100%);
    animation: networkFlow 20s ease-in-out infinite;
}

.code-grid-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(120, 119, 198, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(120, 119, 198, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridShift 30s linear infinite;
}

.floating-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(120, 119, 198, 0.6);
    border-radius: 50%;
    animation: particleFloat 15s linear infinite;
}

/* Gradient Effects */
.gradient-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.gradient-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
    animation: gradientShift 3s ease-in-out infinite;
}

.gradient-border {
    background: linear-gradient(135deg, #667eea, #764ba2, #f093fb);
    padding: 2px;
    border-radius: 12px;
}

.gradient-border-content {
    background: rgba(0, 0, 0, 0.8);
    border-radius: 10px;
    padding: 1.5rem;
}

/* Animations */
@keyframes networkFlow {
    0%, 100% { transform: translateX(0) translateY(0) rotate(0deg); }
    25% { transform: translateX(-20px) translateY(-20px) rotate(1deg); }
    50% { transform: translateX(20px) translateY(-40px) rotate(-1deg); }
    75% { transform: translateX(-40px) translateY(20px) rotate(0.5deg); }
}

@keyframes gridShift {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(100px);
        opacity: 0;
    }
}

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

.floating {
    animation: floating 6s ease-in-out infinite;
}

@keyframes floating {
    0%, 100% { 
        transform: translateY(0px) rotateX(0deg); 
    }
    50% { 
        transform: translateY(-20px) rotateX(5deg); 
    }
}

.slide-in {
    animation: slideIn 0.8s ease-out forwards;
    opacity: 0;
    transform: translateY(30px);
}

@keyframes slideIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in-left {
    animation: slideInLeft 0.8s ease-out forwards;
    opacity: 0;
    transform: translateX(-50px);
}

@keyframes slideInLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-right {
    animation: slideInRight 0.8s ease-out forwards;
    opacity: 0;
    transform: translateX(50px);
}

@keyframes slideInRight {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.pulse-ring {
    animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.2);
        opacity: 0;
    }
}

.morphing-shape {
    animation: morphShape 8s ease-in-out infinite;
}

@keyframes morphShape {
    0%, 100% { border-radius: 50% 30% 70% 40%; }
    25% { border-radius: 30% 70% 40% 50%; }
    50% { border-radius: 70% 40% 50% 30%; }
    75% { border-radius: 40% 50% 30% 70%; }
}

/* Animation Delays */
.animation-delay-1s { animation-delay: 1s; }
.animation-delay-2s { animation-delay: 2s; }
.animation-delay-3s { animation-delay: 3s; }
.animation-delay-4s { animation-delay: 4s; }

/* Code Block Styling */
.code-block {
    background: rgba(0, 0, 0, 0.9);
    border-radius: 12px;
    padding: 1.5rem;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    overflow-x: auto;
    border: 1px solid rgba(120, 119, 198, 0.3);
    position: relative;
}

.code-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(120, 119, 198, 0.1) 0%, transparent 50%);
    border-radius: 12px;
    pointer-events: none;
}

.terminal-header {
    display: flex;
    gap: 8px;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.terminal-button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.terminal-button.red { background: #ff5f57; }
.terminal-button.yellow { background: #ffbd2e; }
.terminal-button.green { background: #28ca42; }

/* Enhanced Button Styling */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    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%;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Ripple Effect */
button {
    position: relative;
    overflow: hidden;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0);
    animation: ripple-animation 0.6s linear;
    pointer-events: none;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Cursor Animation */
.cursor {
    animation: blink 1s infinite;
    color: #fff;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Enhanced Hover Effects */
.feature-card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
}

.feature-card:hover {
    transform: translateY(-10px) rotateX(10deg) rotateY(5deg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.integration-card {
    transition: all 0.3s ease;
    transform-style: preserve-3d;
}

.integration-card:hover {
    transform: translateY(-5px) scale(1.05) rotateY(10deg);
}

.cta-button {
    transition: all 0.3s ease;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.4);
}

/* Stats Counter Animation */
.counter {
    font-size: 3rem;
    font-weight: bold;
    color: #667eea;
}

/* Pricing Card Effects */
.pricing-card {
    transition: all 0.4s ease;
    position: relative;
}

.pricing-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
}

.pricing-card.featured {
    border: 2px solid #667eea;
    position: relative;
}

.pricing-card.featured::before {
    content: 'Most Popular';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Timeline Styles */
.timeline {
    position: relative;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, #667eea, #764ba2);
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    margin: 2rem 0;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 16px;
    height: 16px;
    background: #667eea;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    border: 4px solid #1a1a2e;
}

/* Testimonial Card */
.testimonial-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.3s ease;
}

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

/* FAQ Accordion */
.faq-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem 0;
}

.faq-question {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    transition: color 0.3s ease;
}

.faq-question:hover {
    color: #667eea;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-answer.active {
    max-height: 200px;
    padding-top: 1rem;
}

/* Loading Animation */
.loading-dots {
    display: inline-block;
}

.loading-dots::after {
    content: '';
    animation: dots 2s infinite;
}

@keyframes dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

/* Responsive Design Enhancements */
@media (max-width: 768px) {
    .floating {
        animation: none;
        transform: none;
    }
    
    .slide-in {
        animation-delay: 0s;
    }
    
    .code-block {
        font-size: 0.8rem;
        padding: 1rem;
    }
    
    .feature-card:hover {
        transform: translateY(-5px);
    }
    
    .timeline::before {
        left: 20px;
    }
    
    .timeline-item::before {
        left: 20px;
    }
    
    .neural-network-bg::before {
        animation: none;
    }
}

@media (max-width: 480px) {
    .glassmorphic-dark {
        backdrop-filter: blur(10px);
    }
    
    .gradient-text {
        background-size: 100% 100%;
        animation: none;
    }
}

/* Print Styles */
@media print {
    .neural-network-bg,
    .floating-particles,
    .code-grid-bg {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
}

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

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2, #667eea);
}

/* Selection Styling */
::selection {
    background: rgba(102, 126, 234, 0.3);
    color: white;
}

::-moz-selection {
    background: rgba(102, 126, 234, 0.3);
    color: white;
}

/* Modal Styles */
.modal {
    backdrop-filter: blur(8px);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex !important;
}

.modal.show .modal-container > div {
    transform: scale(1);
    opacity: 1;
}

.modal-overlay {
    cursor: pointer;
}

.modal-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 1rem;
}

.modal input, .modal select, .modal textarea {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    transition: all 0.3s ease;
}

.modal input:focus, .modal select:focus, .modal textarea:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.modal input::placeholder, .modal textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.modal select option {
    background: #1a1a2e;
    color: white;
}

.modal label {
    color: rgba(255, 255, 255, 0.9);
}

/* Form validation styles */
.modal input.error, .modal select.error, .modal textarea.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.error-message {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: none;
}

.error-message.show {
    display: block;
}

/* Loading spinner styles */
.loading-spinner {
    display: none;
}

.loading .loading-text {
    display: none;
}

.loading .loading-spinner {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Success message styles */
.success-message {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #22c55e;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: none;
}

.success-message.show {
    display: block;
}

/* Hero section base styles - Proper spacing below fixed header */
.hero-section {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    padding-top: 120px; /* Safe spacing for navigation clearance */
}

/* Navigation height consistency */
nav {
    height: 64px;
    backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

/* White glassy navigation effect on scroll */
nav.scrolled {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(25px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(255, 255, 255, 0.1);
}

/* Fix navigation internal spacing */
nav .py-4 {
    padding-top: 0.75rem !important;
    padding-bottom: 0.75rem !important;
}

/* Navigation items spacing */
nav .flex.justify-between.items-center {
    height: 100%;
    align-items: center;
}

/* Desktop-specific adjustments */
@media (min-width: 768px) {
    .hero-section {
        padding-top: 140px; /* Adequate space below header on desktop */
        min-height: calc(100vh - 64px);
    }
    
    /* Navigation adjustments for desktop */
    nav {
        height: 64px;
    }
    
    /* Ensure navigation content fits properly */
    nav .max-w-7xl {
        height: 100%;
    }
    
    nav .flex.justify-between.items-center {
        height: 100%;
        padding: 0;
    }
}

/* Hero section mobile fixes */
@media (max-width: 768px) {
    /* Hero section adjustments for mobile */
    .hero-section {
        padding-top: 100px; /* Proper mobile spacing */
        min-height: calc(100vh - 64px);
    }
    
    /* Ensure proper spacing on small screens */
    .slide-in h1 {
        margin-top: 1rem;
        line-height: 1.1;
    }
    
    /* Navigation adjustments for mobile */
    nav {
        height: 64px;
    }
    
    /* Mobile navigation spacing */
    nav .py-4 {
        padding-top: 0.5rem !important;
        padding-bottom: 0.5rem !important;
    }
}

/* Modal responsiveness */
@media (max-width: 640px) {
    .modal-container {
        padding: 1rem;
        align-items: flex-start;
        padding-top: 2rem;
    }
    
    .modal .glassmorphic-dark {
        max-width: 100%;
        width: 100%;
        padding: 1.5rem;
        margin: 0;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    /* Smaller modal content for mobile */
    .modal h2 {
        font-size: 1.5rem;
    }
    
    .modal .space-y-4 > div {
        margin-bottom: 1rem;
    }
    
    .modal input, .modal select, .modal textarea {
        padding: 0.75rem;
        font-size: 1rem;
    }
}

/* Additional mobile improvements */
@media (max-width: 480px) {
    /* Hero section specific mobile fixes */
    section:first-of-type {
        padding-top: 5rem !important;
    }
    
    .slide-in h1 {
        font-size: 2.5rem !important;
        margin-top: 1rem;
    }
    
    /* Modal improvements for very small screens */
    .modal-container {
        padding: 0.5rem;
        padding-top: 1rem;
    }
    
    .modal .glassmorphic-dark {
        padding: 1rem;
        border-radius: 1rem;
    }
    
    .modal .flex.gap-4 {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .modal button {
        width: 100%;
        padding: 0.875rem;
    }
}