/* LA-Slots - Main Stylesheet */

/* Vegas Logo Styles */
.vegas-logo-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 120px; /* Reserve vertical space for the logo */
    display: flex; /* Enable bottom alignment */
    align-items: flex-end; /* Bottom-align the logo */
    justify-content: center; /* Center horizontally */
    z-index: 999; /* Below the admin panel but above other elements */
    pointer-events: none; /* Allow clicks to pass through to elements below */
}

.vegas-logo {
    max-width: 7.5%; /* Make the logo 50% smaller */
    height: auto;
    display: inline-block;
    margin-bottom: -80px; /* Create more overlap with the slot machine */
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5)); /* Add a glow effect */
}

/* Position the slot machine to accommodate the logo */
.slot-machine {
    margin-top: 120px; /* Add margin to push the slot machine down */
    position: relative;
    z-index: 100; /* Lower than the logo */
}

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #121212;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    transition: background-color 0.5s ease;
}

/* Red background for bonus events */
body.bonus-active {
    background-color: #ff0000;
}

.game-container {
    display: flex;
    flex-direction: row;
    gap: 20px;
    max-width: 1200px;
    width: 100%;
}

/* Slot Machine Styles */
.slot-machine {
    background-color: #333;
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(255, 0, 255, 0.4);
    padding: 20px;
    width: 60%;
    display: flex;
    flex-direction: column;
    border: 5px solid #ffd700;
    position: relative;
    overflow: hidden;
    background-image: linear-gradient(to bottom, #444, #222);
}

.slot-decorations {
    position: absolute;
    width: 20px;
    height: 100%;
    background: linear-gradient(to bottom, #ffd700, #cc9900);
    z-index: 5;
}

.slot-decorations.left {
    left: 0;
    border-right: 2px solid #cc9900;
}

.slot-decorations.right {
    right: 0;
    border-left: 2px solid #cc9900;
}

.machine-top {
    background: linear-gradient(to right, #ff00ff, #cc00cc);
    color: white;
    padding: 15px;
    text-align: center;
    border-radius: 5px 5px 0 0;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.machine-name {
    font-size: 28px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    color: #ffd700;
    z-index: 2;
    position: relative;
}

.floating-diamonds {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.8) 2px, transparent 3px),
        radial-gradient(circle at 40% 70%, rgba(255, 255, 255, 0.8) 3px, transparent 4px),
        radial-gradient(circle at 60% 40%, rgba(255, 255, 255, 0.8) 2px, transparent 3px),
        radial-gradient(circle at 80% 60%, rgba(255, 255, 255, 0.8) 4px, transparent 5px),
        radial-gradient(circle at 90% 20%, rgba(255, 255, 255, 0.8) 3px, transparent 4px),
        radial-gradient(circle at 10% 80%, rgba(255, 255, 255, 0.8) 2px, transparent 3px),
        radial-gradient(circle at 30% 50%, rgba(255, 255, 255, 0.8) 3px, transparent 4px),
        radial-gradient(circle at 70% 90%, rgba(255, 255, 255, 0.8) 2px, transparent 3px);
    opacity: 0.7;
    z-index: 1;
    animation: float-diamonds 15s linear infinite;
}

@keyframes float-diamonds {
    0% {
        background-position: 0% 0%, 20% 20%, 40% 40%, 60% 60%, 80% 80%, 100% 100%, 0% 100%, 100% 0%;
    }
    100% {
        background-position: 100% 100%, 0% 100%, 100% 0%, 0% 0%, 20% 20%, 40% 40%, 60% 60%, 80% 80%;
    }
}

.machine-frame {
    background-color: #222;
    border: 8px solid #ffd700;
    border-radius: 10px;
    padding: 15px;
    position: relative;
    margin-bottom: 20px;
    max-height: 500px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.winning-line {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    transform: translateY(-50%);
    z-index: 110;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    pointer-events: none;
}

.winning-line span {
    background-color: #0066cc;
    color: white;
    font-size: 12px;
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 3px;
    margin-left: -5px;
    box-shadow: 0 0 5px rgba(0, 102, 204, 0.8);
}

.reels-container {
    display: flex;
    justify-content: space-between;
    background-color: #222;
    padding: 10px;
    border-radius: 5px;
    height: 200px;
    position: relative;
    overflow: hidden;
    margin-bottom: 15px;
}

.reel {
    width: 32%;
    background-color: white;
    border: 5px solid #ffd700;
    border-radius: 5px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3), 0 0 15px rgba(255, 215, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

/* New class for the reel display container */
.reel-display {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex !important;
    justify-content: center;
    align-items: center;
    z-index: 40;
    pointer-events: none;
    background-color: white;
    visibility: visible !important;
    opacity: 1 !important;
}

.reel-display img {
    display: block !important;
    width: 80%;
    height: auto;
    margin: auto;
    position: relative;
    z-index: 45;
    background-color: white;
    padding: 5px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    visibility: visible !important;
    opacity: 1 !important;
}

.spin-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    display: none;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    z-index: 50;
    opacity: 1;
    visibility: visible;
    pointer-events: none;
    transition: opacity 0.3s ease;
    overflow: hidden;
}

.spin-overlay img {
    width: 80%;
    height: auto;
    object-fit: contain;
    margin: 5px 0;
    animation: spin-scroll 0.3s linear infinite;
}

.symbol-strip {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    animation: spin-scroll 0.3s linear infinite;
    top: 0;
    left: 0;
    height: auto;
    background-color: white;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        text-shadow: 0 0 10px #ffd700;
    }
    100% {
        transform: scale(1.1);
        text-shadow: 0 0 20px #ffd700, 0 0 30px #ffd700;
    }
}

.reel-strip {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2000%;
    display: flex;
    flex-direction: column;
    transition: transform 0.1s linear;
}

.symbol-container {
    width: 100%;
    height: 100%;
    display: flex !important;
    justify-content: center;
    align-items: center;
    background-color: white;
    padding: 5px;
    box-sizing: border-box;
    opacity: 1 !important;
    z-index: 20;
    position: relative;
    visibility: visible !important;
}

/* Style for the main symbol containers (the ones directly in the reels) */
.reel > .symbol-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20;
    display: flex !important;
    justify-content: center;
    align-items: center;
    background-color: white;
    visibility: visible !important;
    opacity: 1 !important;
}

.symbol-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 5px;
    display: block !important;
    position: relative;
    z-index: 25;
    visibility: visible !important;
    opacity: 1 !important;
    background-color: white;
    padding: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

/* Style for the main symbol images (the ones directly in the reels) */
.reel > .symbol-container > .symbol-image {
    z-index: 25;
    width: 80%;
    height: auto;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    background-color: white;
    padding: 5px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    border: 2px solid #ffd700;
}

.symbol-image-small {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 5px;
}

.machine-info {
    background-color: #222;
    border-radius: 5px;
    padding: 10px;
}

.info-display {
    display: flex;
    justify-content: space-between;
    color: #ffd700;
    font-weight: bold;
}

.info-label {
    font-size: 16px;
    display: block;
    margin-bottom: 5px;
}

.info-value {
    font-size: 20px;
    color: #ffcc00;
    text-shadow: 0 0 5px rgba(255, 204, 0, 0.5);
}

.machine-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
    margin-bottom: 20px;
}

.control-panel {
    display: flex;
    justify-content: space-between;
    width: 100%;
    gap: 10px;
}

.bet-button {
    background-color: #cc0000;
    color: white;
    border: 3px solid #990000;
    border-radius: 8px;
    padding: 10px 15px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 0 #990000, 0 0 10px rgba(204, 0, 0, 0.5);
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
    z-index: 100;
    position: relative;
    letter-spacing: 1px;
    flex: 1;
}

.bet-button:hover {
    background-color: #dd0000;
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #990000, 0 0 15px rgba(204, 0, 0, 0.7);
}

.bet-button:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #990000, 0 0 5px rgba(204, 0, 0, 0.3);
}

.spin-button {
    background-color: #00cc66;
    color: white;
    border: 3px solid #009933;
    border-radius: 8px;
    padding: 15px 40px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 0 #009933, 0 0 10px rgba(0, 204, 102, 0.5);
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
    z-index: 100;
    position: relative;
    letter-spacing: 2px;
    flex: 2;
}

.spin-button:hover {
    background-color: #00dd77;
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #009933, 0 0 15px rgba(0, 204, 102, 0.7);
}

.spin-button:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #009933, 0 0 5px rgba(0, 204, 102, 0.3);
}

.spin-button:disabled, .bet-button:disabled {
    background-color: #666;
    box-shadow: 0 4px 0 #444;
    cursor: not-allowed;
}

.status-message {
    font-size: 26px;
    height: 24px;
    padding-top: 10px;
    text-align: center;
    color: #ffcc00;
    text-shadow: 0 0 5px rgba(255, 204, 0, 0.5);
}

/* Symbols Panel Styles */
.symbols-panel {
    background-color: #1a1a1a;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(255, 0, 255, 0.3);
    padding: 10px;
    width: 20%;
    border: 3px solid #ffd700;
}

.left-panel {
    border-right: none;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.right-panel {
    border-left: none;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.symbols-panel h3 {
    color: #ffd700;
    text-align: center;
    margin-bottom: 15px;
    font-size: 18px;
    border-bottom: 1px solid #ffd700;
    padding-bottom: 10px;
}

.symbols-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    max-height: 500px;
    overflow-y: auto;
}

.symbol {
    width: 50px;
    height: 50px;
    background-color: white;
    border: 2px solid #ffd700;
    border-radius: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    padding: 2px;
}

/* Animation Classes */
@keyframes spin {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-1800px);
    }
}

@keyframes spin-blur {
    0%, 100% {
        filter: blur(0);
    }
    50% {
        filter: blur(3px);
    }
}

@keyframes spin-scroll {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-100%);
    }
}

/* Animation for the spinning symbols */
.symbol-strip {
    animation: spin-scroll 0.5s linear infinite;
}

@keyframes spin-glow {
    0%, 100% {
        box-shadow: inset 0 0 10px rgba(255, 215, 0, 0.3);
    }
    50% {
        box-shadow: inset 0 0 20px rgba(255, 215, 0, 0.7);
    }
}

.spinning {
    animation: 
        spin 0.5s linear infinite,
        spin-blur 0.2s ease-in-out infinite,
        spin-glow 0.2s ease-in-out infinite;
}

#reel1 .spinning {
    animation-duration: 0.5s, 0.2s, 0.2s;
}

#reel2 .spinning {
    animation-duration: 0.6s, 0.2s, 0.2s;
}

#reel3 .spinning {
    animation-duration: 0.7s, 0.2s, 0.2s;
}

@keyframes flash {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

.bonus-flash {
    animation: flash 0.5s ease-in-out infinite;
    background-color: #ffcc00;
    box-shadow: 0 0 15px #ffcc00;
}

/* Winner highlight animation */
@keyframes winner-highlight {
    0% { box-shadow: 0 0 10px 5px rgba(255, 0, 0, 0.7); }
    50% { box-shadow: 0 0 20px 10px rgba(255, 0, 0, 0.9); }
    100% { box-shadow: 0 0 10px 5px rgba(255, 0, 0, 0.7); }
}

.winner-highlight {
    animation: winner-highlight 1s infinite;
    border: 3px solid #ff0000 !important;
}

/* Responsive Styles */
@media (max-width: 992px) {
    .game-container {
        flex-direction: column;
    }
    
    .slot-machine, .symbols-panel {
        width: 100%;
    }
    
    .left-panel, .right-panel {
        border: 3px solid #ffd700;
        border-radius: 10px;
        margin-bottom: 20px;
    }
    
    .reels-container {
        height: 250px;
    }
}

@media (max-width: 576px) {
    .reels-container {
        height: 200px;
    }
    
    .symbol-container {
        font-size: 36px;
    }
    
    .machine-name {
        font-size: 24px;
    }
    
    .spin-button {
        padding: 12px 30px;
        font-size: 18px;
    }
}

/* Shadowbox Styles */
.shadowbox {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.shadowbox.active {
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.shadowbox-content {
    position: relative;
    background-color: #333;
    margin: auto;
    padding: 20px;
    border: 5px solid #ffd700;
    border-radius: 10px;
    width: auto;
    max-width: 90%;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
    animation: scaleIn 0.3s ease-in-out;
}

@keyframes scaleIn {
    from { transform: scale(0.9); }
    to { transform: scale(1); }
}

.shadowbox-image {
    display: block;
    max-width: 100%;
    max-height: 90vh;
    margin: 0 auto;
    border-radius: 5px;
}

.shadowbox-text {
    position: absolute;
    top: 0px; /* Changed from 100px to 0px */
    left: 0px; /* Changed from 100px to 0px */
    color: #ff0000;
    font-size: 36px;
    font-weight: 900; /* Extra bold */
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    z-index: 1010;
    background-color: transparent; /* Changed from black to transparent */
    padding: 15px; /* Reduced from 30px to 15px */
    border-radius: 10px; /* Rounded corners */
    box-shadow: none; /* Removed shadow */
}

/* Name label for symbol popups */
.symbol-name-label {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #000000;
    color: #ffffff;
    font-size: 32px;
    font-weight: bold;
    text-align: center;
    padding: 10px 0;
    z-index: 1010;
}

/* Pulse animation for WINNER and RESPIN text */
.shadowbox-text.pulsing img {
    animation: pulse-animation 0.7s ease-in-out 3; /* Run exactly 3 times */
    transform-origin: center;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
}

@keyframes pulse-animation {
    0% {
        transform: scale(1);
        filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
    }
    50% {
        transform: scale(1.15); /* Grow by 15% */
        filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.9));
    }
    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
    }
}

/* Legacy flashing animation (keeping for backward compatibility) */
.shadowbox-text.flashing {
    animation: text-flash 0.5s ease-in-out 5; /* Run 5 times */
}

@keyframes text-flash {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
}

.close-button {
    position: absolute;
    top: 10px;
    right: 15px;
    color: #ffd700;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.close-button:hover {
    color: #ffcc00;
    transform: scale(1.2);
    text-shadow: 0 0 10px rgba(255, 204, 0, 0.8);
}

/* Screen Flash Effect */
.screen-flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 0, 0, 0.5);
    z-index: 999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.screen-flash.active {
    animation: flash-animation 0.6s ease-in-out;
}

@keyframes flash-animation {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

/* Confetti Container */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1020; /* Higher than shadowbox and shadowbox-text */
    display: none;
}

.confetti-container.active {
    display: block;
}

/* Confetti Pieces */
.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: #ffd700;
    opacity: 0.8;
    animation: confetti-fall 4s ease-in-out forwards;
}

/* Generate 50 confetti pieces with different colors and animations */
@keyframes confetti-fall {
    0% {
        transform: translateY(-10px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Different colors for confetti */
.confetti:nth-child(5n+1) { background-color: #ff0000; }
.confetti:nth-child(5n+2) { background-color: #00ff00; }
.confetti:nth-child(5n+3) { background-color: #0000ff; }
.confetti:nth-child(5n+4) { background-color: #ffff00; }
.confetti:nth-child(5n+5) { background-color: #00ffff; }

/* Different shapes for confetti */
.confetti:nth-child(3n+1) { border-radius: 50%; }
.confetti:nth-child(3n+2) { transform: rotate(45deg); }
.confetti:nth-child(3n+3) { width: 5px; height: 15px; }

/* Make symbols clickable */
.symbol {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.symbol:hover {
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.7);
}
