/* ==========================================================================
   Random Number Generator - Playful Emerald Theme Styles
   ========================================================================== */

/* Header title white on emerald */
.calculator-wrapper h1 {
    color: #ffffff;
}

/* Calculator wrapper - relative for sparkle effects */
.calculator-wrapper {
    position: relative;
    overflow: hidden;
}

/* Button icon styling */
.btn-icon {
    display: inline-block;
    font-size: 1.25rem;
    margin-right: 4px;
}

/* ==========================================================================
   Mode Sections
   ========================================================================== */
.mode-section {
    transition: opacity 0.3s ease, max-height 0.3s ease;
}

.mode-section.hidden {
    display: none;
}

/* ==========================================================================
   Checkbox Styling
   ========================================================================== */
.checkbox-group {
    margin-top: 8px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 15px;
    color: var(--color-text-primary);
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkbox-custom {
    width: 22px;
    height: 22px;
    border: 2px solid var(--color-border);
    border-radius: 4px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.checkbox-custom::after {
    content: "";
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    transition: transform 0.2s ease;
}

.checkbox-label input:checked + .checkbox-custom {
    background: var(--color-primary);
    border-color: var(--color-primary);
}

.checkbox-label input:checked + .checkbox-custom::after {
    transform: rotate(45deg) scale(1);
}

.checkbox-label:hover .checkbox-custom {
    border-color: var(--color-primary);
}

.checkbox-text {
    line-height: 1.4;
}

/* ==========================================================================
   Results Section
   ========================================================================== */
.random-results {
    margin-top: 24px;
    padding: 24px;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 50%, #a7f3d0 100%);
    border-radius: 16px;
    border: 2px solid #34d399;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.random-results::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 40%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 60%
    );
    animation: shimmer 3s infinite linear;
    pointer-events: none;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

.random-results.hidden {
    display: none;
}

/* ==========================================================================
   Primary Result Display
   ========================================================================== */
.result-display {
    margin-bottom: 16px;
}

.result-number {
    font-size: 4rem;
    font-weight: 700;
    color: #059669;
    line-height: 1;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(5, 150, 105, 0.2);
    animation: popIn 0.5s ease-out;
}

@keyframes popIn {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.result-label {
    font-size: 1rem;
    color: #047857;
    font-weight: 500;
}

/* ==========================================================================
   Multiple Results Grid
   ========================================================================== */
.multi-results {
    margin-top: 16px;
}

.multi-results.hidden {
    display: none;
}

.multi-results-label {
    font-size: 1rem;
    color: #047857;
    font-weight: 600;
    margin-bottom: 12px;
}

.multi-results-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.multi-result-item {
    background: white;
    border: 2px solid #34d399;
    border-radius: 12px;
    padding: 12px 18px;
    font-size: 1.25rem;
    font-weight: 600;
    color: #059669;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
    animation: fadeInUp 0.3s ease-out forwards;
    opacity: 0;
}

@keyframes fadeInUp {
    0% {
        transform: translateY(10px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ==========================================================================
   Dice Results
   ========================================================================== */
.dice-results {
    margin-top: 16px;
}

.dice-results.hidden {
    display: none;
}

.dice-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
}

.dice {
    width: 60px;
    height: 60px;
    background: linear-gradient(145deg, #ffffff 0%, #f0f0f0 100%);
    border: 2px solid #34d399;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 700;
    color: #059669;
    box-shadow:
        0 4px 8px rgba(0, 0, 0, 0.1),
        inset 0 -2px 4px rgba(0, 0, 0, 0.05);
    animation: rollIn 0.6s ease-out forwards;
    opacity: 0;
}

@keyframes rollIn {
    0% {
        transform: rotate(-180deg) scale(0);
        opacity: 0;
    }
    60% {
        transform: rotate(20deg) scale(1.1);
    }
    100% {
        transform: rotate(0) scale(1);
        opacity: 1;
    }
}

.dice-total {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: white;
    border-radius: 25px;
    display: inline-flex;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
}

.dice-total-label {
    font-size: 1rem;
    color: #047857;
    font-weight: 500;
}

.dice-total-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #059669;
}

/* ==========================================================================
   Coin Flip Results
   ========================================================================== */
.coin-results {
    margin-top: 16px;
}

.coin-results.hidden {
    display: none;
}

.coin-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
}

.coin {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    box-shadow:
        0 4px 8px rgba(0, 0, 0, 0.15),
        inset 0 -2px 4px rgba(0, 0, 0, 0.1);
    animation: flipIn 0.6s ease-out forwards;
    opacity: 0;
}

.coin.heads {
    background: linear-gradient(145deg, #fef3c7 0%, #fcd34d 100%);
    border: 3px solid #f59e0b;
    color: #b45309;
}

.coin.tails {
    background: linear-gradient(145deg, #e0e7ff 0%, #a5b4fc 100%);
    border: 3px solid #6366f1;
    color: #4338ca;
}

@keyframes flipIn {
    0% {
        transform: rotateY(0) scale(0.5);
        opacity: 0;
    }
    50% {
        transform: rotateY(180deg) scale(1.1);
    }
    100% {
        transform: rotateY(360deg) scale(1);
        opacity: 1;
    }
}

.coin-summary {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 12px 20px;
    background: white;
    border-radius: 25px;
    display: inline-flex;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
}

.coin-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

.coin-stat.heads-stat {
    color: #b45309;
}

.coin-stat.tails-stat {
    color: #4338ca;
}

/* ==========================================================================
   Action Buttons
   ========================================================================== */
.result-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
    position: relative;
    z-index: 1;
}

.generate-again-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    background: #059669;
    color: white;
}

.generate-again-button:hover {
    background: #047857;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.4);
}

.share-trigger-btn {
    background: white;
    color: #059669;
    border: 2px solid #059669;
}

.share-trigger-btn:hover {
    background: #ecfdf5;
    transform: translateY(-2px);
}

/* ==========================================================================
   Sparkle Effects
   ========================================================================== */
.sparkle-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 10;
}

.sparkle {
    position: absolute;
    font-size: 20px;
    opacity: 0;
    animation: sparkle 1.5s ease-out forwards;
}

@keyframes sparkle {
    0% {
        opacity: 1;
        transform: translateY(0) scale(0) rotate(0deg);
    }
    50% {
        opacity: 1;
        transform: translateY(-50px) scale(1) rotate(180deg);
    }
    100% {
        opacity: 0;
        transform: translateY(-100px) scale(0.5) rotate(360deg);
    }
}

/* ==========================================================================
   FAQ Section (Random Theme Accordion)
   ========================================================================== */
.random-faq-section {
    margin-top: 32px;
    padding: 24px 20px;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 50%, #ecfdf5 100%);
    border-radius: 20px;
    border: 2px solid #86efac;
}

.random-faq-section h2 {
    text-align: center;
    color: #059669;
    font-size: 1.5rem;
    margin-bottom: 20px;
    font-weight: 600;
}

/* Override base FAQ styles for random theme */
.random-faq-section .faq-list {
    gap: 12px;
}

.random-faq-section .faq-item {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.1);
    border: 1px solid #a7f3d0;
    transition: all 0.3s ease;
    overflow: hidden;
}

.random-faq-section .faq-item[open] {
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.15);
}

.random-faq-section .faq-question {
    padding: 16px 20px;
    color: #059669;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.random-faq-section .faq-question::after {
    border-color: #059669;
}

.random-faq-section .faq-question:hover {
    background: rgba(16, 185, 129, 0.05);
}

.random-faq-section .faq-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.random-faq-section .faq-answer {
    padding: 0 20px 16px;
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
}

.random-faq-section .faq-answer p {
    margin: 0 0 12px 0;
}

.random-faq-section .faq-answer p:last-child {
    margin-bottom: 0;
}

.random-faq-section .faq-answer ul {
    list-style: none;
    padding: 0;
    margin: 12px 0;
}

.random-faq-section .faq-answer ul li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 8px;
}

.random-faq-section .faq-answer ul li::before {
    content: "";
    position: absolute;
    left: 6px;
    top: 8px;
    width: 6px;
    height: 6px;
    background: #34d399;
    border-radius: 50%;
}

/* Disclaimer at bottom */
.random-disclaimer {
    margin-top: 28px;
    padding: 16px 20px;
    background: white;
    border-radius: 30px;
    text-align: center;
    color: #888;
    font-size: 0.9rem;
    line-height: 1.6;
    border: 2px dashed #86efac;
}

.random-disclaimer span {
    color: #10b981;
}

/* ==========================================================================
   Generate Button Animation
   ========================================================================== */
.calculate-button {
    position: relative;
    overflow: hidden;
}

.calculate-button::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.calculate-button:active::after {
    width: 300px;
    height: 300px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 480px) {
    .result-number {
        font-size: 3rem;
    }

    .dice {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }

    .coin {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }

    .multi-result-item {
        padding: 10px 14px;
        font-size: 1.1rem;
    }

    .result-actions {
        flex-direction: column;
        align-items: center;
    }

    .generate-again-button,
    .share-trigger-btn {
        width: 100%;
        max-width: 240px;
        justify-content: center;
    }

    /* FAQ mobile */
    .random-faq-section {
        padding: 24px 16px;
        border-radius: 16px;
    }

    .random-faq-section h2 {
        font-size: 1.25rem;
    }

    .random-disclaimer {
        padding: 14px 16px;
        font-size: 0.85rem;
        border-radius: 20px;
    }
}
