/* ============================================
   Performance Optimizations & Accessibility
   ============================================ */

/* Logo Fix - Remove background box */
.logo-img,
.footer .logo-img,
.loader-logo-img img {
    background: transparent !important;
    mix-blend-mode: normal;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Smooth scrolling for all browsers */
html {
    scroll-behavior: smooth;
}

/* Reduce motion for users who prefer it */
@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;
    }
}

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 3px solid var(--neon-cyan);
    outline-offset: 3px;
}

/* Skip to main content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--neon-purple);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 0 0 8px 0;
    z-index: 10000;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

/* Improve text readability */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Loading state for images */
img {
    background: linear-gradient(90deg, rgba(157, 78, 237, 0.1) 0%, rgba(0, 180, 216, 0.1) 100%);
}

img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* Responsive navbar improvements */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        padding: 15px 20px;
        gap: 15px;
    }

    .navbar>div:last-child {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }

    .navbar a {
        width: 100%;
        text-align: center;
        padding: 10px;
    }
}

/* Improved button states */
button,
.btn,
.cta-btn,
.back-btn {
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

button:disabled,
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Better form accessibility */
input:required,
select:required,
textarea:required {
    border-left: 3px solid var(--neon-cyan);
}

input:invalid:not(:placeholder-shown),
select:invalid:not(:placeholder-shown),
textarea:invalid:not(:placeholder-shown) {
    border-color: #ff006e;
}

input:valid:not(:placeholder-shown),
select:valid:not(:placeholder-shown),
textarea:valid:not(:placeholder-shown) {
    border-color: #00f5d4;
}

/* Loading spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--neon-cyan);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Toast notifications */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--bg-card);
    border: 2px solid var(--neon-cyan);
    border-radius: 15px;
    padding: 20px 25px;
    box-shadow: var(--glow-cyan);
    z-index: 9999;
    transform: translateX(400px);
    transition: transform 0.3s ease;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    border-color: #00f5d4;
}

.toast.error {
    border-color: #ff006e;
}

/* Print styles */
@media print {

    .navbar,
    .floating-whatsapp,
    .cta,
    .sound-waves,
    .light-beams {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --neon-purple: #b366ff;
        --neon-cyan: #00ffff;
        --text-white: #ffffff;
        --bg-dark: #000000;
    }
}

/* Improved link accessibility */
a:not([class]) {
    text-decoration-skip-ink: auto;
}

/* Better table accessibility (if needed) */
table {
    border-collapse: collapse;
    width: 100%;
}

th {
    text-align: inherit;
}

/* Improved list accessibility */
ul[role="list"],
ol[role="list"] {
    list-style: none;
}

/* Better video/iframe responsive */
iframe {
    border: 0;
}

/* Improved selection */
::selection {
    background: var(--neon-purple);
    color: white;
}

::-moz-selection {
    background: var(--neon-purple);
    color: white;
}