/**
 * Sistema de Audiencias Públicas
 * Estilos personalizados
 */

/* =====================
   Variables
   ===================== */
:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --info-color: #17a2b8;
    --light-bg: #f8f9fa;
    --dark-text: #2c3e50;
}

/* =====================
   General
   ===================== */
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--dark-text);
    background-color: var(--light-bg);
}

/* Tipografía accesible */
html {
    font-size: 16px;
}

@media (max-width: 768px) {
    html {
        font-size: 15px;
    }
}

/* =====================
   Hero Section
   ===================== */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, #2980b9 100%);
    color: white;
    padding: 4rem 0;
    margin-bottom: 2rem;
}

.hero-section h1 {
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* =====================
   Cards
   ===================== */
.card {
    border-radius: 0.75rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}

.card-header {
    font-weight: 600;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* =====================
   Turno Cards
   ===================== */
.turno-card {
    cursor: pointer;
    border: 2px solid #e9ecef;
    transition: all 0.2s ease;
}

.turno-card:hover:not(.disabled) {
    border-color: var(--primary-color);
    background-color: rgba(52, 152, 219, 0.05);
    transform: scale(1.02);
}

.turno-card.disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.turno-card.reservado {
    border-color: var(--warning-color);
    background-color: rgba(243, 156, 18, 0.1);
}

.turno-card.confirmado {
    border-color: var(--info-color);
    background-color: rgba(23, 162, 184, 0.1);
}

.turno-card.presente {
    border-color: var(--success-color);
    background-color: rgba(39, 174, 96, 0.1);
}

/* =====================
   Admin Sidebar
   ===================== */
.admin-sidebar {
    background: linear-gradient(180deg, var(--secondary-color) 0%, #1a252f 100%);
    min-height: 100vh;
    position: fixed;
    width: 260px;
    left: 0;
    top: 0;
    z-index: 1000;
    padding-top: 0;
}

.admin-sidebar .nav-link {
    color: rgba(255, 255, 255, 0.7);
    padding: 0.75rem 1.25rem;
    border-radius: 0.5rem;
    margin: 0.2rem 0.75rem;
    transition: all 0.2s ease;
}

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

.admin-sidebar .nav-link.active {
    color: white;
    background-color: var(--primary-color);
}

.admin-sidebar .nav-link i {
    width: 24px;
    text-align: center;
    margin-right: 0.5rem;
}

.sidebar-brand {
    padding: 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1rem;
}

/* =====================
   Admin Content
   ===================== */
.admin-content {
    margin-left: 260px;
    min-height: 100vh;
    background-color: var(--light-bg);
}

.admin-header {
    background: white;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e9ecef;
    position: sticky;
    top: 0;
    z-index: 100;
}

@media (max-width: 991.98px) {
    .admin-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .admin-sidebar.show {
        transform: translateX(0);
    }
    
    .admin-content {
        margin-left: 0;
    }
}

/* =====================
   Forms
   ===================== */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

/* Large form controls for accessibility */
.form-control-lg,
.btn-lg {
    font-size: 1.1rem;
    padding: 0.75rem 1.25rem;
}

/* =====================
   Buttons
   ===================== */
.btn {
    font-weight: 500;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

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

.btn-primary:hover {
    background-color: #2980b9;
    border-color: #2980b9;
}

/* =====================
   Badges
   ===================== */
.badge {
    font-weight: 500;
    padding: 0.4em 0.8em;
}

/* =====================
   Tables
   ===================== */
.table th {
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6c757d;
}

.table-hover tbody tr:hover {
    background-color: rgba(52, 152, 219, 0.05);
}

/* =====================
   Countdown Timer
   ===================== */
#countdown {
    font-family: 'Courier New', monospace;
    font-size: 3rem;
    letter-spacing: 0.1em;
}

#countdown.text-danger {
    animation: pulse 1s infinite;
}

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

/* =====================
   Voucher
   ===================== */
.voucher-card {
    border: 2px dashed #dee2e6;
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
}

/* =====================
   Alerts
   ===================== */
.alert {
    border-radius: 0.5rem;
    border: none;
}

.alert-success {
    background-color: rgba(39, 174, 96, 0.1);
    color: #155724;
}

.alert-danger {
    background-color: rgba(231, 76, 60, 0.1);
    color: #721c24;
}

.alert-warning {
    background-color: rgba(243, 156, 18, 0.1);
    color: #856404;
}

.alert-info {
    background-color: rgba(23, 162, 184, 0.1);
    color: #0c5460;
}

/* =====================
   Footer
   ===================== */
.footer {
    background-color: var(--secondary-color);
    color: rgba(255, 255, 255, 0.7);
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
}

.footer a:hover {
    color: white;
}

/* =====================
   Login Page
   ===================== */
.login-container {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color) 0%, #2980b9 50%, var(--secondary-color) 100%);
}

.login-card {
    border-radius: 1rem;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.2);
}

.btn-login {
    padding: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
}

/* =====================
   Progress Bar
   ===================== */
.progress {
    border-radius: 0.5rem;
    overflow: hidden;
}

.progress-bar {
    transition: width 0.5s ease;
}

/* =====================
   Pagination
   ===================== */
.pagination .page-link {
    color: var(--primary-color);
    border-color: #dee2e6;
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* =====================
   Accessibility
   ===================== */
.btn:focus,
.form-control:focus,
.form-select:focus,
.nav-link:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid #000;
    }
    
    .btn-primary {
        background-color: #0056b3;
    }
}

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

/* =====================
   Print Styles
   ===================== */
@media print {
    .admin-sidebar,
    .no-print,
    .btn,
    nav {
        display: none !important;
    }
    
    .admin-content {
        margin-left: 0 !important;
    }
    
    .card {
        border: 1px solid #000 !important;
        break-inside: avoid;
    }
}
