/* Advanced Custom Styles */
body {
    background-color: #030712;
    background-image:
        radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 100% 100%, 50px 50px, 50px 50px;
    overflow-x: hidden;
}

/* Skip Navigation Link */
.skip-nav {
    position: absolute;
    top: -40px;
    left: 0;
    background: #6366f1;
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 200;
    border-radius: 0 0 8px 0;
    font-weight: 600;
}

.skip-nav:focus {
    top: 0;
}

/* Scroll Progress Bar */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(to right, #6366f1, #06b6d4);
    z-index: 100;
    width: 0%;
    transition: width 0.1s;
}

/* Floating Navbar Glass */
.nav-glass {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

/* Card Spotlight Effect */
.spotlight-card {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.spotlight-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.spotlight-card:hover {
    border-color: rgba(99, 102, 241, 0.4);
    transform: translateY(-5px);
    box-shadow: 0 20px 40px -15px rgba(99, 102, 241, 0.2);
}

/* Active Nav Link State */
.nav-link.active {
    color: #fff;
    font-weight: 600;
}
.nav-link.active::after {
    content: '';
    display: block;
    width: 100%;
    height: 2px;
    background: #06b6d4;
    margin-top: 2px;
    border-radius: 2px;
    animation: fadeIn 0.3s ease;
}
@keyframes fadeIn { from { width: 0; opacity: 0; } to { width: 100%; opacity: 1; } }

/* Gradient Text */
.text-gradient-main {
    background: linear-gradient(to right, #38bdf8, #818cf8, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% auto;
    animation: gradientMove 5s linear infinite;
}

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

/* Back to Top Button */
#back-to-top {
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
#back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #030712; }
::-webkit-scrollbar-thumb { background: #374151; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #4b5563; }

/* Contact Form Styles */
.form-input {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 12px 16px;
    border-radius: 12px;
    width: 100%;
    transition: all 0.3s ease;
    font-size: 14px;
}

.form-input:focus {
    outline: none;
    border-color: #6366f1;
    background: rgba(30, 41, 59, 0.6);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #e2e8f0;
    font-size: 14px;
}

.form-error {
    color: #ef4444;
    font-size: 12px;
    margin-top: 4px;
    display: none;
}

.form-input.error {
    border-color: #ef4444;
}

.form-input.error + .form-error {
    display: block;
}


/* FAQ Accordion */
.faq-item {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    margin-bottom: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item:hover {
    border-color: rgba(99, 102, 241, 0.3);
}

.faq-question {
    padding: 20px 24px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: white;
    user-select: none;
}

.faq-question:hover {
    background: rgba(99, 102, 241, 0.05);
}

.faq-icon {
    transition: transform 0.3s ease;
    color: #6366f1;
    font-size: 20px;
    min-width: 24px;
}

.faq-item.active .faq-icon {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    color: #cbd5e1;
    line-height: 1.6;
}

.faq-answer-content {
    padding: 0 24px 20px 24px;
}

.faq-item.active .faq-answer {
    max-height: 500px;
}

/* Newsletter Form */
.newsletter-form {
    display: flex;
    gap: 12px;
    max-width: 500px;
    margin: 0 auto;
}

.newsletter-input {
    flex: 1;
}

/* Loading Spinner */
.spinner {
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top: 2px solid white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    animation: spin 0.8s linear infinite;
    display: inline-block;
    margin-left: 8px;
}

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

/* Success Message */
.success-message {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #4ade80;
    padding: 16px;
    border-radius: 12px;
    margin-top: 16px;
    display: none;
    animation: slideIn 0.3s ease;
}

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

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

/* Case Study Cards */
.case-study-card {
    position: relative;
    overflow: hidden;
}

.case-study-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(3, 7, 18, 0.95), transparent);
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.case-study-card:hover .case-study-overlay {
    opacity: 1;
}

/* Mobile Menu Improvements */
@media (max-width: 768px) {
    .newsletter-form {
        flex-direction: column;
    }

    .popup-content {
        padding: 24px;
        margin: 20px;
    }

    .faq-question {
        padding: 16px;
        font-size: 14px;
    }

    .faq-answer-content {
        padding: 0 16px 16px 16px;
        font-size: 14px;
    }
}

/* Improved Focus Styles for Accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

/* Improved Contrast for Better Accessibility */
.text-slate-400 {
    color: #94a3b8 !important;
}

.text-slate-500 {
    color: #64748b !important;
}

/* Video Lazy Loading */
video[data-lazy] {
    background: rgba(30, 41, 59, 0.8);
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

/* Print Styles */
@media print {
    #scroll-progress,
    #back-to-top,
    #exit-popup,
    nav,
    footer {
        display: none;
    }
}
