/**
 * Action Buttons CSS - Medieval Theme
 *
 * Optimized for 8-12 year-old audience with medieval aesthetic
 */

/* Container Styling */
.action-buttons-container {
    display: none;
    flex-direction: column;
    gap: 12px;
    padding: 32px;

    /* Medieval stone background */
    background: linear-gradient(180deg,
        rgba(30, 25, 20, 0.95) 0%,
        rgba(20, 18, 15, 0.95) 100%);

    /* Subtle gold border */
    border: 2px solid rgba(201, 169, 97, 0.4);
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.7),
        inset 0 1px 0 rgba(201, 169, 97, 0.1);

    /* Positioning */
    justify-content: center;
    align-items: center;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;

    /* Shape */
    border-radius: 16px;
    min-width: 340px;

    /* Entrance animation */
    animation: magicalReveal 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Magical reveal animation */
@keyframes magicalReveal {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
        filter: blur(10px) brightness(1.5);
    }
    60% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.05);
        filter: blur(0) brightness(1);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
        filter: blur(0) brightness(1);
    }
}

/* Button Styling */
.action-button {
    /* Sizing - optimized for kids' tap targets */
    padding: 16px 32px;
    min-height: 56px;
    min-width: 240px;

    /* Typography */
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;

    /* Medieval gold gradient */
    background: linear-gradient(135deg, #c9a961 0%, #a57f3e 100%);
    border: 2px solid #d4af6a;
    border-radius: 12px;

    /* Interaction */
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Visual effects */
    box-shadow:
        0 2px 8px rgba(201, 169, 97, 0.3),
        0 0 20px rgba(201, 169, 97, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);

    /* Layout */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;

    /* Idle glow animation */
    animation: gentleGlow 2s ease-in-out infinite;
}

/* Gentle pulsing glow */
@keyframes gentleGlow {
    0%, 100% {
        box-shadow:
            0 2px 8px rgba(201, 169, 97, 0.3),
            0 0 20px rgba(201, 169, 97, 0.1),
            inset 0 1px 0 rgba(255, 255, 255, 0.2);
    }
    50% {
        box-shadow:
            0 4px 12px rgba(201, 169, 97, 0.5),
            0 0 30px rgba(201, 169, 97, 0.25),
            inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }
}

/* Hover State - Reward feeling */
.action-button:hover {
    background: linear-gradient(135deg, #d4ba7d 0%, #b89150 100%);
    border-color: #e5c786;

    box-shadow:
        0 6px 20px rgba(201, 169, 97, 0.6),
        0 0 40px rgba(201, 169, 97, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);

    transform: translateY(-3px) scale(1.02);
}

/* Active/Click State */
.action-button:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow:
        0 2px 4px rgba(201, 169, 97, 0.4),
        0 0 15px rgba(201, 169, 97, 0.2);

    background: linear-gradient(135deg, #b89150 0%, #a57f3e 100%);
}

/* Keyboard Focus State - Accessibility */
.action-button:focus-visible {
    outline: 3px solid #e5c786;
    outline-offset: 4px;
    box-shadow:
        0 0 0 6px rgba(201, 169, 97, 0.2),
        0 4px 16px rgba(201, 169, 97, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* Icon Styling */
.action-button-icon {
    width: 24px;
    height: 24px;
    /* Invert black SVG to white, then apply gold tint */
    filter: brightness(0) invert(1) sepia(1) saturate(3) hue-rotate(5deg) brightness(1.1) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Icon animation on hover */
.action-button:hover .action-button-icon {
    transform: scale(1.15) rotate(5deg);
}

/* Button text */
.action-button-text {
    display: inline-block;
    position: relative;
}

/* Responsive Design - Mobile/Tablet */
@media (max-width: 768px) {
    .action-buttons-container {
        padding: 24px;
        gap: 12px;
        min-width: 300px;
    }

    .action-button {
        padding: 14px 28px;
        font-size: 16px;
        min-height: 52px;
        min-width: 220px;
    }

    .action-button-icon {
        width: 20px;
        height: 20px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .action-buttons-container {
        padding: 20px;
        min-width: 280px;
    }

    .action-button {
        padding: 12px 24px;
        font-size: 15px;
        letter-spacing: 0.5px;
    }
}

/* Accessibility - Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .action-buttons-container,
    .action-button,
    .action-button-icon {
        animation: none !important;
        transition: opacity 0.2s ease, transform 0.2s ease;
    }

    .action-button:hover {
        transform: none;
    }
}

/* Accessibility - High Contrast Mode */
@media (prefers-contrast: high) {
    .action-button {
        border-width: 3px;
        font-weight: 800;
        border-color: #ffffff;
    }

    .action-buttons-container {
        border-width: 3px;
        border-color: rgba(255, 255, 255, 0.6);
    }
}

/* Dark Mode Enhancement */
@media (prefers-color-scheme: dark) {
    .action-button {
        box-shadow:
            0 2px 8px rgba(201, 169, 97, 0.4),
            0 0 25px rgba(201, 169, 97, 0.15),
            inset 0 1px 0 rgba(255, 255, 255, 0.2);
    }
}

/* Success/Click Animation */
@keyframes buttonSuccess {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 50px rgba(201, 169, 97, 0.8);
    }
    100% {
        transform: scale(0.9);
        opacity: 0;
    }
}

/* Apply success animation via JS on click */
.action-button.clicked {
    animation: buttonSuccess 0.4s ease-out forwards;
}
