/* ==========================================================================
   ESTILO GERAL: SISTEMA DE RIFAS ENOQUE MENDES
   Visual Dark Premium com detalhes em Dourado (#f59e0b) e Esmeralda (#10b981)
   ========================================================================== */

:root {
    --bg-primary: #0b0f19;
    --bg-secondary: #131b2e;
    --bg-card: #1a233a;
    --bg-input: #0f172a;
    --border-color: #273553;
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    
    --gold: #f59e0b;
    --gold-hover: #d97706;
    --gold-glow: rgba(245, 158, 11, 0.25);
    
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px var(--gold-glow);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--gold);
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.main-header {
    background-color: rgba(19, 27, 46, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}

.brand-logo span {
    color: var(--gold);
}

.brand-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--gold), #ea580c);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    box-shadow: var(--shadow-glow);
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-profile-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    color: var(--text-main);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.user-profile-btn:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--gold);
}

/* Botões */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold), #d97706);
    color: #0b0f19;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #fbbf24, var(--gold));
    color: #000;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-outline:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.btn-danger {
    background: #dc2626;
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

.btn-block {
    width: 100%;
}

/* Alertas Flash */
.flash-alert {
    padding: 12px 18px;
    border-radius: var(--radius-md);
    margin: 20px 0;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.flash-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #34d399;
}

.flash-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #f87171;
}

.flash-warning {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #fbbf24;
}

/* Hero Section */
.hero-section {
    padding: 40px 0 20px;
    text-align: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    padding: 6px 16px;
    border-radius: var(--radius-full);
    color: var(--gold);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.hero-title {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 12px;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

/* Grid de Rifas na Home */
.raffles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    margin: 40px 0 60px;
}

.raffle-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
}

.raffle-card:hover {
    transform: translateY(-5px);
    border-color: rgba(245, 158, 11, 0.5);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.6), var(--shadow-glow);
}

.raffle-card-image {
    position: relative;
    width: 100%;
    height: 200px;
    background: #0f172a;
    overflow: hidden;
}

.raffle-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.raffle-card:hover .raffle-card-image img {
    transform: scale(1.05);
}

.raffle-price-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(11, 15, 25, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid var(--gold);
    color: var(--gold);
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.9rem;
}

.raffle-status-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-active { background: #10b981; color: white; }
.badge-finished { background: #64748b; color: white; }
.badge-live { background: #ef4444; color: white; animation: pulse 1.5s infinite; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.raffle-card-body {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.raffle-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-main);
}

.raffle-card-desc {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 16px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Barra de Progresso */
.progress-container {
    margin: auto 0 16px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.progress-bar-bg {
    width: 100%;
    height: 8px;
    background: var(--bg-input);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, var(--gold));
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
}

/* Detalhe da Rifa & Seleção de Números */
.raffle-detail-header {
    margin: 30px 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

@media (max-width: 768px) {
    .raffle-detail-header {
        grid-template-columns: 1fr;
    }
}

.raffle-media {
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
}

.raffle-media img {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
}

/* Live do YouTube */
.youtube-live-box {
    background: #0f172a;
    border: 2px solid #ef4444;
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.3);
}

.youtube-live-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ef4444;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.video-responsive {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: var(--radius-md);
}

.video-responsive iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Seletor Rápido de Cotas */
.quick-picks-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 30px;
}

.quick-picks-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.quick-picks-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.quick-pick-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-pick-btn:hover {
    background: var(--gold);
    color: #0b0f19;
    border-color: var(--gold);
    transform: translateY(-2px);
}

/* Grid de Números */
.numbers-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 0.85rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.color-available { background: #334155; }
.color-selected { background: var(--gold); }
.color-reserved { background: #eab308; }
.color-paid { background: #10b981; }

.numbers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(55px, 1fr));
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
    padding: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.number-cell {
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    background: #334155;
    color: #e2e8f0;
}

.number-cell.available:hover {
    background: #475569;
    transform: scale(1.05);
}

.number-cell.selected {
    background: var(--gold) !important;
    color: #0b0f19 !important;
    box-shadow: 0 0 10px var(--gold);
}

.number-cell.reserved {
    background: rgba(234, 179, 8, 0.3) !important;
    color: #fef08a !important;
    cursor: not-allowed;
    border: 1px dashed #eab308;
}

.number-cell.paid {
    background: rgba(16, 185, 129, 0.25) !important;
    color: #6ee7b7 !important;
    cursor: not-allowed;
    border: 1px solid #10b981;
}

/* Barra Flutuante de Checkout */
.checkout-bar {
    position: sticky;
    bottom: 20px;
    background: rgba(19, 27, 46, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid var(--gold);
    border-radius: var(--radius-lg);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), var(--shadow-glow);
    z-index: 90;
    margin: 30px 0;
}

.checkout-summary-title {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.checkout-summary-price {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--gold);
}

/* Cartões de Formulário */
.form-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 30px;
    max-width: 550px;
    margin: 40px auto;
    box-shadow: var(--shadow-card);
}

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

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

.form-control {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

.form-control:focus {
    border-color: var(--gold);
}

/* Checkout PIX */
.pix-checkout-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 30px;
    max-width: 500px;
    margin: 30px auto;
    text-align: center;
    box-shadow: var(--shadow-card);
}

.qr-code-wrapper {
    background: white;
    padding: 16px;
    border-radius: var(--radius-md);
    display: inline-block;
    margin: 20px 0;
}

.qr-code-wrapper img {
    max-width: 220px;
    display: block;
}

.pix-copy-box {
    display: flex;
    gap: 8px;
    margin-top: 15px;
}

/* Footer */
.main-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 30px 0;
    margin-top: auto;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
}
