/* Reset e Variáveis */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #ec4899;
    --background: #0f0f23;
    --surface: #1a1a2e;
    --surface-light: #25253a;
    --text: #ffffff;
    --text-muted: #94a3b8;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --gold: #fbbf24;
    --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    --radius: 16px;
    --radius-sm: 8px;
}

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

body {
    font-family: 'Space Grotesk', 'Segoe UI', sans-serif;
    background: var(--background);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Fundo animado */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(236, 72, 153, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(79, 70, 229, 0.05) 0%, transparent 70%);
}

/* Header */
.header {
    background: rgba(26, 26, 46, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1rem 2rem;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--text);
}

.user-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.balance-badge {
    background: var(--surface-light);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 8px;
}

.balance-badge .amount {
    color: var(--success);
    font-weight: 600;
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--gradient-1);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: var(--surface-light);
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: var(--surface);
    border-color: var(--primary);
}

/* Main Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 3rem 0;
    margin-bottom: 2rem;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    color: var(--text-muted);
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Search & Filters */
.search-section {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 300px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 1rem;
    transition: all 0.3s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.search-box .search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.filter-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.75rem 1.25rem;
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Provider Tabs */
.providers-section {
    margin-bottom: 2rem;
    overflow-x: auto;
    padding-bottom: 1rem;
}

.providers-tabs {
    display: flex;
    gap: 0.75rem;
    min-width: max-content;
}

.provider-tab {
    padding: 0.75rem 1.5rem;
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    font-weight: 500;
}

.provider-tab:hover {
    background: var(--surface-light);
    color: var(--text);
}

.provider-tab.active {
    background: var(--gradient-1);
    color: white;
    border-color: transparent;
}

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

.game-card {
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
}

.game-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow);
    border-color: rgba(99, 102, 241, 0.3);
}

.game-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.8) 100%);
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s;
}

.game-card:hover::before {
    opacity: 1;
}

.game-image {
    width: 100%;
    height: auto;
    display: block;
    background: var(--surface-light);
}

.game-info {
    padding: 1rem;
    position: relative;
    z-index: 2;
}

.game-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-provider {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.game-play-btn {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    opacity: 0;
    z-index: 3;
    padding: 0.75rem 2rem;
    background: var(--gradient-1);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.game-card:hover .game-play-btn {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.game-badges {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    display: flex;
    gap: 0.5rem;
    z-index: 2;
}

.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-hot {
    background: var(--danger);
}

.badge-new {
    background: var(--success);
}

.badge-jackpot {
    background: var(--gold);
    color: #000;
}

/* Loading Skeleton */
.skeleton {
    background: linear-gradient(90deg, var(--surface) 25%, var(--surface-light) 50%, var(--surface) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

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

.modal {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 2rem;
    max-width: 420px;
    width: 90%;
    transform: scale(0.9);
    transition: transform 0.3s;
}

.pix-qr {
    max-width: 520px;
}

.pix-qr-subtitle {
    margin-top: 0.5rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    text-align: center;
}

.pix-qr-card {
    margin-top: 1.5rem;
    padding: 1.5rem;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.04);
    display: grid;
    gap: 1rem;
    align-items: center;
}

.hidden {
    display: none !important;
}

.pix-qr-card img {
    width: 220px;
    height: 220px;
    margin: 0 auto;
    background: #fff;
    padding: 0.75rem;
    border-radius: 12px;
}

.pix-qr-meta {
    display: grid;
    gap: 0.5rem;
}

.pix-qr-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.pix-qr-row .value {
    color: var(--text);
    font-weight: 600;
}

.pix-copy {
    margin-top: 1.5rem;
    display: grid;
    gap: 0.75rem;
}

.pix-copy label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.pix-copy-field {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.75rem;
}

.pix-copy-field input {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: var(--surface-light);
    color: var(--text);
}

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

.modal h2 {
    margin-bottom: 1.5rem;
    text-align: center;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--background);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.modal-actions .btn {
    flex: 1;
    justify-content: center;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    padding: 1rem 1.5rem;
    background: var(--surface);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--primary);
    box-shadow: var(--shadow);
    animation: slideIn 0.3s ease;
}

.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--danger); }
.toast.warning { border-color: var(--warning); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Stats Bar */
.stats-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.stat-card {
    flex: 1;
    min-width: 150px;
    background: var(--surface);
    padding: 1.25rem;
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-card .label {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.stat-card .value {
    font-size: 1.5rem;
    font-weight: 700;
}

.stat-card.highlight {
    background: var(--gradient-1);
}

/* Jackpot Card */
.stat-card.jackpot-card {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 50%, #b45309 100%);
    position: relative;
    overflow: hidden;
}

.stat-card.jackpot-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255,255,255,0.1) 50%,
        transparent 70%
    );
    animation: jackpot-shine 3s ease-in-out infinite;
}

@keyframes jackpot-shine {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

.jackpot-value {
    font-family: 'Courier New', monospace;
    font-size: 1.8rem !important;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    letter-spacing: 1px;
}

.jackpot-pulse {
    animation: pulse-glow 0.5s ease-in-out;
}

@keyframes pulse-glow {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); text-shadow: 0 0 20px rgba(255,255,255,0.8); }
}

/* Evento Card */
.stat-card.evento-card {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 50%, #4338ca 100%);
    position: relative;
    overflow: hidden;
}

.stat-card.evento-card.active {
    animation: evento-glow 1.5s ease-in-out infinite alternate;
}

@keyframes evento-glow {
    from { box-shadow: 0 0 10px rgba(99, 102, 241, 0.5); }
    to { box-shadow: 0 0 30px rgba(99, 102, 241, 0.9), 0 0 60px rgba(99, 102, 241, 0.5); }
}

.evento-value {
    font-family: 'Courier New', monospace;
    font-size: 1.8rem !important;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    letter-spacing: 1px;
}

.evento-status {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    background: rgba(0,0,0,0.3);
    color: #94a3b8;
}

.evento-status.on {
    background: #10b981;
    color: white;
    animation: status-pulse 1s ease-in-out infinite;
}

@keyframes status-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .nav-links {
        display: none;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .games-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .container {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .games-grid {
        grid-template-columns: 1fr;
    }
}

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

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

::-webkit-scrollbar-thumb {
    background: var(--surface-light);
    border-radius: 4px;
}

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

/* Game iframe container */
.game-frame-container {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 3000;
    display: none;
}

.game-frame-container.active {
    display: flex;
    flex-direction: column;
}

/* Jackpot Bar - acima do jogo */
.jackpot-bar {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 2px solid var(--primary);
    flex-shrink: 0;
    height: 50px;
    min-height: 50px;
    position: relative;
    z-index: 3010;
}

.jackpot-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    background: rgba(255,255,255,0.08);
}

.jackpot-item.mini {
    border: 2px solid #10b981;
}

.jackpot-item.evento {
    border: 2px solid #f59e0b;
}

.jackpot-item.evento.active {
    animation: jackpot-glow 1s ease-in-out infinite alternate;
    border-color: #f59e0b;
}

@keyframes jackpot-glow {
    from { box-shadow: 0 0 10px rgba(245, 158, 11, 0.3); }
    to { box-shadow: 0 0 25px rgba(245, 158, 11, 0.8), 0 0 50px rgba(245, 158, 11, 0.4); }
}

.jackpot-icon {
    font-size: 1.2rem;
}

.jackpot-info {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.jackpot-label {
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    line-height: 1;
}

.jackpot-value {
    font-size: 1rem;
    font-weight: 700;
    color: white;
    font-family: 'Courier New', monospace;
    line-height: 1.2;
}

.jackpot-progress {
    width: 40px;
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    overflow: hidden;
}

.jackpot-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #34d399);
    border-radius: 2px;
    transition: width 0.5s ease;
    width: 0%;
}

.jackpot-progress-fill.near {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
    animation: pulse 0.5s ease-in-out infinite alternate;
}

@keyframes pulse {
    from { opacity: 0.8; }
    to { opacity: 1; }
}

.jackpot-status {
    font-size: 0.6rem;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
}

.jackpot-status .status-off {
    color: #94a3b8;
}

.jackpot-status .status-on {
    color: #10b981;
    font-weight: 700;
}

.jackpot-participating {
    display: none;
}

/* Feedback do Evento - aparece abaixo da barra */
.evento-feedback {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 55px;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    z-index: 3015;
    animation: feedback-bounce 0.6s ease-out;
    white-space: nowrap;
}

.evento-feedback .feedback-sad,
.evento-feedback .feedback-happy {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
}

.feedback-sad {
    background: linear-gradient(135deg, #dc2626, #991b1b);
    color: white;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.5);
}

.feedback-happy {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.5);
}

@keyframes feedback-bounce {
    0% { transform: translateY(-20px) scale(0.8); opacity: 0; }
    50% { transform: translateY(5px) scale(1.1); }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes feedback-fade-out {
    0% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-20px); }
}

.evento-feedback.hidden {
    display: none;
}

.game-frame-container iframe {
    width: 100%;
    flex: 1;
    border: none;
    background: #000;
}

.jackpot-bar .close-game-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--danger);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    z-index: 3011;
}

.jackpot-bar .close-game-btn:hover {
    background: #dc2626;
    transform: translateY(-50%) scale(1.05);
}

/* Ocultar mensagens externas */
.game-frame-container::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: #000;
    z-index: 3002;
}
