/* =========================================
   RifasBeneficio - Custom Styles
   ========================================= */

:root {
    --primary: #6c3fc0;
    --primary-dark: #5530a3;
    --primary-light: #8b5cf6;
    --secondary: #f59e0b;
    --secondary-dark: #d97706;
    --success: #10b981;
    --success-dark: #059669;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --dark: #1e1b4b;
    --light: #f8f7ff;
    --gray: #6b7280;
}

/* ---- Base ---- */
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: #f8f7ff;
    color: #1e1b4b;
}

/* ---- Navbar ---- */
.bg-primary-custom {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%) !important;
}

.navbar-brand {
    letter-spacing: -0.5px;
}

.avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--secondary);
    color: var(--dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

/* ---- Hero Section ---- */
.hero-section {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 50%, #3b0764 100%);
    min-height: 520px;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(245,158,11,0.15) 0%, transparent 70%);
    pointer-events: none;
}

.hero-section::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(139,92,246,0.3) 0%, transparent 70%);
    pointer-events: none;
}

.hero-badge {
    background: rgba(245,158,11,0.2);
    border: 1px solid rgba(245,158,11,0.4);
    color: var(--secondary);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 1rem;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.15;
    color: #fff;
}

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

.hero-floating-card {
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 20px;
    padding: 24px;
    color: white;
}

/* ---- CTA Cards ---- */
.cta-card {
    border: none;
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    display: block;
    color: inherit;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.cta-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(108,63,192,0.2);
    color: inherit;
    text-decoration: none;
}

.cta-card.primary-cta {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
}

.cta-card.secondary-cta {
    background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
    color: white;
}

.cta-card.dark-cta {
    background: linear-gradient(135deg, var(--dark), #312e81);
    color: white;
}

.cta-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.9;
}

/* ---- Rifa Cards ---- */
.rifa-card {
    border: none;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: white;
}

.rifa-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 48px rgba(108,63,192,0.15);
}

.rifa-card-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
}

.rifa-card-img-placeholder {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: rgba(255,255,255,0.6);
}

.rifa-card .card-body {
    padding: 1.5rem;
}

.rifa-price-badge {
    background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
    color: white;
    padding: 4px 14px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.95rem;
}

.rifa-progress {
    height: 8px;
    border-radius: 4px;
    background: #e5e7eb;
    overflow: hidden;
}

.rifa-progress-bar {
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 4px;
    transition: width 0.6s ease;
}

/* ---- Countdown Timer ---- */
.countdown-timer {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.countdown-block {
    background: var(--dark);
    color: white;
    border-radius: 10px;
    padding: 8px 12px;
    text-align: center;
    min-width: 52px;
}

.countdown-value {
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1;
    color: var(--secondary);
    display: block;
}

.countdown-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.7;
    display: block;
}

/* ---- Number Grid ---- */
.numeros-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
    gap: 8px;
    padding: 1rem;
}

.numero-btn {
    width: 100%;
    aspect-ratio: 1;
    border: 2px solid transparent;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.numero-disponible {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    border-color: var(--success);
    color: var(--success-dark);
}

.numero-disponible:hover {
    background: var(--success);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(16,185,129,0.4);
    z-index: 1;
    position: relative;
}

.numero-reservado {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-color: var(--warning);
    color: #92400e;
    cursor: not-allowed;
}

.numero-confirmado {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    border-color: var(--danger);
    color: #991b1b;
    cursor: not-allowed;
}

.numero-mio {
    background: linear-gradient(135deg, #ede9fe, #ddd6fe);
    border-color: var(--primary);
    color: var(--primary-dark);
    cursor: not-allowed;
    position: relative;
}

.numero-mio::after {
    content: '★';
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 0.5rem;
    color: var(--primary);
}

/* ---- Legend ---- */
.grid-legend {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--gray);
}

.legend-dot {
    width: 20px;
    height: 20px;
    border-radius: 5px;
    border: 2px solid transparent;
}

/* ---- Forms ---- */
.form-card {
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 8px 32px rgba(108,63,192,0.1);
    border: 1px solid rgba(108,63,192,0.08);
}

.form-control, .form-select {
    border-radius: 10px;
    border: 1.5px solid #e5e7eb;
    padding: 0.65rem 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(108,63,192,0.15);
}

/* ---- Buttons ---- */
.btn-primary-custom {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border: none;
    color: white;
    border-radius: 10px;
    padding: 0.6rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary-custom:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108,63,192,0.3);
    color: white;
}

.btn-warning-custom {
    background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
    border: none;
    color: white;
    border-radius: 10px;
    padding: 0.6rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-warning-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245,158,11,0.35);
    color: white;
}

/* ---- Dashboard Stats ---- */
.stat-card {
    border: none;
    border-radius: 20px;
    padding: 1.5rem;
    color: white;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.stat-card::after {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 100px;
    height: 100px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}

.stat-card .stat-icon {
    font-size: 2.5rem;
    opacity: 0.8;
    position: relative;
    z-index: 1;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 800;
    position: relative;
    z-index: 1;
}

.stat-card.purple { background: linear-gradient(135deg, var(--primary), var(--primary-light)); }
.stat-card.amber  { background: linear-gradient(135deg, var(--secondary-dark), var(--secondary)); }
.stat-card.green  { background: linear-gradient(135deg, var(--success-dark), var(--success)); }
.stat-card.blue   { background: linear-gradient(135deg, #1d4ed8, #3b82f6); }
.stat-card.red    { background: linear-gradient(135deg, #b91c1c, var(--danger)); }

/* ---- Table Styles ---- */
.table-custom {
    border-collapse: separate;
    border-spacing: 0 6px;
}

.table-custom tbody tr {
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border-radius: 10px;
}

.table-custom tbody tr td:first-child {
    border-radius: 10px 0 0 10px;
}

.table-custom tbody tr td:last-child {
    border-radius: 0 10px 10px 0;
}

/* ---- Panel Sidebar ---- */
.panel-sidebar {
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
    min-height: 100vh;
    padding: 2rem 1rem;
    color: white;
}

.sidebar-nav .nav-link {
    color: rgba(255,255,255,0.75);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    margin-bottom: 4px;
    transition: all 0.2s;
    font-weight: 500;
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
    background: rgba(255,255,255,0.15);
    color: white;
}

.sidebar-nav .nav-link i {
    width: 24px;
}

/* ---- Steps Section ---- */
.step-card {
    text-align: center;
    padding: 2rem 1rem;
}

.step-number {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0 auto 1rem;
    box-shadow: 0 8px 24px rgba(108,63,192,0.35);
}

/* ---- Section Titles ---- */
.section-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--dark);
    position: relative;
    margin-bottom: 0.5rem;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 2px;
    margin-top: 8px;
}

.section-title.centered::after {
    margin: 8px auto 0;
}

/* ---- Upload Area ---- */
.upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: #fafafa;
}

.upload-area:hover, .upload-area.dragover {
    border-color: var(--primary);
    background: rgba(108,63,192,0.05);
}

/* ---- Modal styles ---- */
.modal-content {
    border-radius: 20px;
    border: none;
    box-shadow: 0 24px 64px rgba(0,0,0,0.15);
}

.modal-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    border-radius: 20px 20px 0 0;
    border-bottom: none;
    padding: 1.5rem 2rem;
}

.modal-header .btn-close {
    filter: invert(1);
}

.modal-body {
    padding: 2rem;
}

/* ---- Comprobante image ---- */
.comprobante-img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 10px;
    object-fit: contain;
    border: 1px solid #e5e7eb;
}

/* ---- Footer ---- */
.footer-custom {
    background: linear-gradient(135deg, var(--dark) 0%, #312e81 100%);
}

.footer-custom a:hover {
    color: var(--secondary) !important;
    text-decoration: none;
}

/* ---- Utility ---- */
.text-primary-custom { color: var(--primary) !important; }
.text-secondary-custom { color: var(--secondary) !important; }
.bg-primary-gradient { background: linear-gradient(135deg, var(--primary), var(--primary-light)); }

.rounded-xl { border-radius: 1rem; }
.rounded-2xl { border-radius: 1.5rem; }

.shadow-purple { box-shadow: 0 8px 32px rgba(108,63,192,0.2); }
.shadow-amber  { box-shadow: 0 8px 32px rgba(245,158,11,0.25); }

/* ---- Responsive tweaks ---- */
@media (max-width: 768px) {
    .hero-section { min-height: 400px; }
    .numeros-grid { grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; }
    .numero-btn { font-size: 0.75rem; }
    .countdown-block { min-width: 44px; padding: 6px 8px; }
    .countdown-value { font-size: 1.1rem; }
    .form-card { padding: 1.5rem; }
}

/* ---- Animations ---- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.animate-fade-up {
    animation: fadeInUp 0.6s ease forwards;
}

.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }

/* ---- Number grid filter ---- */
.grid-filter-btn {
    border-radius: 50px;
    padding: 6px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.grid-filter-btn.active, .grid-filter-btn:hover {
    transform: scale(1.05);
}

/* ---- Loading spinner overlay ---- */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(30,27,75,0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---- Payment status timeline ---- */
.status-timeline {
    position: relative;
    padding-left: 2rem;
}

.status-timeline::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e5e7eb;
}

.timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
}

.timeline-dot {
    position: absolute;
    left: -1.6rem;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid white;
    top: 4px;
}
