/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Heebo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #0E1323 0%, #1A2332 100%);
    color: #FFFFFF;
    min-height: 100vh;
    direction: rtl;
    font-size: 16px;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Splash Screen */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, #0E1323 0%, #1B1F2E 50%, #2A2F42 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    visibility: visible;
    transition: all 0.5s ease-in-out;
}

.splash-screen.hide {
    opacity: 0;
    visibility: hidden;
}

.splash-content {
    text-align: center;
    animation: splashFadeIn 1s ease-out;
}

.splash-logo {
    width: 100%;
    max-width: 400px;
    height: auto;
    margin-bottom: 3rem;
    filter: drop-shadow(0 10px 30px rgba(201, 160, 79, 0.3));
    animation: logoGlow 2s ease-in-out infinite alternate;
}

.splash-loader {
    display: flex;
    justify-content: center;
    align-items: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(201, 160, 79, 0.2);
    border-top: 3px solid #C9A04F;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes splashFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes logoGlow {
    from {
        filter: drop-shadow(0 10px 30px rgba(201, 160, 79, 0.3));
    }
    to {
        filter: drop-shadow(0 15px 40px rgba(201, 160, 79, 0.6));
    }
}

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

.app-container {
    position: relative;
    width: 100%;
    min-height: 100vh;
}

/* Screen Management */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 100vh;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
    padding: 20px;
    overflow-y: auto;
}

.screen.active {
    opacity: 1;
    visibility: visible;
}

/* Header Styles */
.app-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    border: 1px solid rgba(201, 160, 79, 0.2);
    backdrop-filter: blur(10px);
}

.title-section {
    text-align: center;
    margin-bottom: 1rem;
}

.app-title {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #C9A04F 0%, #E4C06B 50%, #C9A04F 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.app-tagline {
    font-size: 1rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
    font-style: italic;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.header-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
    font-weight: 400;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: #E4C06B;
}

#last-prize-container .stat-label {
    color: #C9A04F;
    font-weight: 500;
}

#last-prize-container .stat-value {
    background: rgba(201, 160, 79, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid rgba(201, 160, 79, 0.3);
    font-size: 1rem;
    max-width: 250px;
    text-align: center;
    line-height: 1.3;
}

/* Main Content */
.main-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Wheel Container */
.wheel-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

#spin-wheel {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.4));
}

.wheel-pointer {
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-bottom: 25px solid #C9A04F;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    z-index: 10;
    transition: transform 0.2s ease;
}

.wheel-pointer.bounce {
    animation: pointerBounce 0.3s ease-out;
}

@keyframes pointerBounce {
    0%, 100% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.2); }
}

.spin-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #C9A04F 0%, #E4C06B 50%, #C9A04F 100%);
    color: #1B1F2E;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 
        0 4px 15px rgba(201, 160, 79, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spin-button:hover:not(:disabled) {
    transform: translate(-50%, -50%) scale(1.05);
    box-shadow: 
        0 6px 20px rgba(201, 160, 79, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.spin-button:active:not(:disabled) {
    transform: translate(-50%, -50%) scale(0.95);
}

.spin-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: translate(-50%, -50%);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 1rem;
    width: 100%;
    max-width: 400px;
    flex-wrap: wrap;
}

.action-btn {
    flex: 1;
    min-width: 160px;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.action-btn.secondary {
    background: linear-gradient(135deg, rgba(228, 192, 107, 0.2) 0%, rgba(201, 160, 79, 0.2) 100%);
    color: #E4C06B;
    border: 1px solid rgba(228, 192, 107, 0.3);
}

.action-btn.secondary:hover {
    background: linear-gradient(135deg, rgba(228, 192, 107, 0.3) 0%, rgba(201, 160, 79, 0.3) 100%);
    border-color: rgba(228, 192, 107, 0.5);
}

.action-btn.tertiary {
    background: rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.action-btn.tertiary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Cooldown Display */
.cooldown-display {
    text-align: center;
    padding: 1rem;
    background: rgba(255, 87, 87, 0.1);
    border: 1px solid rgba(255, 87, 87, 0.3);
    border-radius: 12px;
    color: #FF9999;
    font-weight: 500;
}

/* Screen Headers */
.screen-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.back-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #FFFFFF;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.2rem;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.screen-header h2 {
    font-size: 1.8rem;
    font-weight: 600;
    color: #E4C06B;
}

/* Prizes Screen */
.prizes-content {
    max-width: 600px;
    margin: 0 auto;
}

.prizes-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.prize-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.2s ease;
}

.prize-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(228, 192, 107, 0.3);
}

.prize-header {
    display: flex;
    justify-content: between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.prize-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #E4C06B;
    flex: 1;
}

.prize-status {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
}

.prize-status.won {
    background: rgba(76, 175, 80, 0.2);
    color: #81C784;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.prize-status.redeemed {
    background: rgba(158, 158, 158, 0.2);
    color: #BCBCBC;
    border: 1px solid rgba(158, 158, 158, 0.3);
}

.prize-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.prize-terms {
    font-size: 0.9rem;
    opacity: 0.8;
    color: #CCCCCC;
}

.prize-code-display {
    background: rgba(201, 160, 79, 0.1);
    border: 1px solid rgba(201, 160, 79, 0.3);
    border-radius: 8px;
    padding: 0.8rem;
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    font-weight: 600;
    color: #E4C06B;
    text-align: center;
    letter-spacing: 1px;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #999999;
}

.empty-state p {
    margin-bottom: 0.5rem;
}

/* Login Form */
.login-content {
    max-width: 400px;
    margin: 0 auto;
}

.login-form {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #E4C06B;
}

.form-input {
    width: 100%;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: #FFFFFF;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: #C9A04F;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 2px rgba(201, 160, 79, 0.2);
}

.form-input::placeholder {
    color: #999999;
}

.form-btn {
    width: 100%;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #C9A04F 0%, #E4C06B 100%);
    color: #1B1F2E;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.form-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(201, 160, 79, 0.4);
}

.form-btn:active {
    transform: translateY(0);
}

.form-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.form-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.1);
}

/* Console Styles */
.console-content {
    max-width: 800px;
    margin: 0 auto;
}

.console-section {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.console-section h3 {
    margin-bottom: 1rem;
    color: #E4C06B;
    font-size: 1.3rem;
    font-weight: 600;
}

.console-section h4 {
    margin-bottom: 1rem;
    color: #CCCCCC;
    font-size: 1.1rem;
    font-weight: 500;
}

.console-form {
    margin-bottom: 1rem;
}

.form-row {
    display: flex;
    gap: 1rem;
    align-items: end;
    flex-wrap: wrap;
}

.form-row .form-input {
    flex: 1;
    min-width: 150px;
}

.form-row .form-btn {
    width: auto;
    min-width: 100px;
}

.verification-result {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 8px;
    font-weight: 500;
}

.verification-result.success {
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.3);
    color: #81C784;
}

.verification-result.error {
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid rgba(244, 67, 54, 0.3);
    color: #EF5350;
}

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

.stat-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #C9A04F;
    margin-bottom: 0.5rem;
}

.stat-card .stat-label {
    font-size: 0.9rem;
    color: #CCCCCC;
}

.logs-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
}

.log-item {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
}

.log-item:last-child {
    border-bottom: none;
}

.log-timestamp {
    color: #999999;
    margin-left: 0.5rem;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: linear-gradient(135deg, #1A2332 0%, #0E1323 100%);
    border: 1px solid rgba(201, 160, 79, 0.3);
    border-radius: 16px;
    max-width: 500px;
    width: 100%;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    direction: rtl;
    text-align: center;
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 1.5rem;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h3 {
    color: #E4C06B;
    font-size: 1.4rem;
    font-weight: 600;
}

.modal-body {
    padding: 2rem 1.5rem;
}

.prize-display {
    text-align: center;
}

.prize-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #FFFFFF;
    margin-bottom: 1.5rem;
    line-height: 1.4;
    font-family: 'Heebo', Arial, sans-serif;
}

.prize-terms {
    color: #CCCCCC;
    font-size: 1rem;
    margin-bottom: 2rem;
    line-height: 1.5;
    font-family: 'Heebo', Arial, sans-serif;
}

.code-display {
    text-align: center;
}

.prize-code {
    background: rgba(201, 160, 79, 0.2);
    border: 2px solid #C9A04F;
    border-radius: 12px;
    padding: 1.5rem;
    font-family: 'Courier New', monospace;
    font-size: 1.8rem;
    font-weight: 700;
    color: #E4C06B;
    letter-spacing: 2px;
    margin-bottom: 1rem;
}

.modal-footer {
    padding: 1.5rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    direction: rtl;
}

.modal-btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Heebo', Arial, sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
}

.modal-btn.primary {
    background: linear-gradient(135deg, #C9A04F 0%, #E4C06B 100%);
    color: #1B1F2E;
}

.modal-btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(201, 160, 79, 0.4);
}

.modal-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Toast Styles */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: rgba(0, 0, 0, 0.9);
    color: #FFFFFF;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #C9A04F;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    max-width: 300px;
    word-wrap: break-word;
}

.toast.show {
    transform: translateX(0);
}

.toast.error {
    border-left-color: #F44336;
}

.toast.success {
    border-left-color: #4CAF50;
}

/* Responsive Design */
@media (max-width: 768px) {
    .splash-logo {
        max-width: 300px;
        margin-bottom: 2rem;
    }
    
    .app-title {
        font-size: 2rem;
    }
    
    .app-tagline {
        font-size: 0.9rem;
    }
    
    .header-stats {
        gap: 1rem;
    }
    
    .main-content {
        padding: 0 10px;
    }
    
    .wheel-container {
        max-width: 450px;
    }
    
    .spin-button {
        width: 70px;
        height: 70px;
        font-size: 0.9rem;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-btn {
        min-width: auto;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .form-row .form-input,
    .form-row .form-btn {
        width: 100%;
    }
    
    .stats-summary {
        grid-template-columns: 1fr;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .toast-container {
        right: 10px;
        left: 10px;
    }
    
    .toast {
        max-width: none;
    }
}

@media (max-width: 480px) {
    .screen {
        padding: 15px;
    }
    
    .splash-logo {
        max-width: 250px;
        margin-bottom: 1.5rem;
    }
    
    .app-title {
        font-size: 1.8rem;
    }
    
    .app-tagline {
        font-size: 0.8rem;
    }
    
    .wheel-container {
        max-width: 400px;
    }
    
    .spin-button {
        width: 60px;
        height: 60px;
        font-size: 0.8rem;
    }
    
    .console-section {
        padding: 1rem;
    }
    
    .prize-code {
        font-size: 1.4rem;
        padding: 1rem;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.pulse {
    animation: pulse 1.5s ease-in-out infinite;
}

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

.sparkle {
    animation: sparkle 1.5s ease-in-out;
}

@keyframes sparkle {
    0%, 100% { opacity: 0; transform: scale(0.8) rotate(0deg); }
    50% { opacity: 1; transform: scale(1.2) rotate(180deg); }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
button:focus,
input:focus {
    outline: 2px solid #C9A04F;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .app-container {
        background: #000000;
    }
    
    .modal-content,
    .console-section,
    .prize-item {
        border-width: 2px;
    }
}
