/* ==========================================================================
   DISEÑO CSS PREMIUM - CLÍNICA ODONTOVIDA
   ========================================================================== */

/* Variables del Sistema de Diseño */
:root {
    --primary: #0a8491;
    --primary-hover: #086b75;
    --primary-light: #e0f2f1;
    --secondary: #0f766e;
    --accent: #d97706;
    --accent-hover: #b45309;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px 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);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-family: 'Outfit', sans-serif;
}

/* Reset y Estilos Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-light);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

p {
    text-align: justify;
}

/* Enlaces y Utilidades */
a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.section-badge {
    display: inline-block;
    background-color: var(--primary-light);
    color: var(--primary);
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

/* Botones Premium */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    outline: none;
}

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

.btn-primary:hover:not(:disabled) {
    background-color: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(10, 132, 145, 0.35);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--bg-white);
    color: var(--primary);
    border: 2px solid var(--primary);
}

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

.btn-danger {
    background-color: #ef4444;
    color: var(--bg-white);
}

.btn-danger:hover {
    background-color: #dc2626;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}

.btn-block {
    display: width;
    width: 100%;
}

.btn:disabled {
    background-color: #cbd5e1;
    color: #94a3b8;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ==========================================================================
   CABECERA (Header)
   ========================================================================== */
.main-header {
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.clinic-logo {
    height: 70px; /* Tamaño del Logo incrementado */
    width: auto;
    object-fit: contain;
}

.clinic-name {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.5px;
    font-family: var(--font-family);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-links a {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
    position: relative;
    padding: 8px 0;
}

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

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary);
    transition: var(--transition);
}

.nav-links a:hover::after {
    width: 100%;
}

/* ==========================================================================
   SECCIÓN HÉROE (Hero Section)
   ========================================================================== */
.hero-section {
    background: linear-gradient(135deg, rgba(224,242,241,0.9) 0%, rgba(255,255,255,0.7) 100%), 
                url('assets/extraction_after.jpg') center/cover no-repeat;
    padding: 100px 20px;
    min-height: 85vh;
    display: flex;
    align-items: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.hero-brand-badge {
    display: inline-block;
    background-color: var(--secondary);
    color: var(--bg-white);
    padding: 8px 18px;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 25px;
    box-shadow: var(--shadow-sm);
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 700;
    color: var(--secondary);
    line-height: 1.2;
    margin-bottom: 20px;
}

.hero-text {
    font-size: 1.15rem;
    color: var(--text-main);
    margin-bottom: 35px;
    text-shadow: 0 1px 2px rgba(255,255,255,0.8);
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
}

/* ==========================================================================
   SECCIÓN SOBRE NOSOTROS (About Section)
   ========================================================================== */
.about-section {
    padding: 80px 20px;
    background-color: var(--bg-white);
}

.about-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 50px;
    align-items: center;
}

.about-image-wrapper {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.about-image {
    width: 100%;
    height: 480px; /* Tamaño del Retrato de la Dentista */
    object-fit: cover;
    transition: var(--transition);
}

.about-image:hover {
    transform: scale(1.03);
}

.about-details h2 {
    font-size: 2.2rem;
    color: var(--secondary);
    margin-bottom: 20px;
    line-height: 1.3;
}

.about-text {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin-bottom: 25px;
}

.about-features {
    list-style: none;
}

.about-features li {
    position: relative;
    padding-left: 28px;
    margin-bottom: 12px;
    font-weight: 500;
    font-size: 0.95rem;
}

.about-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    top: -2px;
    background-color: var(--primary-light);
    color: var(--primary);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
}

/* ==========================================================================
   SECCIÓN SERVICIOS (3 Columnas de Diseño)
   ========================================================================== */
.services-section {
    padding: 80px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-header h2 {
    font-size: 2.2rem;
    color: var(--secondary);
}

/* Layout de 3 Columnas */
.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.service-card {
    background-color: var(--bg-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

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

/* Control del contenedor de imágenes */
.service-image-container {
    position: relative;
    width: 100%;
    height: 200px; /* Tamaño de imagen de servicio */
    overflow: hidden;
}

.service-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Requisito: 2 imágenes que cambien al pasar el mouse (Hover Effect) */
.hover-image-container img {
    position: absolute;
    top: 0;
    left: 0;
    transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
                transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.hover-image-container .img-hover {
    opacity: 0;
}

.service-card:hover .hover-image-container .img-base {
    opacity: 0;
    transform: scale(1.08);
}

.service-card:hover .hover-image-container .img-hover {
    opacity: 1;
    transform: scale(1.03);
}

/* Efecto simple de zoom para la tercera tarjeta */
.simple-image-container .img-zoom {
    transition: var(--transition);
}

.service-card:hover .simple-image-container .img-zoom {
    transform: scale(1.08);
}

/* Cuerpo de la Tarjeta */
.service-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.service-body h3 {
    font-size: 1.25rem;
    color: var(--secondary);
    margin-bottom: 10px;
}

.service-body p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 20px;
    flex-grow: 1;
}

.service-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid var(--border);
}

.service-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
}

/* Badges */
.badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

.badge-success {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-primary {
    background-color: #dbeafe;
    color: #1e40af;
}

/* ==========================================================================
   SECCIÓN RESERVAS Y COTIZACIÓN (Formulario e Invoice)
   ========================================================================== */
.booking-section {
    padding: 80px 20px;
    background-color: var(--bg-white);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.booking-intro-text {
    max-width: 800px;
    margin: 15px auto 0 auto;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.booking-grid {
    max-width: 1200px;
    margin: 40px auto 0 auto;
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 40px;
    align-items: start;
}

/* Formulario */
.booking-form-wrapper {
    background-color: var(--bg-light);
    border-radius: 12px;
    padding: 30px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.form-title {
    font-size: 1.15rem;
    color: var(--secondary);
    margin-bottom: 20px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-light);
}

.form-title:not(:first-of-type) {
    margin-top: 30px;
}

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

.form-group-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

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

.form-group input[type="text"],
.form-group input[type="tel"],
.form-group input[type="email"],
.form-group input[type="date"],
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-family: var(--font-family);
    font-size: 0.95rem;
    background-color: var(--bg-white);
    outline: none;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(10, 132, 145, 0.15);
}

.form-group input.invalid,
.form-group select.invalid {
    border-color: #ef4444;
}

.form-group input.invalid:focus,
.form-group select.invalid:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.error-msg {
    color: #ef4444;
    font-size: 0.8rem;
    font-weight: 500;
    margin-top: 5px;
    display: block;
    min-height: 18px;
    transition: var(--transition);
}

/* Checkboxes Personalizados */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checkbox-container {
    display: block;
    position: relative;
    padding-left: 35px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    user-select: none;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 22px;
    width: 22px;
    background-color: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 6px;
    transition: var(--transition);
}

.checkbox-container:hover input ~ .checkmark {
    border-color: var(--primary);
}

.checkbox-container input:checked ~ .checkmark {
    background-color: var(--primary);
    border-color: var(--primary);
}

.checkmark::after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark::after {
    display: block;
}

.checkbox-container .checkmark::after {
    left: 8px;
    top: 4px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.form-actions {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Panel de Estado de Agenda */
.status-panel {
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    border: 1px solid transparent;
    transition: var(--transition);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 1.1rem;
    text-transform: uppercase;
}

.indicator-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.status-desc {
    font-size: 0.9rem;
    margin-top: 8px;
}

/* Estados de Disponibilidad */
.status-pending {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
    color: #475569;
}
.status-pending .indicator-dot { background-color: #64748b; }

.status-available {
    background-color: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}
.status-available .indicator-dot {
    background-color: #10b981;
    box-shadow: 0 0 8px #10b981;
}

.status-limited {
    background-color: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}
.status-limited .indicator-dot {
    background-color: #f59e0b;
    box-shadow: 0 0 8px #f59e0b;
}

.status-busy {
    background-color: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}
.status-busy .indicator-dot {
    background-color: #ef4444;
    box-shadow: 0 0 8px #ef4444;
}

/* Factura (Invoice) */
.invoice-card {
    background-color: var(--bg-white);
    border-radius: 12px;
    border: 2px dashed var(--primary-light);
    padding: 30px;
    box-shadow: var(--shadow-sm);
    position: relative;
}

.invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--bg-light);
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.invoice-header h4 {
    font-size: 1.1rem;
    color: var(--secondary);
}

#invoice-date {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.invoice-patient-info {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    line-height: 1.5;
}

.invoice-patient-info span {
    color: var(--text-main);
    font-weight: 600;
}

/* Tabla de Facturación (Requisito Rúbrica) */
.invoice-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.invoice-table th,
.invoice-table td {
    padding: 10px 12px;
    text-align: left;
}

.invoice-table th {
    background-color: var(--bg-light);
    color: var(--text-main);
    font-weight: 600;
    border-bottom: 1px solid var(--border);
}

.invoice-table td {
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
}

.invoice-table .empty-invoice {
    text-align: center;
    color: var(--text-muted);
    padding: 30px;
}

.invoice-table tfoot td {
    border-bottom: none;
    padding: 6px 12px;
}

.invoice-table tfoot tr:first-of-type td {
    padding-top: 15px;
    border-top: 2px solid var(--border);
}

.text-right {
    text-align: right;
}

.font-medium {
    font-weight: 500;
}

.font-bold {
    font-weight: 700;
}

.total-row td {
    font-size: 1.05rem;
    color: var(--secondary) !important;
    padding-top: 12px !important;
    padding-bottom: 12px !important;
    border-bottom: 2px double var(--primary) !important;
}

.invoice-note {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
    border-top: 1px solid var(--border);
    padding-top: 15px;
}

/* ==========================================================================
   SECCIÓN DE BASE DE DATOS LOCAL
   ========================================================================== */
.database-section {
    padding: 80px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.database-table-wrapper {
    background-color: var(--bg-white);
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    overflow-x: auto;
    margin-top: 30px;
    margin-bottom: 20px;
}

.db-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    min-width: 800px; /* Previene colapso en móviles */
}

.db-table th,
.db-table td {
    padding: 14px 18px;
    text-align: left;
}

.db-table th {
    background-color: var(--secondary);
    color: var(--bg-white);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.db-table tr {
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

.db-table tbody tr:hover {
    background-color: #f1f5f9;
}

.db-table td {
    color: var(--text-main);
    font-weight: 500;
}

.db-table td:nth-child(1),  /* ID Cita */
.db-table td:nth-child(5),  /* Fecha Cita */
.db-table td:nth-child(6),  /* Horario */
.db-table td:nth-child(7) { /* Total Cancelado */
    white-space: nowrap;
}

.db-table .empty-db {
    text-align: center;
    color: var(--text-muted);
    padding: 40px;
    font-style: italic;
}

.database-actions {
    display: flex;
    justify-content: flex-end;
}

.btn-delete-row {
    background-color: transparent;
    color: #ef4444;
    border: 1px solid #fecaca;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    transition: var(--transition);
}

.btn-delete-row:hover {
    background-color: #fef2f2;
    border-color: #ef4444;
}

/* ==========================================================================
   PIE DE PÁGINA (Footer)
   ========================================================================== */
.main-footer {
    background-color: var(--secondary);
    color: #ccebeb;
    padding: 60px 20px 20px 20px;
    font-size: 0.9rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-info {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

@media (max-width: 768px) {
    .footer-info {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

.footer-info h5 {
    color: var(--bg-white);
    font-size: 1.15rem;
    margin-bottom: 15px;
}

.footer-info p {
    margin-bottom: 8px;
}

.footer-info a {
    color: var(--bg-white);
    font-weight: 500;
}

.footer-info a:hover {
    text-decoration: underline;
}

.footer-divider {
    height: 1px;
    background-color: rgba(255,255,255,0.1);
    margin-bottom: 20px;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
}

.author-credits {
    font-weight: 600;
    color: var(--bg-white);
}

/* ==========================================================================
   DISEÑO RESPONSIVO (Breakpoints)
   ========================================================================== */
@media (max-width: 1024px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .booking-grid {
        grid-template-columns: 1fr;
    }
    
    .about-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .about-image {
        height: 350px;
    }
}

@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-links {
        gap: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .form-group-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

/* ==========================================================================
   PANTALLAS MODALES PERSONALIZADAS (Modals)
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background-color: var(--bg-white);
    border-radius: 16px;
    padding: 35px;
    max-width: 450px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid var(--border);
}

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

.modal-icon {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px auto;
    font-size: 1.8rem;
    font-weight: bold;
}

.modal-icon.success {
    background-color: #d1fae5;
    color: #10b981;
}

.modal-icon.warning {
    background-color: #fffbeb;
    color: #f59e0b;
}

.modal-icon.danger {
    background-color: #fef2f2;
    color: #ef4444;
}

.modal-card h3 {
    font-size: 1.4rem;
    color: var(--secondary);
    margin-bottom: 12px;
    font-weight: 700;
}

.modal-content-body {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 25px;
    line-height: 1.6;
    text-align: center;
}

.modal-content-body p {
    text-align: center !important;
    margin-bottom: 8px;
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.modal-actions .btn {
    padding: 10px 20px;
    font-size: 0.9rem;
    min-width: 100px;
}

