/* =========================================
   RewardHub - Modern UI
   ========================================= */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #ec489a;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #0f172a;
    --darker: #020617;
    --light: #f1f5f9;
    --gray: #64748b;
    --card-bg: rgba(255, 255, 255, 0.05);
    --border: rgba(255, 255, 255, 0.1);
    --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

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

body {
    font-family: 'Cairo', sans-serif;
    background: linear-gradient(135deg, var(--dark), var(--darker));
    color: var(--light);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* =========================================
   Animations
   ========================================= */

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

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

@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

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

@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px var(--primary); }
    50% { box-shadow: 0 0 20px var(--primary); }
}

/* =========================================
   Loading Overlay
   ========================================= */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--darker);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.5s;
}

.loader {
    width: 60px;
    height: 60px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-overlay p {
    margin-top: 20px;
    color: var(--gray);
}

/* =========================================
   Auth Modal
   ========================================= */

.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.5s;
}

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

.auth-content {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 30px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    animation: slideUp 0.5s;
}

.auth-header h2 {
    font-size: 28px;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-header p {
    color: var(--gray);
    margin-bottom: 30px;
}

.auth-benefits {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.benefit-item {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 15px;
    padding: 15px;
    transition: all 0.3s;
}

.benefit-item i {
    font-size: 24px;
    color: var(--primary);
    margin-bottom: 8px;
    display: block;
}

.benefit-item span {
    font-size: 12px;
    color: var(--light);
}

.google-auth-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    border-radius: 50px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
    font-family: 'Cairo', sans-serif;
}

.google-auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.3);
}

.auth-terms {
    font-size: 12px;
    color: var(--gray);
    margin-top: 20px;
}

.auth-terms a {
    color: var(--primary);
    text-decoration: none;
}

/* =========================================
   Exit Modal
   ========================================= */

.exit-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.exit-content {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 30px;
    padding: 40px;
    max-width: 450px;
    width: 90%;
    text-align: center;
}

.exit-icon i {
    font-size: 60px;
    color: var(--warning);
    margin-bottom: 20px;
    animation: pulse 1s infinite;
}

.exit-content h3 {
    font-size: 24px;
    margin-bottom: 10px;
}

.exit-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 20px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
}

.exit-stat {
    text-align: center;
}

.exit-stat span {
    display: block;
    font-size: 12px;
    color: var(--gray);
}

.exit-stat strong {
    font-size: 20px;
    color: var(--primary);
}

.exit-warning {
    color: var(--warning);
    margin: 20px 0;
    font-size: 14px;
}

.exit-buttons {
    display: flex;
    gap: 15px;
}

.exit-stay {
    flex: 1;
    padding: 12px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    border-radius: 50px;
    color: white;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.exit-leave {
    flex: 1;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border);
    border-radius: 50px;
    color: var(--light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* =========================================
   Main App Container
   ========================================= */

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    animation: slideUp 0.5s;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border);
}

.logo {
    font-size: 28px;
    font-weight: bold;
}

.logo i {
    color: var(--primary);
}

.logo .highlight {
    color: var(--secondary);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--primary);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
}

.user-email {
    font-size: 11px;
    color: var(--gray);
}

.logout-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    color: var(--light);
    cursor: pointer;
    transition: all 0.3s;
}

.logout-btn:hover {
    background: var(--danger);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s;
    animation: glow 2s infinite;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
}

.stat-icon {
    width: 55px;
    height: 55px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-content {
    flex: 1;
}

.stat-label {
    display: block;
    font-size: 12px;
    color: var(--gray);
    margin-bottom: 5px;
}

.stat-value {
    font-size: 28px;
    font-weight: bold;
}

.stat-currency {
    font-size: 12px;
    color: var(--gray);
    margin-right: 5px;
}

/* Hot Session Bar */
.hot-session-bar {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(245, 158, 11, 0.05));
    border: 1px solid var(--warning);
    border-radius: 50px;
    padding: 10px 20px;
    margin-bottom: 20px;
    animation: pulse 1s infinite;
}

.hot-session-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.hot-icon {
    color: var(--warning);
    font-size: 20px;
    animation: flame 0.5s infinite alternate;
}

@keyframes flame {
    from { transform: scale(1); opacity: 0.8; }
    to { transform: scale(1.2); opacity: 1; }
}

.hot-progress {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.hot-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--warning), var(--secondary));
    width: 0%;
    transition: width 0.5s;
}

.hot-text {
    font-size: 12px;
    font-weight: 600;
    color: var(--warning);
}

/* Watch Room */
.watch-room {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 30px;
    padding: 30px;
    margin-bottom: 30px;
}

.room-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.room-header h2 {
    font-size: 20px;
}

.room-header h2 i {
    color: var(--primary);
    margin-left: 10px;
}

.cycle-progress {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cycle-bar {
    width: 100px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.cycle-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    width: 0%;
    transition: width 0.5s;
}

.ad-player {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.3));
    border-radius: 20px;
    padding: 60px 20px;
    text-align: center;
    margin-bottom: 20px;
    transition: all 0.3s;
}

.ad-content {
    cursor: pointer;
}

.ad-content i {
    font-size: 60px;
    color: var(--primary);
    margin-bottom: 15px;
    transition: all 0.3s;
}

.ad-content:hover i {
    transform: scale(1.1);
    color: var(--secondary);
}

.watch-btn {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    padding: 15px 40px;
    border-radius: 50px;
    color: white;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
    font-family: 'Cairo', sans-serif;
}

.watch-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.3);
}

.reward-preview {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
}

.reward-amount {
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.reward-amount span:first-child {
    font-size: 12px;
    color: var(--gray);
}

.reward-amount strong {
    font-size: 20px;
    color: var(--success);
}

.multiplier-badge {
    background: rgba(99, 102, 241, 0.2);
    border-radius: 50px;
    padding: 5px 12px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.multiplier-badge i {
    color: var(--primary);
    font-size: 12px;
}

/* Boosters Grid */
.boosters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.booster-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(236, 72, 153, 0.1));
    border: 1px solid var(--border);
    border-radius: 15px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: pulse 2s infinite;
}

.booster-card i {
    font-size: 28px;
}

.booster-card h4 {
    font-size: 14px;
    margin-bottom: 3px;
}

.booster-card p {
    font-size: 11px;
    color: var(--gray);
}

/* Actions Grid */
.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.action-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.action-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
}

.action-card i {
    font-size: 32px;
    color: var(--primary);
    margin-bottom: 10px;
    display: block;
}

.action-card span {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
}

.action-card small {
    font-size: 10px;
    color: var(--gray);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1500;
}

.modal-content {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 20px;
}

.close-modal {
    background: none;
    border: none;
    color: var(--gray);
    font-size: 24px;
    cursor: pointer;
}

.modal-body {
    padding: 20px;
}

/* Referral Section */
.referral-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.referral-stat {
    text-align: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
}

.referral-stat span {
    display: block;
    font-size: 11px;
    color: var(--gray);
    margin-bottom: 5px;
}

.referral-stat strong {
    font-size: 20px;
}

.referral-link-box {
    margin: 20px 0;
}

.referral-link-box label {
    display: block;
    font-size: 12px;
    color: var(--gray);
    margin-bottom: 8px;
}

.link-copy {
    display: flex;
    gap: 10px;
}

.link-copy input {
    flex: 1;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--light);
    font-size: 12px;
}

.link-copy button {
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    border-radius: 10px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.commission-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 15px;
    font-size: 12px;
}

/* Withdraw Form */
.withdraw-info {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    margin-bottom: 20px;
}

.info-item {
    text-align: center;
}

.info-item span {
    display: block;
    font-size: 11px;
    color: var(--gray);
    margin-bottom: 5px;
}

.info-item strong {
    font-size: 18px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-size: 12px;
    color: var(--gray);
    margin-bottom: 5px;
}

.form-group select,
.form-group input {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--light);
    font-family: 'Cairo', sans-serif;
}

.withdraw-note {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 10px;
    font-size: 11px;
    margin: 15px 0;
}

.submit-withdraw,
.submit-convert {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    border-radius: 50px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    transition: all 0.3s;
}

.submit-withdraw:hover,
.submit-convert:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.3);
}

/* Convert Slider */
.convert-slider {
    margin: 20px 0;
}

.convert-slider input {
    width: 100%;
    margin-bottom: 15px;
}

.convert-preview {
    text-align: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
}

.convert-preview strong {
    font-size: 24px;
    color: var(--success);
    margin: 0 5px;
}

/* Toast Notification */
.toast-notification {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 12px 24px;
    opacity: 0;
    transition: all 0.3s;
    z-index: 2000;
}

.toast-notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast-content i {
    font-size: 20px;
    color: var(--success);
}

/* Floating Reward */
.floating-reward {
    position: fixed;
    pointer-events: none;
    font-size: 20px;
    font-weight: bold;
    color: var(--success);
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
    z-index: 2000;
    animation: floatUp 1s forwards;
}

@keyframes floatUp {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-100px);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .app-container {
        padding: 15px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .user-info {
        justify-content: center;
    }
    
    .watch-btn {
        width: 100%;
        justify-content: center;
    }
    
    .auth-benefits {
        grid-template-columns: 1fr;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--darker);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary);
}