/**
 * styles.css - Estilos principales para el sistema de rifas benéficas
 * Diseño moderno, responsivo y atractivo con tema de caridad
 */

/* ================================
   VARIABLES CSS Y RESET
   ================================ */

:root {
    /* Paleta de colores principal */
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary-color: #10b981;
    --secondary-dark: #059669;
    
    /* Colores de estado */
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    
    /* Colores neutros */
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Tipografía */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;
    
    /* Espaciado */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    
    /* Bordes y sombras */
    --border-radius-sm: 0.375rem;
    --border-radius: 0.5rem;
    --border-radius-lg: 0.75rem;
    --border-radius-xl: 1rem;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Transiciones */
    --transition-fast: 150ms ease-in-out;
    --transition-normal: 300ms ease-in-out;
    --transition-slow: 500ms ease-in-out;
}

/* Reset básico */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
    font-family: var(--font-family);
}

body {
    margin: 0;
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--gray-800);
    background-color: var(--gray-50);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ================================
   UTILIDADES GENERALES
   ================================ */

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-4);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ================================
   NAVEGACIÓN
   ================================ */

.navbar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    z-index: 50;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-6);
    max-width: 1200px;
    margin: 0 auto;
}

.nav-logo h2 {
    color: var(--white);
    font-size: var(--font-size-xl);
    font-weight: 700;
    margin: 0;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-6);
}

.nav-link {
    color: var(--white);
    text-decoration: none;
    font-weight: 500;
    padding: var(--space-2) var(--space-4);
    border-radius: var(--border-radius);
    transition: all var(--transition-fast);
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: var(--font-size-base);
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.admin-link {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.admin-nav {
    background: linear-gradient(135deg, var(--gray-800) 0%, var(--gray-900) 100%);
}

.admin-body .navbar {
    background: linear-gradient(135deg, var(--gray-800) 0%, var(--gray-900) 100%);
}

.user-info {
    color: var(--gray-300);
    font-size: var(--font-size-sm);
    margin-right: var(--space-4);
}

.logout-btn {
    background: var(--error-color) !important;
    color: var(--white) !important;
}

.logout-btn:hover {
    background: #dc2626 !important;
}

/* ================================
   HERO SECTION
   ================================ */

.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: var(--space-20) 0;
    color: var(--white);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Ccircle cx='30' cy='30' r='4'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-content {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-16);
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-6);
    align-items: center;
}

.hero-title {
    font-size: var(--font-size-4xl);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: var(--space-6);
}

.hero-subtitle {
    display: block;
    font-size: var(--font-size-xl);
    font-weight: 500;
    opacity: 0.9;
    margin-top: var(--space-2);
}

.hero-description {
    font-size: var(--font-size-lg);
    opacity: 0.9;
    margin-bottom: var(--space-8);
}

.hero-stats {
    display: flex;
    align-items: center;
    gap: var(--space-6);
    margin-bottom: var(--space-6);
}

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

.stat-number {
    font-size: var(--font-size-3xl);
    font-weight: 800;
    line-height: 1;
}

.stat-label {
    font-size: var(--font-size-sm);
    opacity: 0.8;
    margin-top: var(--space-1);
}

.stat-divider {
    font-size: var(--font-size-xl);
    font-weight: 600;
    opacity: 0.7;
}

.progress-container {
    margin-bottom: var(--space-8);
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--white) 0%, rgba(255, 255, 255, 0.8) 100%);
    border-radius: var(--border-radius-lg);
    transition: width var(--transition-slow);
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-percentage {
    font-size: var(--font-size-sm);
    font-weight: 600;
    margin-top: var(--space-2);
    opacity: 0.9;
}

.hero-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius-xl);
    padding: var(--space-8);
    box-shadow: var(--shadow-xl);
}

.card-header h3 {
    font-size: var(--font-size-xl);
    font-weight: 700;
    margin-bottom: var(--space-6);
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-3) 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 500;
    opacity: 0.9;
}

.info-value {
    font-weight: 600;
}

/* ================================
   SECCIÓN GANADOR
   ================================ */

.winner-section {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
    padding: var(--space-16) 0;
    color: var(--white);
    text-align: center;
}

.winner-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 var(--space-6);
}

.winner-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius-xl);
    padding: var(--space-10);
    box-shadow: var(--shadow-xl);
}

.winner-header h2 {
    font-size: var(--font-size-3xl);
    font-weight: 800;
    margin-bottom: var(--space-8);
}

.winning-number, .winner-name, .winner-date {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-4) 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: var(--font-size-lg);
}

.winner-date {
    border-bottom: none;
}

.number-value, .winner-value {
    font-weight: 800;
    font-size: var(--font-size-xl);
}

/* ================================
   SECCIONES GENERALES
   ================================ */

.section-title {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    text-align: center;
    margin-bottom: var(--space-12);
    color: var(--gray-800);
}

.how-it-works {
    padding: var(--space-20) 0;
    background: var(--white);
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-8);
}

.step-card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    padding: var(--space-8);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    transition: all var(--transition-normal);
    position: relative;
    text-align: center;
}

.step-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.step-number {
    position: absolute;
    top: -15px;
    left: var(--space-6);
    width: 30px;
    height: 30px;
    background: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: var(--font-size-sm);
}

.step-content h3 {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-bottom: var(--space-3);
    color: var(--gray-800);
}

.step-content p {
    color: var(--gray-600);
    line-height: 1.6;
}

.quick-actions {
    padding: var(--space-20) 0;
    background: var(--gray-100);
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-8);
}

.action-card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    padding: var(--space-8);
    box-shadow: var(--shadow);
    text-align: center;
    transition: all var(--transition-normal);
}

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

.action-icon {
    font-size: var(--font-size-4xl);
    margin-bottom: var(--space-4);
}

.action-content h3 {
    font-size: var(--font-size-xl);
    font-weight: 600;
    margin-bottom: var(--space-4);
    color: var(--gray-800);
}

.action-content p {
    color: var(--gray-600);
    margin-bottom: var(--space-6);
}

/* ================================
   BOTONES
   ================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-3) var(--space-6);
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: var(--font-size-base);
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    gap: var(--space-2);
    position: relative;
    overflow: hidden;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-800);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--gray-300);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--success-color);
    color: var(--white);
}

.btn-success:hover:not(:disabled) {
    background: var(--secondary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover:not(:disabled) {
    background: var(--primary-color);
    color: var(--white);
}

.btn-small {
    padding: var(--space-2) var(--space-4);
    font-size: var(--font-size-sm);
}

.btn-large {
    padding: var(--space-4) var(--space-8);
    font-size: var(--font-size-lg);
}

.action-button {
    background: var(--primary-color);
    color: var(--white);
    padding: var(--space-3) var(--space-6);
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    transition: all var(--transition-fast);
}

.action-button:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

/* ================================
   FOOTER
   ================================ */

.footer {
    background: var(--gray-800);
    color: var(--gray-300);
    padding: var(--space-16) 0 var(--space-8);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-8);
    margin-bottom: var(--space-8);
}

.footer-section h4 {
    color: var(--white);
    font-weight: 600;
    margin-bottom: var(--space-4);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: var(--space-2);
}

.footer-links a {
    color: var(--gray-400);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--white);
}

.footer-bottom {
    text-align: center;
    padding-top: var(--space-8);
    border-top: 1px solid var(--gray-700);
    color: var(--gray-400);
}

/* ================================
   PÁGINA DE CONSULTA
   ================================ */

.consulta-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: var(--space-8) var(--space-6);
}

.consulta-header {
    text-align: center;
    margin-bottom: var(--space-12);
}

.consulta-header h1 {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: var(--space-4);
}

.consulta-header p {
    font-size: var(--font-size-lg);
    color: var(--gray-600);
}

.search-section {
    margin-bottom: var(--space-12);
}

.search-card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    padding: var(--space-8);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
}

.consulta-form .form-group {
    margin-bottom: 0;
}

.id-input-container {
    display: flex;
    gap: var(--space-4);
    align-items: flex-end;
}

.id-input-container input {
    flex: 1;
}

.form-help {
    margin-top: var(--space-3);
    font-size: var(--font-size-sm);
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.results-section {
    margin-bottom: var(--space-12);
}

.comprador-card, .boletos-card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    padding: var(--space-8);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    margin-bottom: var(--space-8);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--gray-200);
}

.card-header h3 {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--gray-800);
    margin: 0;
}

.comprador-info, .sorteo-info {
    display: grid;
    gap: var(--space-4);
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--gray-100);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 500;
    color: var(--gray-600);
}

.info-value {
    font-weight: 600;
    color: var(--gray-800);
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-6);
    margin-bottom: var(--space-8);
}

.summary-card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    padding: var(--space-6);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    text-align: center;
}

.summary-icon {
    font-size: var(--font-size-2xl);
    margin-bottom: var(--space-3);
}

.summary-number {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: var(--space-1);
}

.summary-label {
    font-size: var(--font-size-sm);
    color: var(--gray-600);
    font-weight: 500;
}

.boletos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: var(--space-4);
}

.boleto-card {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    padding: var(--space-4);
    transition: all var(--transition-fast);
}

.boleto-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
}

.boleto-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-3);
}

.boleto-numero {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--primary-color);
    font-family: 'Courier New', monospace;
}

.boleto-precio {
    font-weight: 600;
    color: var(--success-color);
}

.boleto-fecha {
    font-size: var(--font-size-xs);
    color: var(--gray-500);
}

.winner-check {
    margin-bottom: var(--space-8);
}

.winner-status {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    padding: var(--space-8);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
}

.status-pending, .status-winner, .status-finished {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.status-icon {
    font-size: var(--font-size-3xl);
    flex-shrink: 0;
}

.status-winner {
    color: var(--success-color);
}

.status-winner .status-icon {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0,0,0);
    }
    40%, 43% {
        transform: translate3d(0, -20px, 0);
    }
    70% {
        transform: translate3d(0, -10px, 0);
    }
    90% {
        transform: translate3d(0, -4px, 0);
    }
}

.status-finished {
    color: var(--gray-600);
}

.status-text h4 {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-bottom: var(--space-2);
}

.status-text p {
    margin-bottom: var(--space-2);
    line-height: 1.5;
}

.status-text p:last-child {
    margin-bottom: 0;
}

.no-results {
    text-align: center;
    margin-bottom: var(--space-12);
}

.no-results-card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    padding: var(--space-12);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
}

.no-results-icon {
    font-size: var(--font-size-4xl);
    margin-bottom: var(--space-6);
}

.no-results-card h3 {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: var(--space-4);
}

.no-results-card p {
    color: var(--gray-600);
    margin-bottom: var(--space-4);
}

.instructions-section {
    margin-bottom: var(--space-12);
}

.instructions-card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    padding: var(--space-8);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
}

.instructions-card h3 {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: var(--space-6);
    text-align: center;
}

.instructions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-6);
}

.instruction-item {
    text-align: center;
    padding: var(--space-4);
}

.instruction-number {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: var(--font-size-lg);
    margin: 0 auto var(--space-4);
}

.instruction-content h4 {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: var(--space-2);
}

.instruction-content p {
    color: var(--gray-600);
    font-size: var(--font-size-sm);
    line-height: 1.5;
}

.back-section {
    text-align: center;
}

/* ================================
   PANEL DE ADMINISTRACIÓN
   ================================ */

.admin-body {
    background: var(--gray-100);
}

.admin-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-8) var(--space-6);
}

.admin-section {
    margin-bottom: var(--space-12);
}

/* Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-6);
    margin-bottom: var(--space-8);
}

.admin-stat {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    padding: var(--space-6);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: var(--space-4);
    transition: all var(--transition-fast);
}

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

.stat-icon {
    font-size: var(--font-size-2xl);
    width: 60px;
    height: 60px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
}

.stat-info {
    flex: 1;
}

.admin-stat .stat-number {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

.admin-stat .stat-label {
    font-size: var(--font-size-sm);
    color: var(--gray-600);
    font-weight: 500;
    margin-top: var(--space-1);
}

/* Sistema de pestañas */
.tab-container {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

.tab-buttons {
    display: flex;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.tab-btn {
    flex: 1;
    padding: var(--space-4) var(--space-6);
    border: none;
    background: transparent;
    color: var(--gray-600);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.tab-btn:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

.tab-btn.active {
    background: var(--white);
    color: var(--primary-color);
    font-weight: 600;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
}

.tab-content {
    display: none;
    padding: var(--space-8);
}

.tab-content.active {
    display: block;
}

.tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-8);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--gray-200);
}

.tab-header h3 {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--gray-800);
    margin: 0;
}

.tab-header p {
    color: var(--gray-600);
    margin: var(--space-2) 0 0;
}

.admin-warning {
    background: var(--warning-color);
    color: var(--white);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--border-radius);
    font-size: var(--font-size-sm);
    font-weight: 500;
}

/* Formularios admin */
.admin-form {
    max-width: 800px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-6);
    margin-bottom: var(--space-6);
}

.form-group {
    margin-bottom: var(--space-6);
}

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: var(--space-2);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: var(--space-3);
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    font-size: var(--font-size-base);
    transition: all var(--transition-fast);
    background: var(--white);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.number-input-container,
.winner-input-container {
    display: flex;
    gap: var(--space-3);
    align-items: flex-end;
}

.number-input-container input,
.winner-input-container input {
    flex: 1;
}

.numero-status {
    margin-top: var(--space-2);
    font-size: var(--font-size-sm);
    font-weight: 600;
}

.status-available {
    color: var(--success-color);
}

.status-taken {
    color: var(--error-color);
}

.status-error {
    color: var(--error-color);
}

/* Tablas admin */
.table-container {
    overflow-x: auto;
    border-radius: var(--border-radius);
    border: 1px solid var(--gray-200);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
}

.admin-table th {
    background: var(--gray-50);
    padding: var(--space-4);
    text-align: left;
    font-weight: 600;
    color: var(--gray-700);
    border-bottom: 1px solid var(--gray-200);
    font-size: var(--font-size-sm);
}

.admin-table td {
    padding: var(--space-4);
    border-bottom: 1px solid var(--gray-200);
    color: var(--gray-800);
    font-size: var(--font-size-sm);
}

.admin-table tr:hover {
    background: var(--gray-50);
}

.loading-row,
.empty-row {
    text-align: center;
    padding: var(--space-8) !important;
    color: var(--gray-500);
    font-style: italic;
}

/* Sección sorteo */
.sorteo-section {
    max-width: 600px;
}

.sorteo-card {
    background: var(--gray-50);
    border-radius: var(--border-radius);
    padding: var(--space-6);
    margin-bottom: var(--space-8);
    border: 1px solid var(--gray-200);
}

.sorteo-card h4 {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: var(--space-4);
}

.sorteo-actions {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: var(--space-6);
    border: 1px solid var(--gray-200);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-3);
    border-radius: var(--border-radius-sm);
    font-size: var(--font-size-xs);
    font-weight: 600;
    background: var(--gray-100);
    color: var(--gray-600);
}

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

.badge-info {
    background: var(--info-color);
    color: var(--white);
}

.badge-warning {
    background: var(--warning-color);
    color: var(--white);
}

/* ================================
   MODAL DE LOGIN
   ================================ */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: var(--space-4);
}

.modal-content {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    padding: var(--space-8);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 400px;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    text-align: center;
    margin-bottom: var(--space-8);
}

.modal-header h2 {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: var(--space-2);
}

.modal-header p {
    color: var(--gray-600);
    font-size: var(--font-size-sm);
}

.login-form .form-group {
    margin-bottom: var(--space-6);
}

.login-form button {
    width: 100%;
    margin-top: var(--space-4);
}

/* ================================
   LOADING Y TOAST
   ================================ */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: var(--space-4);
}

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

.loading-text {
    color: var(--gray-600);
    font-weight: 500;
}

.toast-container {
    position: fixed;
    top: var(--space-6);
    right: var(--space-6);
    z-index: 150;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    max-width: 400px;
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    animation: toastSlideIn 0.3s ease-out;
    border-left: 4px solid;
    background: var(--white);
}

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

.toast-success {
    border-left-color: var(--success-color);
}

.toast-error {
    border-left-color: var(--error-color);
}

.toast-warning {
    border-left-color: var(--warning-color);
}

.toast-info {
    border-left-color: var(--info-color);
}

.toast-icon {
    font-size: var(--font-size-lg);
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    color: var(--gray-800);
    font-weight: 500;
}

.toast-close {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    font-size: var(--font-size-lg);
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-close:hover {
    color: var(--gray-600);
}

/* ================================
   RESPONSIVE DESIGN
   ================================ */

@media (max-width: 1024px) {
    .hero-content {
        grid-template-columns: 1fr;
        gap: var(--space-12);
        text-align: center;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .id-input-container,
    .number-input-container,
    .winner-input-container {
        flex-direction: column;
        gap: var(--space-3);
    }
    
    .id-input-container input,
    .number-input-container input,
    .winner-input-container input {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: var(--space-4);
    }
    
    .nav-links {
        gap: var(--space-3);
    }
    
    .hero {
        padding: var(--space-16) 0;
    }
    
    .hero-title {
        font-size: var(--font-size-3xl);
    }
    
    .hero-subtitle {
        font-size: var(--font-size-lg);
    }
    
    .hero-stats {
        flex-direction: column;
        gap: var(--space-4);
    }
    
    .stat-divider {
        display: none;
    }
    
    .steps-grid,
    .actions-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: var(--space-4);
    }
    
    .tab-buttons {
        flex-direction: column;
    }
    
    .tab-btn {
        text-align: center;
        padding: var(--space-3) var(--space-4);
        font-size: var(--font-size-sm);
    }
    
    .tab-content {
        padding: var(--space-4);
    }
    
    .tab-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-3);
    }
    
    .summary-grid {
        grid-template-columns: 1fr;
    }
    
    .boletos-grid {
        grid-template-columns: 1fr;
    }
    
    .instructions-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-table {
        font-size: var(--font-size-xs);
    }
    
    .admin-table th,
    .admin-table td {
        padding: var(--space-2);
    }
    
    .toast-container {
        top: var(--space-4);
        right: var(--space-4);
        left: var(--space-4);
        max-width: none;
    }
}

@media (max-width: 480px) {
    .container,
    .consulta-container,
    .admin-container {
        padding: 0 var(--space-3);
    }
    
    .hero-content {
        padding: 0 var(--space-3);
    }
    
    .hero-card {
        padding: var(--space-6);
    }
    
    .search-card,
    .comprador-card,
    .boletos-card,
    .instructions-card,
    .no-results-card {
        padding: var(--space-4);
    }
    
    .modal {
        padding: var(--space-3);
    }
    
    .modal-content {
        padding: var(--space-6);
    }
    
    .btn {
        padding: var(--space-2) var(--space-4);
        font-size: var(--font-size-sm);
    }
    
    .btn-large {
        padding: var(--space-3) var(--space-6);
        font-size: var(--font-size-base);
    }
}

/* ================================
   PRINT STYLES
   ================================ */

@media print {
    .navbar,
    .footer,
    .loading-overlay,
    .toast-container,
    .btn,
    .action-button {
        display: none !important;
    }
    
    body {
        background: var(--white) !important;
        color: var(--gray-900) !important;
    }
    
    .hero {
        background: var(--white) !important;
        color: var(--gray-900) !important;
    }
    
    .hero-card {
        border: 1px solid var(--gray-300) !important;
        background: var(--white) !important;
    }
    
    .boleto-card,
    .summary-card,
    .admin-stat {
        border: 1px solid var(--gray-300) !important;
        box-shadow: none !important;
    }
}

/* ================================
   ACCESSIBILITY
   ================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    ::before,
    ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

.sr-only:focus {
    position: static;
    width: auto;
    height: auto;
    padding: 0;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* Focus styles */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --gray-100: #f0f0f0;
        --gray-800: #000000;
        --primary-color: #0000ff;
        --success-color: #008000;
        --error-color: #ff0000;
        --warning-color: #ff8000;
    }
}

/* ============================================
   ESTILOS PARA SECCIONES DE LISTAS (COMPRADORES Y BOLETOS)
   Agregar al final del archivo style.css existente
   ============================================ */

/* Contenedor de sección de listas */
.list-section {
    margin-top: 30px;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Barra de búsqueda y filtros */
.search-filter {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-filter input {
    flex: 1;
    min-width: 250px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.search-filter input:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.1);
}

.search-filter button {
    padding: 10px 20px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s;
}

.search-filter button:hover {
    background-color: #45a049;
}

.search-filter button:active {
    transform: scale(0.98);
}

/* Contenedor de tabla con scroll */
.table-container {
    overflow-x: auto;
    margin-top: 15px;
}

.table-container table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.table-container th {
    background-color: #4CAF50;
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
}

.table-container td {
    padding: 10px 12px;
    border-bottom: 1px solid #ddd;
    vertical-align: top;
}

.table-container tbody tr {
    transition: background-color 0.2s;
}

.table-container tbody tr:hover {
    background-color: #f5f5f5;
}

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

/* Estilo para números de boletos en tabla de compradores */
.numeros-boletos {
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #333;
    max-width: 300px;
    word-wrap: break-word;
    line-height: 1.6;
}

/* Badge para cantidad de boletos */
.cantidad-badge {
    background-color: #2196F3;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: bold;
    display: inline-block;
    font-size: 0.9em;
}

/* Estilo para número de boleto en tabla de boletos vendidos */
.numero-boleto {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 1.1em;
    color: #4CAF50;
}

/* ============================================
   ESTADÍSTICAS DE BOLETOS
   ============================================ */

.stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.stat-label {
    font-size: 0.9em;
    opacity: 0.9;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.8em;
    font-weight: bold;
    margin-top: 5px;
}

/* ============================================
   MEJORAS PARA FORMULARIOS
   ============================================ */

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 0.85em;
}

.form-group select,
.form-group input {
    width: 100%;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .search-filter {
        flex-direction: column;
    }
    
    .search-filter input {
        width: 100%;
        min-width: 100%;
    }
    
    .search-filter button {
        width: 100%;
    }
    
    .stats-summary {
        grid-template-columns: 1fr;
    }
    
    .table-container {
        overflow-x: scroll;
        -webkit-overflow-scrolling: touch;
    }
    
    .numeros-boletos {
        max-width: 200px;
        font-size: 0.8em;
    }
}

@media (max-width: 480px) {
    .list-section {
        padding: 15px;
    }
    
    .table-container th,
    .table-container td {
        padding: 8px;
        font-size: 0.9em;
    }
    
    .stat-value {
        font-size: 1.5em;
    }
}