/* ========================================
   REDESIGNED SWEEPSTAKES SYSTEM
   Modern Vibrant Theme - Purple & Blue
   ======================================== */

:root {
    /* New Color Palette - Vibrant & Modern */
    --primary-color: #8B5CF6;        /* Purple */
    --primary-light: #A78BFA;        /* Light Purple */
    --primary-dark: #7C3AED;         /* Dark Purple */
    --secondary-color: #3B82F6;      /* Blue */
    --secondary-light: #60A5FA;      /* Light Blue */
    --accent-color: #14B8A6;         /* Teal */
    --accent-pink: #EC4899;          /* Pink/Magenta */
    --success-color: #10B981;        /* Green */
    --error-color: #EF4444;          /* Red */
    --warning-color: #F59E0B;        /* Amber */
    
    /* Backgrounds */
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bg-light: #F9FAFB;
    --bg-white: #FFFFFF;
    --bg-card: rgba(255, 255, 255, 0.95);
    
    /* Text Colors */
    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --text-light: #FFFFFF;
    
    /* Shadows & Effects */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 20px rgba(139, 92, 246, 0.3);
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    
    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-gradient);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Animated Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(59, 130, 246, 0.1) 0%, transparent 50%);
    z-index: -1;
    animation: bgFloat 20s ease-in-out infinite;
}

@keyframes bgFloat {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, -30px); }
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 24px;
}

/* =====================================
   AUTHENTICATION PAGES - NEW DESIGN
   ===================================== */

.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 24px;
}

.auth-box {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    padding: 48px;
    max-width: 480px;
    width: 100%;
    box-shadow: var(--shadow-xl), var(--shadow-glow);
    border: 1px solid rgba(139, 92, 246, 0.2);
    position: relative;
    overflow: hidden;
}

.auth-box::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.05) 0%, transparent 70%);
    animation: rotate 30s linear infinite;
}

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

.auth-box > * {
    position: relative;
    z-index: 1;
}

.auth-header {
    text-align: center;
    margin-bottom: 40px;
}

.auth-header h1 {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    font-weight: 500;
}

/* Forms - Modern Style */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #E5E7EB;
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: var(--transition);
    background: var(--bg-white);
    color: var(--text-primary);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
}

.form-control::placeholder {
    color: #9CA3AF;
}

/* Buttons - Modern & Vibrant */
.btn {
    display: inline-block;
    padding: 14px 28px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--text-light);
    box-shadow: var(--shadow-md);
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

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

.btn-secondary {
    background: var(--bg-white);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    width: 100%;
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: var(--text-light);
    transform: translateY(-2px);
}

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

/* Auth Links */
.auth-links {
    margin-top: 32px;
    text-align: center;
}

.auth-links p {
    color: var(--text-secondary);
    margin: 12px 0;
    font-size: 0.95rem;
}

.auth-links a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.auth-links a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Alerts - New Design */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    font-weight: 500;
    border-left: 4px solid;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    background: #D1FAE5;
    color: #065F46;
    border-color: var(--success-color);
}

.alert-error {
    background: #FEE2E2;
    color: #991B1B;
    border-color: var(--error-color);
}

.alert-warning {
    background: #FEF3C7;
    color: #92400E;
    border-color: var(--warning-color);
}

.alert-info {
    background: #DBEAFE;
    color: #1E40AF;
    border-color: var(--secondary-color);
}

/* =====================================
   DASHBOARD - NEW DESIGN
   ===================================== */

.dashboard-header {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-bottom: 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-md);
    flex-wrap: wrap;
    gap: 20px;
}

.user-info h2 {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.user-info p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Dashboard Content Grid */
.dashboard-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
}

@media (min-width: 1024px) {
    .dashboard-content {
        grid-template-columns: 1fr 1.2fr;
    }
}

.dashboard-left,
.dashboard-right {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Bonus Display - New Card Style */
.bonus-display {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: var(--radius-lg);
    padding: 40px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    color: var(--text-light);
    position: relative;
    overflow: hidden;
}

.bonus-display::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: rotate 40s linear infinite;
}

.bonus-display > * {
    position: relative;
    z-index: 1;
}

.bonus-display h3 {
    font-size: 1.3rem;
    margin-bottom: 16px;
    font-weight: 600;
    opacity: 0.9;
}

.bonus-amount {
    font-size: 3.5rem;
    font-weight: 800;
    margin: 16px 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* History Section - Card Style */
.history-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-md);
}

.history-section h3 {
    color: var(--text-primary);
    font-size: 1.5rem;
    margin-bottom: 24px;
    font-weight: 700;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.history-table thead {
    background: linear-gradient(135deg, var(--primary-light), var(--secondary-light));
    color: var(--text-light);
}

.history-table th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.history-table td {
    padding: 16px;
    border-bottom: 1px solid #F3F4F6;
    color: var(--text-primary);
}

.history-table tbody tr:hover {
    background: #F9FAFB;
}

.history-table tbody tr:last-child td {
    border-bottom: none;
}

/* Spin Container - New Design */
.spin-container {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 40px;
    text-align: center;
    box-shadow: var(--shadow-md);
}

.spin-container h2 {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2rem;
    font-weight: 700;
}

.spin-container p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 24px;
}

/* Wheel Wrapper */
.wheel-wrapper {
    position: relative;
    margin: 32px auto;
    max-width: 400px;
}

.wheel-pointer {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 40px solid var(--accent-pink);
    z-index: 10;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.spin-wheel {
    width: 100%;
    max-width: 400px;
    aspect-ratio: 1;
    border-radius: 50%;
    box-shadow: 
        0 0 0 10px var(--bg-white),
        0 0 0 12px var(--primary-color),
        var(--shadow-xl);
    transition: transform 4s cubic-bezier(0.17, 0.67, 0.12, 0.99);
}

.spin-wheel.spinning {
    animation: spin 4s cubic-bezier(0.17, 0.67, 0.12, 0.99);
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(1800deg); }
}

.spin-btn {
    margin-top: 32px;
    padding: 18px 48px;
    font-size: 1.2rem;
    background: linear-gradient(135deg, var(--accent-pink), var(--primary-color));
    color: var(--text-light);
    border: none;
    border-radius: var(--radius-lg);
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-lg);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.spin-btn:hover:not(:disabled) {
    transform: translateY(-4px) scale(1.05);
    box-shadow: var(--shadow-xl), 0 0 30px rgba(236, 72, 153, 0.4);
}

.spin-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Games Section - New Design */
.games-section {
    margin-top: 48px;
}

.games-section h3 {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 32px;
}

.mode-tabs {
    display: flex;
    gap: 16px;
    margin-bottom: 32px;
    background: var(--bg-card);
    padding: 8px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.mode-tab {
    flex: 1;
    padding: 14px 24px;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mode-tab.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--text-light);
    box-shadow: var(--shadow-md);
}

.mode-tab:hover:not(.active) {
    background: #F3F4F6;
}

/* Games Grid */
.games {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 24px;
}

.game-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    text-decoration: none;
    display: block;
}

.game-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl), 0 0 20px rgba(139, 92, 246, 0.2);
}

.game-card img {
    width: 100%;
    height: 140px;
    object-fit: cover;
}

.game-name {
    display: block;
    padding: 16px;
    text-align: center;
    font-weight: 600;
    color: var(--text-primary);
    background: linear-gradient(to bottom, transparent, rgba(139, 92, 246, 0.05));
}

/* Payment Footer */
.payment-footer {
    margin-top: 48px;
    padding: 32px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow-md);
}

.payment-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.payment-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.payment-row img {
    height: 40px;
    object-fit: contain;
    filter: grayscale(100%);
    opacity: 0.6;
    transition: var(--transition);
}

.payment-row img:hover {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.1);
}

/* Telegram Float Button - New Design */
.telegram-float {
    position: fixed;
    bottom: 32px;
    right: 32px;
    background: linear-gradient(135deg, var(--accent-color), var(--secondary-color));
    color: var(--text-light);
    padding: 16px 32px;
    border-radius: var(--radius-xl);
    text-decoration: none;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    transition: var(--transition);
}

.telegram-float:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl), 0 0 20px rgba(20, 184, 166, 0.4);
}

/* =====================================
   ADMIN PANEL - NEW DESIGN
   ===================================== */

.admin-container {
    padding: 32px;
}

.admin-nav {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px 32px;
    margin-bottom: 32px;
    box-shadow: var(--shadow-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.admin-nav h1 {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.8rem;
    font-weight: 700;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-md);
    border-left: 4px solid var(--primary-color);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-card h3 {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.admin-table-container {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-md);
    overflow-x: auto;
}

.admin-table-container h2 {
    color: var(--text-primary);
    font-size: 1.5rem;
    margin-bottom: 24px;
    font-weight: 700;
}

/* Responsive Design */
@media (max-width: 768px) {
    .auth-box {
        padding: 32px 24px;
    }
    
    .auth-header h1 {
        font-size: 2rem;
    }
    
    .dashboard-header {
        padding: 24px;
    }
    
    .user-info h2 {
        font-size: 1.5rem;
    }
    
    .bonus-amount {
        font-size: 2.5rem;
    }
    
    .history-section,
    .spin-container {
        padding: 24px;
    }
    
    .games {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 16px;
    }
    
    .telegram-float {
        bottom: 20px;
        right: 20px;
        padding: 12px 24px;
    }
}

/* Loading Spinner */
.spinner {
    border: 4px solid rgba(139, 92, 246, 0.1);
    border-left-color: var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

/* Verification Message */
.verification-message {
    background: #DBEAFE;
    border: 2px solid var(--secondary-color);
    color: #1E3A8A;
    padding: 20px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    text-align: center;
}

.verification-message h3 {
    margin: 0 0 12px 0;
    font-size: 1.1rem;
    font-weight: 700;
}

.verification-message p {
    margin: 8px 0;
    font-size: 0.95rem;
}

.resend-link {
    color: var(--primary-color);
    cursor: pointer;
    text-decoration: underline;
    font-weight: 600;
    transition: var(--transition);
}

.resend-link:hover {
    color: var(--primary-dark);
}

#resendMessage {
    margin-top: 12px;
    padding: 12px;
    border-radius: var(--radius-sm);
    display: none;
}

#resendMessage.success {
    background: #D1FAE5;
    color: #065F46;
}

#resendMessage.error {
    background: #FEE2E2;
    color: #991B1B;
}
