/**
 * app.css - Estilos personalizados de la landing page
 * 
 * Complementa TailwindCSS con estilos específicos del proyecto.
 */

/* ============================================================
   VARIABLES CSS (sobrescribibles desde config.php)
   ============================================================ */

:root {
    --color-primary: #1a3a5c;
    --color-accent: #e8a020;
    --color-bg: #f8f7f4;
    --transition-speed: 0.3s;
}

/* ============================================================
   BASE STYLES
   ============================================================ */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
    background-color: var(--color-bg);
    color: #374151;
    line-height: 1.6;
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */

.font-serif {
    font-family: 'Instrument Serif', Georgia, serif;
}

h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
}

/* ============================================================
   CUSTOM COLORS
   ============================================================ */

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

.text-primary {
    color: var(--color-primary);
}

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

.bg-accent {
    background-color: var(--color-accent);
}

.text-accent {
    color: var(--color-accent);
}

.border-accent {
    border-color: var(--color-accent);
}

/* ============================================================
   NAVBAR
   ============================================================ */

#navbar {
    transition: background-color var(--transition-speed), box-shadow var(--transition-speed);
}

#navbar.navbar-scrolled {
    background-color: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

#navbar.navbar-scrolled .navbar-logo,
#navbar.navbar-scrolled .nav-link {
    color: var(--color-primary);
}

#navbar.navbar-scrolled .nav-link:hover {
    color: var(--color-accent);
}

/* Mobile menu */
.mobile-menu {
    transform: translateX(100%);
    transition: transform var(--transition-speed) ease;
}

.mobile-menu.open {
    transform: translateX(0);
}

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

.hero-pattern {
    background-color: var(--color-primary);
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(255,255,255,0.1) 2%, transparent 2.5%),
        radial-gradient(circle at 75% 75%, rgba(255,255,255,0.08) 2%, transparent 2.5%);
    background-size: 60px 60px;
    min-height: 100vh;
}

/* ============================================================
   FORMS
   ============================================================ */

input, select, textarea {
    transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(26, 58, 92, 0.1);
}

.form-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.form-success {
    border-color: #22c55e !important;
}

/* Time slots */
.time-slot {
    padding: 8px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.time-slot:hover {
    border-color: var(--color-primary);
    background-color: rgba(26, 58, 92, 0.05);
}

.time-slot.selected {
    border-color: var(--color-primary);
    background-color: var(--color-primary);
    color: white;
}

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

/* ============================================================
   BUTTONS
   ============================================================ */

button, .btn {
    transition: all var(--transition-speed);
}

button:disabled, .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ============================================================
   FAQ ACCORDION
   ============================================================ */

details summary {
    cursor: pointer;
    list-style: none;
}

details summary::-webkit-details-marker {
    display: none;
}

details summary::marker {
    display: none;
}

details[open] summary .chevron {
    transform: rotate(180deg);
}

.chevron {
    transition: transform var(--transition-speed);
}

/* ============================================================
   DIALOG / MODAL
   ============================================================ */

dialog {
    border: none;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 90vw;
    width: 500px;
    padding: 0;
    background: white;
}

dialog::backdrop {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

/* ============================================================
   WHATSAPP FLOAT
   ============================================================ */

.whatsapp-float {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
}

.whatsapp-float a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background-color: #25D366;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.whatsapp-float a:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.5);
}

.whatsapp-tooltip {
    position: absolute;
    right: 70px;
    top: 50%;
    transform: translateY(-50%);
    background: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-speed), visibility var(--transition-speed);
}

.whatsapp-float:hover .whatsapp-tooltip {
    opacity: 1;
    visibility: visible;
}

/* ============================================================
   CARDS & SHADOWS
   ============================================================ */

.card {
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    transition: box-shadow var(--transition-speed);
}

.card:hover {
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.1);
}

/* ============================================================
   ALERTS & MESSAGES
   ============================================================ */

.alert {
    padding: 16px;
    border-radius: 8px;
    margin-top: 16px;
}

.alert-success {
    background-color: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

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

/* Focus visible for keyboard navigation */
:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* Skip to content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--color-primary);
    color: white;
    padding: 8px 16px;
    z-index: 9999;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

/* ============================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================ */

@media (max-width: 768px) {
    html {
        scroll-padding-top: 70px;
    }
    
    .hero-pattern {
        min-height: auto;
        padding-top: 80px;
        padding-bottom: 60px;
    }
    
    .whatsapp-float {
        bottom: 16px;
        right: 16px;
    }
    
    .whatsapp-float a {
        width: 56px;
        height: 56px;
    }
    
    .whatsapp-tooltip {
        display: none;
    }
}

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

@media print {
    .whatsapp-float,
    #navbar,
    button,
    .mobile-menu {
        display: none !important;
    }
    
    body {
        background: white;
    }
    
    .hero-pattern {
        background: white;
        color: black;
        min-height: auto;
    }
}
