/**
 * Style.css - Giao diện Vòng Quay May Mắn
 */

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', Arial, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    color: #ffffff;
}

/* ===== LOADING OVERLAY ===== */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-content {
    text-align: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #FFD700;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#loading-message {
    color: #ffffff;
    font-size: 16px;
}

/* ===== LOGIN PAGE ===== */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 400px;
}

.login-box {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header .logo {
    font-size: 60px;
    margin-bottom: 15px;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.login-header h1 {
    font-size: 24px;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #FFD700, #FFA500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-header p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.login-form {
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    transition: all 0.3s ease;
}

.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.form-group input:focus {
    outline: none;
    border-color: #FFD700;
    background: rgba(255, 255, 255, 0.15);
}

.error-message {
    background: rgba(255, 68, 68, 0.2);
    color: #ff6b6b;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    text-align: center;
}

.btn-login {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 700;
    color: #1a1a2e;
    background: linear-gradient(45deg, #FFD700, #FFA500);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.4);
}

.btn-login:active {
    transform: translateY(0);
}

.login-footer {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
}

/* ===== HEADER ===== */
.header {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-icon {
    font-size: 32px;
    animation: rotate 10s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.header h1 {
    font-size: 22px;
    background: linear-gradient(45deg, #FFD700, #FFA500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.btn-logout {
    padding: 8px 16px;
    font-size: 14px;
    color: #ffffff;
    background: rgba(255, 68, 68, 0.3);
    border: 1px solid rgba(255, 68, 68, 0.5);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background: rgba(255, 68, 68, 0.5);
}

/* ===== MAIN CONTENT ===== */
.main-content {
    padding: 30px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
}

/* ===== WHEEL SECTION ===== */
.wheel-section {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.wheel-container {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    padding: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#wheel-canvas {
    max-width: 100%;
    height: auto;
}

#wheel-canvas {
    display: block;
}

.wheel-controls {
    margin-bottom: 20px;
}

.btn-spin {
    padding: 20px 60px;
    font-size: 24px;
    font-weight: 700;
    color: #1a1a2e;
    background: linear-gradient(45deg, #FFD700, #FFA500);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.4);
}

.btn-spin:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(255, 215, 0, 0.6);
}

.btn-spin:active:not(:disabled) {
    transform: translateY(0);
}

.btn-spin:disabled {
    background: #666;
    color: #999;
    cursor: not-allowed;
    box-shadow: none;
}

.wheel-actions {
    display: flex;
    gap: 15px;
}

.btn-action {
    padding: 12px 24px;
    font-size: 14px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-action:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-action.btn-danger {
    background: rgba(255, 68, 68, 0.2);
    border-color: rgba(255, 68, 68, 0.4);
}

.btn-action.btn-danger:hover {
    background: rgba(255, 68, 68, 0.4);
}

/* ===== INFO SECTION ===== */
.info-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stats-card,
.winners-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stats-card h3,
.winners-card h3 {
    font-size: 16px;
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.9);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.stat-item {
    text-align: center;
    padding: 15px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.stat-value {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: #FFD700;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.winners-card {
    flex: 1;
    max-height: 400px;
    display: flex;
    flex-direction: column;
}

.winners-list {
    flex: 1;
    overflow-y: auto;
}

.no-winners {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    padding: 30px;
    font-style: italic;
}

.winner-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 10px;
    margin-bottom: 10px;
    border-left: 3px solid #FFD700;
}

.winner-rank {
    font-size: 14px;
    font-weight: 700;
    color: #FFD700;
    min-width: 35px;
}

.winner-name {
    font-size: 14px;
    color: #ffffff;
}

/* ===== MODAL ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 20px;
    padding: 40px;
    max-width: 450px;
    width: 90%;
    position: relative;
    transform: scale(0.8);
    transition: transform 0.3s ease;
    border: 2px solid rgba(255, 215, 0, 0.3);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal.show .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 30px;
    color: rgba(255, 255, 255, 0.5);
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: #ffffff;
}

.modal-body {
    text-align: center;
}

.trophy {
    font-size: 80px;
    margin-bottom: 20px;
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.modal-body h2 {
    font-size: 32px;
    margin-bottom: 15px;
    background: linear-gradient(45deg, #FFD700, #FFA500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.winner-label {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 10px;
}

.modal-body .winner-name {
    font-size: 28px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 30px;
    padding: 15px;
    background: rgba(255, 215, 0, 0.2);
    border-radius: 10px;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.btn-continue {
    padding: 14px 40px;
    font-size: 16px;
    font-weight: 700;
    color: #1a1a2e;
    background: linear-gradient(45deg, #FFD700, #FFA500);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-continue:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.4);
}

/* ===== CONFETTI ===== */
.confetti-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    top: -10px;
    animation: confetti-fall linear forwards;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(500px) rotate(720deg);
        opacity: 0;
    }
}

/* ===== NOTIFICATION ===== */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 10px;
    font-size: 14px;
    z-index: 2000;
    transform: translateX(120%);
    transition: transform 0.3s ease;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.notification.show {
    transform: translateX(0);
}

.notification-success {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: #ffffff;
}

.notification-error {
    background: linear-gradient(45deg, #f44336, #d32f2f);
    color: #ffffff;
}

.notification-info {
    background: linear-gradient(45deg, #2196F3, #1976D2);
    color: #ffffff;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .container {
        grid-template-columns: 1fr;
    }
    
    .info-section {
        order: -1;
    }
    
    .stats-card,
    .winners-card {
        max-height: none;
    }
    
    .winners-list {
        max-height: 200px;
    }
}

@media (max-width: 600px) {
    .header {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    
    .header h1 {
        font-size: 18px;
    }
    
    .main-content {
        padding: 15px;
    }
    
    .wheel-container {
        padding: 10px;
    }
    
    .btn-spin {
        padding: 15px 40px;
        font-size: 18px;
    }
    
    .wheel-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-action {
        width: 100%;
    }
    
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .stat-value {
        font-size: 22px;
    }
    
    .modal-content {
        padding: 25px;
    }
    
    .trophy {
        font-size: 60px;
    }
    
    .modal-body h2 {
        font-size: 24px;
    }
    
    .modal-body .winner-name {
        font-size: 20px;
    }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 215, 0, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 215, 0, 0.7);
}
