/* ======================================================= */
/* 1. ESTILOS BASE Y CONFIGURACIÓN GENERAL                 */
/* ======================================================= */
body {
    font-family: 'Lato', sans-serif;
    /* Ivory White Theme */
    background-color: #FAF0E6;
    color: #5D4037;

    /* Configuración por defecto (WEB) */
    cursor: none;

    /* Variables de entorno para el Notch (iOS/Android) */
    /* En web esto vale 0, en móvil se ajusta automáticamente */
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

/* Títulos */
h1,
h2,
h3,
.brand-font {
    font-family: 'Playfair Display', serif;
}

/* ======================================================= */
/* 2. COMPONENTES DE UI (Admin, Paneles, Scrollbar)        */
/* ======================================================= */

/* Control de Visibilidad Admin */
.admin-only {
    display: none !important;
}

.is-admin .admin-only {
    display: block !important;
}

.is-admin .admin-flex {
    display: flex !important;
}

/* Animaciones */
.fade-in {
    animation: fadeIn 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scrollbar elegante (Principalmente Web) */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #A4A05D;
    border-radius: 10px;
    border: 2px solid #A4A05D;
}

::-webkit-scrollbar-thumb:hover {
    background: #5D4037;
}

/* Efecto Cristal */
.glass-panel {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

/* ======================================================= */
/* 3. CALENDARIO                                           */
/* ======================================================= */
.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.calendar-day:hover:not(.disabled):not(.other-month) {
    transform: scale(1.05);
    background: linear-gradient(135deg, #A4A05D, #5D4037);
    color: white;
}

.calendar-day.selected {
    background: linear-gradient(135deg, #A4A05D, #5D4037) !important;
    color: white !important;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(164, 160, 93, 0.3);
}

.calendar-day.has-classes::after {
    content: '';
    position: absolute;
    bottom: 4px;
    width: 4px;
    height: 4px;
    background: #5D4037;
    border-radius: 50%;
}

.calendar-day.selected.has-classes::after {
    background: white;
}

.calendar-day.disabled {
    color: #E1C699;
    /* Sand */
    filter: grayscale(1);
    cursor: not-allowed;
    opacity: 0.4;
}

.calendar-day.other-month {
    color: #E1C699;
    /* Sand */
    opacity: 0.3;
}

.calendar-day.today {
    border: 2px solid #A4A05D;
    font-weight: bold;
}

/* ======================================================= */
/* 4. LOGICA DEL CURSOR PERSONALIZADO (WEB)                */
/* ======================================================= */

/* El elemento visual del cursor */
.wink-cursor {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    font-size: 2rem;
    line-height: 1;
    transform: translate(-50%, -50%);
    z-index: 9999;
    transition: transform 0.1s ease-out;
    user-select: none;
    /* Solo visible por defecto en Web. En móviles se oculta abajo */
}

.wink-cursor.clicking {
    transform: translate(-50%, -50%) scale(0.8) rotate(-10deg);
}

/* Forzar ocultación del cursor nativo SOLO en Web */
body.platform-web a,
body.platform-web button,
body.platform-web input,
body.platform-web select,
body.platform-web textarea,
body.platform-web .cursor-pointer {
    cursor: none !important;
}

/* ======================================================= */
/* 5. ADAPTACIONES MÓVILES (iOS + ANDROID)                 */
/* ======================================================= */

/* REGLAS COMUNES APP (iOS y Android) */
body.platform-ios,
body.platform-android {
    /* Restaurar cursor nativo (invisible en táctil) */
    cursor: auto !important;
}

/* Ocultar cursor personalizado en apps */
body.platform-ios .wink-cursor,
body.platform-android .wink-cursor {
    display: none !important;
}

/* Restaurar punteros en elementos interactivos para Apps */
body.platform-ios a,
body.platform-android a,
body.platform-ios button,
body.platform-android button,
body.platform-ios input,
body.platform-android input,
body.platform-ios select,
body.platform-android select {
    cursor: auto !important;
}

/* --- ESPECÍFICO iOS (iPhone/iPad) --- */
body.platform-ios header {
    /* Ajuste fino para el Header debajo del Notch */
    padding-top: 10px;
}

/* --- ESPECÍFICO ANDROID --- */
body.platform-android {
    /* Ajuste opcional para Android si la barra de estado es transparente */
    padding-top: 5px;
}

/* ======================================================= */
/* 6. UTILIDADES DE VISIBILIDAD POR PLATAFORMA             */
/* ======================================================= */

/* Mostrar SOLO en Web (Ocultar en móviles) */
body.platform-ios .web-only,
body.platform-android .web-only {
    display: none !important;
}

/* Mostrar SOLO en iOS */
body:not(.platform-ios) .ios-only {
    display: none !important;
}

/* Mostrar SOLO en Android */
body:not(.platform-android) .android-only {
    display: none !important;
}

/* Mostrar en CUALQUIER App Móvil (No Web) */
body.platform-web .mobile-only {
    display: none !important;
}