/* VPBank Solution Day Game - Game Styles */

/* Game Page Base */
body.game-page {
    font-family: 'Arial', sans-serif;
    background: #000;
    color: white;
    min-height: 100vh;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

/* Registration page background */
body:not(.game-page) {
    background: #000;
}

/* Desktop Container with Full Background */
.desktop-container {
    width: 100vw;
    height: 100vh;
    background: url('../images/background-1.png') center/contain no-repeat;
    background-color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1;
}

/* Game page background */
.game-page .desktop-container {
    background: url('../images/background-2.png') center/contain no-repeat;
    background-color: #000;
}

.mobile-frame {
    width: 360px;
    height: 100vh;
    background: transparent;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    max-width: 100vw;
}

/* Mobile Responsive - Fullscreen */
@media (max-width: 768px) {
    .desktop-container {
        position: relative;
        background: url('../images/background-1.png') center/contain no-repeat,
            url('../images/background.png') center/cover no-repeat;
        background-color: #000;
    }

    .game-page .desktop-container {
        background: url('../images/background-2.png') center/contain no-repeat,
            url('../images/background.png') center/cover no-repeat;
        background-color: #000;
    }

    .mobile-frame {
        width: 100vw;
        height: 100vh;
        max-width: none;
        background: transparent;
    }
}

/* Game Content */
.game-content,
.container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    gap: 16px;
    margin-top: 30%;
    position: relative;
    z-index: 2;
}

.form-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Registration Form */
.registration-form {
    width: 100%;
    max-width: 300px;
    margin: 12px auto 0;
}

/* Form Group Structure */
.form-group {
    margin-bottom: 16px;
    position: relative;
}

.form-group > label {
    font-family: 'Gilroy Bold', 'Segoe UI', sans-serif;
    font-size: 20px;
    font-weight: bold;
    background: linear-gradient(to bottom, #ffffff 0%, #ffffff 55%, #cbf0f8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* Input Field Styling */
.form-group .input {
    width: 100%;
    height: 46px;
    padding: 0 20px;
    border: 3px solid transparent;
    background: linear-gradient(white, white) padding-box,
        linear-gradient(90deg, #0b66cf 0%, #02d15e 100%) border-box;
    color: #333;
    font-size: 16px;
    font-weight: 500;
    outline: none;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    border-radius: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Autofill Fix - Maintain gradient border */
.form-group .input:-webkit-autofill,
.form-group .input:-webkit-autofill:hover,
.form-group .input:-webkit-autofill:active,
.form-group .input:-moz-autofill,
.form-group .input:-internal-autofill-selected,
.form-group .input:autofill {
    -webkit-box-shadow: 0 0 0 1000px white inset !important;
    -webkit-text-fill-color: #333 !important;
    -moz-text-fill-color: #333 !important;
    background: linear-gradient(white, white) padding-box,
        linear-gradient(90deg, #0b66cf 0%, #02d15e 100%) border-box !important;
    border: 3px solid transparent !important;
    border-radius: 25px !important;
    color: #333 !important;
}

/* Join Button */
.join-button {
    width: 140px;
    height: auto;
    background: none;
    border: none;
    cursor: pointer;
    margin-top: 20px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.join-button img {
    width: 100%;
    height: auto;
    display: block;
}

/* Game Page Specific Styles */

/* Instructions */
.instructions {
    text-align: center;
    margin: 0;
    padding: 0 20px;
}
.scan-image-btn {
    display: block;
    width: 260px;
    max-width: 80%;
    height: auto;
    margin: 14px auto 0;
    cursor: pointer;
}

/* Action buttons row (image-based) */
.action-image-buttons {
    display: flex;
    width: 100%;
    gap: 16px;
    align-items: center;
    justify-content: space-evenly; /* Default: space-evenly for 2 buttons */
    margin-top: 0;
}

/* Hide claim button by default; JS will show when eligible */
#claimRewardBtn {
    display: none;
}

/* When only scan button is visible, center it */
.action-image-buttons[style*='justify-content: center'] {
    justify-content: center !important;
}

.action-image-btn {
    display: block;
    width: 120px;
    height: auto;
    cursor: pointer;
}

.instructions p {
    font-family: 'Gilroy Regular', 'Gilroy', 'Segoe UI', sans-serif;
    font-size: 12px;
    line-height: 1.4;
    color: #ffffff;
    margin: 0;
    font-weight: 400;
}

.instructions p strong {
    font-family: 'Gilroy Bold', 'Gilroy', 'Segoe UI', sans-serif;
    font-weight: 700;
}

/* Station checklist */
.station-checklist {
    list-style: none;
    padding: 0 20px;
    margin: 0 auto;
    width: 100%;
    max-width: 360px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.station-checklist-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.station-checklist-item .status-icon {
    width: 42px;
    height: 42px;
}

.station-text {
    display: flex;
    flex-direction: column;
}

.station-title {
    margin: 0;
    font-family: 'Gilroy Bold', 'Gilroy', 'Segoe UI', sans-serif;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.2px;
    color: #ffffff;
}

.station-desc {
    margin: 0;
    font-family: 'Gilroy Regular', 'Gilroy', 'Segoe UI', sans-serif;
    font-weight: 400;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.4;
}

/* Stations Container */
.stations-container {
    width: 100%;
    max-width: 360px;
    margin-bottom: 28px;
}

.stations-list {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.station-item {
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 14px;
}

.station-item::before {
    content: '';
    width: 56px;
    height: 56px;
    min-width: 56px;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(0, 0, 0, 0) 70%, rgba(0, 0, 0, 0) 72%),
        conic-gradient(from 0deg, #00ff95, #85ff3b, #00e06d, #00ff95);
    box-shadow: 0 0 12px rgba(0, 255, 149, 0.8), 0 0 24px rgba(0, 255, 149, 0.4) inset;
}

.station-info {
    flex: 1;
}

.station-name {
    font-size: 20px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 0.2px;
    margin: 0 0 6px 0;
}
.station-description {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    font-weight: 500;
    line-height: 1.4;
}
.station-status {
    display: none;
}

/* Action Buttons */
.action-buttons {
    width: 100%;
    max-width: 360px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Game Interface */
.game-interface {
    text-align: center;
    color: white;
}

.station-list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

/* Keep legacy station-item variants unused below for reference */
.station-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    margin: 10px 0;
    background: rgba(255, 255, 255, 0);
    border-radius: 10px;
    backdrop-filter: none;
}

.station-info {
    display: flex;
    align-items: center;
    flex: 1;
}

.station-icon {
    width: 40px;
    height: 40px;
    margin-right: 15px;
    background: rgba(255, 255, 255, 0);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.station-details h3 {
    margin: 0 0 5px 0;
    font-size: 18px;
}

.station-details p {
    margin: 0;
    font-size: 14px;
    opacity: 0.8;
}

.station-status {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.status-pending {
    background: rgba(255, 193, 7, 0);
    color: #ffc107;
    border: 0;
}

.status-completed {
    background: rgba(40, 167, 69, 0);
    color: #28a745;
    border: 0;
}

.scan-button {
    background: linear-gradient(135deg, #00e06d 0%, #00c853 35%, #05f28d 100%);
    color: #ffffff;
    border: 0;
    padding: 16px 32px;
    border-radius: 28px;
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    width: 260px;
    box-shadow: 0 10px 30px rgba(0, 230, 118, 0.35), inset 0 2px 0 rgba(255, 255, 255, 0.2);
}

.scan-button:hover {
    filter: brightness(1.03);
}

.scan-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    filter: none;
}

.claim-button {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    width: 100%;
    transition: all 0.3s ease;
}

.claim-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(240, 147, 251, 0.4);
}

/* Reward Section */
.reward-section {
    text-align: center;
    margin-top: 30px;
}

.spin-button {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    padding: 20px 40px;
    border-radius: 50px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 20px 0;
}

.spin-button:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(240, 147, 251, 0.4);
}

.spin-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.gift-code {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 15px;
    margin: 20px 0;
    backdrop-filter: blur(10px);
}

.gift-code h3 {
    margin: 0 0 10px 0;
    font-size: 24px;
    color: #ffd700;
}

.gift-code .code {
    font-size: 32px;
    font-weight: bold;
    color: #fff;
    letter-spacing: 3px;
    font-family: 'Courier New', monospace;
}

/* Loading Spinner */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin: 20px auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* QR Scanner Modal */
.qr-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.qr-scanner {
    width: 90%;
    max-width: 400px;
    background: white;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
}

.qr-scanner h3 {
    color: #333;
    margin-bottom: 20px;
}

.qr-scanner video {
    width: 100%;
    border-radius: 10px;
    margin-bottom: 20px;
}

.close-scanner {
    background: #dc3545;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 480px) {
    .game-content {
        padding: 15px;
    }

    .registration-form {
        max-width: 280px;
    }

    .station-item {
        padding: 12px;
    }

    .station-icon {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }

    .station-details h3 {
        font-size: 16px;
    }

    .station-details p {
        font-size: 12px;
    }

    .gift-code .code {
        font-size: 24px;
        letter-spacing: 2px;
    }
}

/* QR Scanner Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
}

.modal-content {
    background: linear-gradient(135deg, #0b66cf 0%, #02d15e 100%);
    margin: 10% auto;
    padding: 0;
    border-radius: 20px;
    width: 85%;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.15);
}

.modal-header {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
}

.modal-header h3 {
    margin: 0;
    color: white;
    font-size: 16px;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.close {
    color: white;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.modal-body {
    position: relative;
    padding: 15px 20px 20px;
    text-align: center;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(5px);
}

#qr-reader {
    width: 100%;
    max-width: 350px;
    margin: 0 auto 15px;
    border-radius: 15px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.scan-instruction {
    color: #ffffff;
    font-size: 13px;
    margin: 0;
    opacity: 0.85;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Scanner controls row */
/* .scanner-controls removed */

/* Camera Switch Button */
/* .camera-switch-btn removed */

/* .camera-switch-btn:hover removed */

/* .camera-switch-btn:active removed */

/* Mobile Modal Adjustments */
@media (max-width: 768px) {
    .modal {
        position: fixed;
        z-index: 10000;
        left: 0;
        top: 0;
        width: 100vw;
        height: 100vh;
    }

    .modal-content {
        width: 90%;
        margin: 8% auto;
        max-width: none;
        border-radius: 18px;
    }

    .modal-header {
        padding: 12px 15px;
    }

    .modal-body {
        padding: 12px 15px 18px;
    }

    #qr-reader {
        max-width: 100%;
        border-radius: 12px;
    }

    /* camera switch controls removed for mobile as well */
}
