/* Monty Hall Problem Interactive Tool Styles */

/* ============================================================================
   GAME MENU CUSTOMIZATION (Monty Hall)
   ============================================================================ */
:root {
    --game-primary: #10b981;
    --game-primary-dark: #059669;
    --game-secondary: #fbbf24;
}

body {
    position: relative;
    background: #121212;
    min-height: 100vh;
    color: #fff;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('images/background.png') center center / cover no-repeat fixed;
    opacity: 0.5;
    z-index: -2;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(18, 18, 18, 0.4) 0%, rgba(18, 18, 18, 0.85) 100%);
    z-index: -1;
}

body.game-menu-active {
    --menu-bg-image: url('/interactive/shared/backgrounds/montyhall.png');
}

/* ============================================================================
   GAME-SPECIFIC STYLES
   ============================================================================ */

.monty-hall-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
    font-family: 'Rockwell', serif;
}

.monty-hall-container h1 {
    text-align: center;
    color: #ffffff;
    margin-bottom: 1rem;
    font-size: 2.5rem;
}

.monty-hall-container h1 i {
    margin-right: 0.5rem;
    color: var(--secondary);
}

.explanation {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    border-left: 4px solid var(--primary);
    text-align: center;
    font-size: 1.1rem;
    line-height: 1.6;
    color: #1f2933;
}
.explanation p {
    color: #1f2933;
}

.game-area {
    background: rgba(255, 255, 255, 0.92);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.doors-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
    margin-bottom: 2rem;
    padding: 2.5rem;
    border-radius: 12px;
    position: relative;
    background: url('images/wall.png') center center / cover no-repeat;
    box-shadow: inset 0 6px 20px rgba(0, 0, 0, 0.25);
}


.door-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

.door-number {
    font-size: 1.4rem;
    font-weight: 700;
    color: #111827;
    background: rgba(255, 255, 255, 0.9);
    padding: 0.35rem 1.1rem;
    border-radius: 20px;
    border: 2px solid rgba(17, 24, 39, 0.65);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
    letter-spacing: 0.04em;
}

.door {
    position: relative;
    width: 150px;
    height: 200px;
    perspective: 1000px;
    cursor: pointer;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.35));
    margin: 0 auto;
}

.door::before {
    content: '';
    position: absolute;
    top: -12px;
    left: -12px;
    right: -12px;
    bottom: -12px;
    border-radius: 16px;
    box-shadow: 0 0 25px rgba(255, 198, 93, 0.4), 0 0 45px rgba(255, 198, 93, 0.2);
    opacity: 0.75;
    transition: opacity 0.3s ease, box-shadow 0.3s ease;
    z-index: 0;
}

.door::after {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: 12px;
    border: 3px solid rgba(255, 255, 255, 0.75);
    opacity: 0.8;
    transition: opacity 0.3s ease;
    z-index: 1;
    pointer-events: none;
}

.door:hover::before,
.door.selected::before {
    opacity: 1;
    box-shadow: 0 0 30px rgba(255, 210, 120, 0.65), 0 0 60px rgba(255, 210, 120, 0.35);
}

.door:hover::after,
.door.selected::after {
    opacity: 1;
}

.door:hover {
    transform: scale(1.05);
}

.door-front {
    position: absolute;
    width: 100%;
    height: 100%;
    background: url('images/door.png') center center / cover no-repeat;
    border: none;
    border-radius: 8px;
    box-shadow: 
        0 8px 16px rgba(0, 0, 0, 0.35),
        inset 0 2px 4px rgba(255, 255, 255, 0.08),
        inset 0 -4px 8px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transform: rotateY(0deg);
    backface-visibility: hidden;
    z-index: 2;
}

/* Room space behind the door */
.room-space {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px;
    overflow: visible;
    z-index: 1;
}

/* Room scenes behind doors */
.room-scene {
    width: 100%;
    height: 100%;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(12, 12, 12, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.prize-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

.door-handle {
    display: none;
}

.prize {
    font-size: 4rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.prize.car {
    color: #007bff;
}

.prize.goat {
    color: #6c757d;
}


/* Door animations - rotate 95° to reveal room behind */
.door.open .door-front {
    transform: rotateY(-95deg);
    transform-origin: left center;
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 3px solid #000;
}

/* Smooth door opening animation */
.door.opening .door-front {
    transform: rotateY(-95deg);
    transform-origin: left center;
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.door.selected .door-front {
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(201, 12, 15, 0.5);
}

.door.revealed .door-front {
    background: url('images/door.png') center center / cover no-repeat;
}

.door.winning .door-front {
    background: url('images/door.png') center center / cover no-repeat;
    transform: rotateY(-95deg);
    transform-origin: left center;
}

.door.losing .door-front {
    background: url('images/door.png') center center / cover no-repeat;
    transform: rotateY(-95deg);
    transform-origin: left center;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.game-controls {
    text-align: center;
}

.game-phase h3 {
    color: var(--primary);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Rockwell', serif;
    text-transform: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: #a00a0c;
}

.btn-secondary {
    background: var(--secondary);
    color: var(--dark);
}

.btn-secondary:hover {
    background: #e6a517;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.statistics {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.stats-header h3 {
    color: var(--primary);
    margin: 0;
    font-size: 1.5rem;
}

.stats-buttons {
    display: flex;
    gap: 0.5rem;
}

.auto-run-progress {
    margin-bottom: 1rem;
    padding: 1rem;
    background: #e9ecef;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #dee2e6;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #007bff, #0056b3);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 10px;
}

.progress-text {
    text-align: center;
    font-weight: 500;
    color: #495057;
}

.statistics h3 {
    color: var(--primary);
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.stat-item {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.stat-label {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
}

.theory {
    background: linear-gradient(135deg, #e3f2fd, #f3e5f5);
    padding: 2rem;
    border-radius: 12px;
    border-left: 4px solid var(--secondary);
}

.theory h3 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.theory p {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #333;
    margin: 0;
}

/* Responsive design */
@media (max-width: 768px) {
    .monty-hall-container {
        padding: 1rem;
    }
    
    .monty-hall-container h1 {
        font-size: 2rem;
    }
    
    .doors-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
        padding: 2rem 1rem;
    }
    
    .door {
        width: 120px;
        height: 160px;
    }
    
    .door-number {
        font-size: 1.5rem;
    }
    
    .prize {
        font-size: 3rem;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .doors-container {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
    }
    
    .door {
        width: 100px;
        height: 140px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Animation for door opening */
.door-opening {
    animation: doorOpen 0.8s ease-in-out;
}

@keyframes doorOpen {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(-90deg); }
}

/* Animation for prize reveal */
.prize-reveal {
    animation: prizeReveal 0.5s ease-in-out;
}

@keyframes prizeReveal {
    0% { 
        opacity: 0;
        transform: scale(0.5);
    }
    100% { 
        opacity: 1;
        transform: scale(1);
    }
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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