/**
 * PUBLIC.CSS - UAGRM
 * Especificidad alta para sobrescribir Bootstrap
 */

/* ============================================
   VARIABLES
   ============================================ */
:root {
    --uagrm-blue: #002B6B;
    --uagrm-blue-light: #003d99;
    --uagrm-red: #D71920;
    --uagrm-red-dark: #b5151b;
    --status-available: #10B981;
    --status-available-bg: #D1FAE5;
    --status-occupied: #EF4444;
    --status-occupied-bg: #FEE2E2;
    --bg-primary: #F0F4F8;
    --bg-white: #FFFFFF;
    --text-primary: #1E293B;
    --text-secondary: #64748B;
    --text-muted: #94A3B8;
    --border-light: #E2E8F0;
}

/* ============================================
   RESET BASE
   ============================================ */
body.uagrm-public {
    font-family: 'Inter', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* ============================================
   HERO
   ============================================ */
body.uagrm-public .hero {
    background: linear-gradient(135deg, #002B6B 0%, #001a4d 100%) !important;
    color: white !important;
    padding: 2rem 1rem;
    text-align: center;
}

body.uagrm-public .hero__logo {
    width: 90px;
    height: 90px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid rgba(255,255,255,0.2);
}

body.uagrm-public .hero__logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ============================================
   ACTION BAR
   ============================================ */
body.uagrm-public .action-bar {
    background: white;
    padding: 1rem;
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

body.uagrm-public .btn--primary {
    background: #002B6B;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

body.uagrm-public .btn--accent {
    background: #D71920;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* ============================================
   INFO BAR
   ============================================ */
body.uagrm-public .info-bar {
    text-align: center;
    padding: 1.5rem 1rem 1rem;
    color: #64748B;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ============================================
   SALON CARDS
   ============================================ */
body.uagrm-public .salon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    padding: 0 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

body.uagrm-public .salon-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 2px solid transparent;
}

body.uagrm-public .salon-card--available {
    border-color: #10B981;
}

body.uagrm-public .salon-card--occupied {
    border-color: #EF4444;
}

body.uagrm-public .salon-card__badge--available {
    background: #D1FAE5;
    color: #10B981;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

body.uagrm-public .salon-card__badge--occupied {
    background: #FEE2E2;
    color: #EF4444;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

/* ============================================
   CALENDAR STYLES - CORREGIDO
   ============================================ */
body.uagrm-public .section {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

body.uagrm-public .section__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

body.uagrm-public .section__title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

body.uagrm-public .calendar-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* GRID: 7 columnas fijas */
body.uagrm-public .calendar__grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

/* Cabeceras de días (Dom, Lun, Mar...) */
body.uagrm-public .calendar__weekday {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    padding: 0.5rem 0;
    letter-spacing: 0.05em;
}

/* Celdas de días - FIX: box-sizing en TODAS las celdas */
body.uagrm-public .calendar__day,
body.uagrm-public .calendar__day--other {
    min-height: 100px;
    border-radius: 8px;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    background: var(--bg-primary);
    position: relative;
    transition: background 0.2s;
    cursor: default;
    box-sizing: border-box;
}

body.uagrm-public .calendar__day:hover {
    background: #e2e8f0;
}

/* Días de otros meses (relleno inicial) */
body.uagrm-public .calendar__day--other {
    background: transparent;
    min-height: 100px;
    pointer-events: none;
}

/* Día actual (hoy) - FIX: border ya incluido en box-sizing */
body.uagrm-public .calendar__day--today {
    background: #dbeafe;
    border: 2px solid #002B6B;
    /* box-sizing: border-box ya maneja el border, no hace falta calc() */
}

body.uagrm-public .calendar__day--today .calendar__day-number {
    color: #002B6B;
    font-weight: 700;
}

/* Número del día */
body.uagrm-public .calendar__day-number {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1;
}

/* Contenedor de eventos (dots) */
body.uagrm-public .calendar__events {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-top: auto;
    align-self: center;
    justify-content: center;
    width: 100%;
    padding-top: 4px;
}

/* Dots de eventos */
body.uagrm-public .calendar__event-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
}

body.uagrm-public .calendar__event-dot--blanco {
    background: #e5e7eb;
    border: 1px solid #9ca3af;
}

body.uagrm-public .calendar__event-dot--azul {
    background: #002B6B;
}

/* Indicador "+N" cuando hay más eventos */
body.uagrm-public .calendar__more {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 600;
    line-height: 8px;
}

/* Leyenda */
body.uagrm-public .legend {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

body.uagrm-public .legend__item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

body.uagrm-public .legend__dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

body.uagrm-public .legend__dot--blanco {
    background: #e5e7eb;
    border: 1px solid #9ca3af;
}

body.uagrm-public .legend__dot--azul {
    background: #002B6B;
}

/* ============================================
   CTA
   ============================================ */
body.uagrm-public .cta {
    background: linear-gradient(135deg, #002B6B 0%, #001a4d 100%) !important;
    color: white !important;
    padding: 3rem 1rem;
    text-align: center;
    margin: 2rem 0;
}

body.uagrm-public .cta__title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

body.uagrm-public .cta__text {
    opacity: 0.9;
    margin-bottom: 1.5rem;
}

body.uagrm-public .cta__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #D71920;
    color: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
}

/* ============================================
   FOOTER
   ============================================ */
body.uagrm-public .footer {
    background: #1E293B;
    color: rgba(255,255,255,0.7);
    padding: 2rem 1rem;
    text-align: center;
}

body.uagrm-public .footer__logo,
body.uagrm-public .footer__logo img {
    width: 60px !important;
    height: 60px !important;
    max-width: 60px !important;
    max-height: 60px !important;
    margin: 0 auto 1rem;
    border-radius: 50%;
    overflow: hidden;
    object-fit: cover;
}

body.uagrm-public .footer__text {
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

body.uagrm-public .footer__link {
    color: rgba(255,255,255,0.9);
}

/* ============================================
   MODAL
   ============================================ */
body.uagrm-public .modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

body.uagrm-public .modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

body.uagrm-public .modal {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

/* ============================================
   MOBILE
   ============================================ */
@media (max-width: 768px) {
    body.uagrm-public .salon-grid {
        grid-template-columns: 1fr;
    }

    body.uagrm-public .hero__logo {
        width: 70px;
        height: 70px;
    }

    /* Calendar mobile */
    body.uagrm-public .calendar__day,
    body.uagrm-public .calendar__day--other {
        min-height: 60px;
        padding: 0.25rem;
    }

    body.uagrm-public .calendar__day--today {
        padding: 0.25rem;  /* Sin calc() porque box-sizing ya lo maneja */
    }

    body.uagrm-public .calendar__day-number {
        font-size: 0.75rem;
    }

    body.uagrm-public .calendar__event-dot {
        width: 6px;
        height: 6px;
    }

    body.uagrm-public .section__header {
        flex-direction: column;
        align-items: flex-start;
    }

    body.uagrm-public .legend {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
}
