/**
 * AudioActivationOverlay Styles
 * Full-screen overlay that matches TypeSprout's pixel-art aesthetic
 */

/* Import the Press Start 2P font if not already available */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

/* ---------- OVERLAY CONTAINER ---------- */
.audio-activation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    
    /* TypeSprout blue gradient background */
    background: linear-gradient(180deg, #5d94f1 0%, #4a7bc8 100%);
    
    /* Fullscreen overlay properties */
    display: flex;
    align-items: center;
    justify-content: center;
    
    /* Prevent scrolling behind overlay */
    overflow: hidden;
    
    /* Smooth entrance animation */
    opacity: 1;
    animation: overlay-fade-in 0.6s ease-out;
    
    /* Pixel-perfect rendering */
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    
    /* Prevent text selection */
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    
    /* Ensure overlay blocks all interactions */
    pointer-events: all;
}

/* Hiding animation */
.audio-activation-overlay.hiding {
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.6s ease-in;
}

/* ---------- CONTENT CONTAINER ---------- */
.audio-activation-content {
    background: rgba(255, 255, 255, 0.95);
    border: 4px solid #2b4a80;
    border-radius: 0; /* Keep square corners for pixel aesthetic */
    padding: 40px;
    max-width: 600px;
    width: 90%;
    
    /* Center content and add space */
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 24px;
    
    /* Subtle shadow effect */
    box-shadow: 0 8px 32px rgba(43, 74, 128, 0.3);
    
    /* Entrance animation */
    animation: content-slide-up 0.8s ease-out 0.2s both;
    
    /* Pixel-perfect text rendering */
    text-rendering: geometricPrecision;
}

/* ---------- ICON ---------- */
.audio-activation-icon {
    font-size: clamp(48px, 8vw, 80px);
    line-height: 1;
    margin-bottom: 8px;
    
    /* Subtle glow animation */
    animation: icon-pulse 2s ease-in-out infinite;
}

/* ---------- TITLE ---------- */
.audio-activation-title {
    font-family: 'Press Start 2P', cursive, monospace;
    font-size: clamp(24px, 5vw, 48px);
    color: #2b4a80;
    margin: 0;
    letter-spacing: 2px;
    line-height: 1.2;
    
    /* Subtle text shadow for depth */
    text-shadow: 2px 2px 0 rgba(43, 74, 128, 0.1);
}

/* ---------- MESSAGE ---------- */
.audio-activation-message {
    font-family: 'Press Start 2P', cursive, monospace;
    font-size: clamp(14px, 2.5vw, 20px);
    color: #2b4a80;
    margin: 0;
    line-height: 1.6;
    max-width: 500px;
    
    /* Improved readability */
    font-weight: normal;
}

/* ---------- ACTIVATION BUTTON ---------- */
.audio-activation-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    
    /* Button sizing */
    padding: 20px 32px;
    min-width: 280px;
    min-height: 64px;
    
    /* TypeSprout button styling */
    background: linear-gradient(180deg, #6a9628 0%, #5a7f20 100%);
    border: 4px solid #4a6b1a;
    border-radius: 0;
    color: #fff;
    
    /* Typography */
    font-family: 'Press Start 2P', cursive, monospace;
    font-size: clamp(14px, 2.5vw, 18px);
    
    /* Interaction */
    cursor: pointer;
    transition: all 0.15s ease;
    
    /* Remove default button styles */
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    
    /* Pixel-perfect rendering */
    image-rendering: pixelated;
    text-rendering: geometricPrecision;
    
    /* Subtle entrance animation */
    animation: button-bounce-in 0.6s ease-out 0.6s both;
}

.audio-activation-button:hover {
    background: linear-gradient(180deg, #7aab38 0%, #6a9628 100%);
    transform: translateY(-3px);
    box-shadow: 0 6px 0 #4a6b1a, 0 8px 16px rgba(74, 107, 26, 0.3);
}

.audio-activation-button:active {
    transform: translateY(-1px);
    box-shadow: 0 2px 0 #4a6b1a;
}

.audio-activation-button:focus {
    outline: 3px solid #fff;
    outline-offset: 4px;
}

.audio-activation-button.loading {
    background: linear-gradient(180deg, #5d94f1 0%, #4a7bc8 100%);
    border-color: #2b4a80;
    cursor: wait;
    transform: none;
    box-shadow: none;
}

.audio-activation-button.loading:hover {
    transform: none;
    box-shadow: none;
}

/* Button content */
.audio-activation-button .button-icon {
    font-size: clamp(18px, 3vw, 24px);
    line-height: 1;
}

.audio-activation-button .button-text {
    line-height: 1;
}

/* ---------- NOTE TEXT ---------- */
.audio-activation-note {
    font-family: 'Press Start 2P', cursive, monospace;
    font-size: clamp(10px, 1.8vw, 14px);
    color: rgba(43, 74, 128, 0.7);
    margin: 0;
    line-height: 1.4;
    
    /* Delayed entrance */
    animation: note-fade-in 0.6s ease-out 1s both;
}

/* ---------- ANIMATIONS ---------- */
@keyframes overlay-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes content-slide-up {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes button-bounce-in {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

@keyframes icon-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

/* ---------- MOBILE OPTIMIZATIONS ---------- */
@media (max-width: 768px) {
    .audio-activation-content {
        padding: 32px 24px;
        gap: 20px;
        margin: 20px;
    }
    
    .audio-activation-button {
        min-width: 240px;
        padding: 16px 24px;
        gap: 12px;
    }
    
    .audio-activation-title {
        margin-bottom: 4px;
    }
}

@media (max-width: 480px) {
    .audio-activation-content {
        padding: 24px 20px;
        gap: 16px;
        width: 95%;
    }
    
    .audio-activation-button {
        min-width: 200px;
        padding: 14px 20px;
    }
}

/* ---------- SMALL HEIGHT SCREENS ---------- */
@media (max-height: 600px) {
    .audio-activation-content {
        padding: 20px;
        gap: 16px;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .audio-activation-icon {
        font-size: clamp(32px, 6vw, 48px);
        margin-bottom: 4px;
    }
}

/* ---------- ACCESSIBILITY FEATURES ---------- */
@media (prefers-reduced-motion: reduce) {
    .audio-activation-overlay,
    .audio-activation-content,
    .audio-activation-button,
    .audio-activation-note,
    .audio-activation-icon {
        animation: none;
    }
    
    .audio-activation-button:hover {
        transform: none;
        box-shadow: 0 2px 0 #4a6b1a;
    }
    
    .audio-activation-button:active {
        transform: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .audio-activation-content {
        background: #fff;
        border-width: 6px;
    }
    
    .audio-activation-title,
    .audio-activation-message {
        color: #000;
    }
    
    .audio-activation-button {
        background: #000;
        color: #fff;
        border-color: #000;
    }
    
    .audio-activation-button:hover {
        background: #333;
    }
}

/* ---------- PRINT STYLES ---------- */
@media print {
    .audio-activation-overlay {
        display: none;
    }
}

/* ---------- FOCUS MANAGEMENT ---------- */
.audio-activation-overlay:focus-within .audio-activation-content {
    outline: 3px solid #fff;
    outline-offset: 4px;
}

/* Ensure overlay content is always visible */
.audio-activation-overlay * {
    box-sizing: border-box;
}

/* Prevent unwanted interactions during loading */
.audio-activation-button:disabled {
    cursor: not-allowed;
    opacity: 0.8;
}