/* ============================================================
   RESERVAS BISSU - Identidad Corporativa Oficial
   ============================================================ */

/* --- Variables Globales (Guía de Marca Bissú) --- */
:root {
    --bg-color: #f8fafc;
    --container-bg: #ffffff;
    --text-color: #0f172a;
    --text-muted: #64748b;
    --accent-color: #E4007C;
    --accent-hover: #c3006a;
    --border-color: #e2e8f0;
    --border-focus: #E4007C;
    --time-slot-bg: #ffffff;
    --time-slot-hover: #f1f5f9;
    --card-shadow: 0 12px 35px rgba(0, 0, 0, 0.05), 0 2px 6px rgba(0, 0, 0, 0.03);
}

/* --- Reset y Tipografía Base --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    -webkit-font-smoothing: antialiased;
}

/* ============================================================
   LOGO OFICIAL BISSU (COMPONENTES DE MARCA)
   ============================================================ */

.brand-logo-wrap {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.brand-logo-text {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 2.6rem;
    color: #000000;
    letter-spacing: -0.02em;
    line-height: 1;
    display: inline-flex;
    align-items: baseline;
    text-transform: lowercase;
}

/* Estilo para la letra 'u' con su tilde tipo paralelogramo inclinado */
.brand-u-box {
    position: relative;
    display: inline-block;
}

.brand-accent-mark {
    position: absolute;
    top: -4px;
    right: 3px;
    width: 9px;
    height: 4px;
    background-color: var(--accent-color);
    transform: skewX(-25deg) rotate(-14deg);
    border-radius: 0.5px;
}

.brand-tagline {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: #4b5563;
    margin-top: 6px;
    text-align: center;
}

/* Versión reducida del logo para la cabecera principal */
.brand-logo-header .brand-logo-text {
    font-size: 2rem;
}

.brand-logo-header .brand-accent-mark {
    top: -3px;
    right: 2px;
    width: 7.5px;
    height: 3.5px;
}

.brand-logo-header .brand-tagline {
    font-size: 0.52rem;
    letter-spacing: 0.3em;
    margin-top: 4px;
}

/* ============================================================
   PANTALLA DE LOGIN
   ============================================================ */

.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.login-card {
    background-color: var(--container-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    width: 100%;
    max-width: 420px;
    padding: 40px 35px;
    box-shadow: var(--card-shadow);
    text-align: center;
}

.login-card .brand-logo-wrap {
    margin-bottom: 25px;
}

.login-card h2 {
    font-size: 1.45rem;
    font-weight: 700;
    color: #000000;
    margin-bottom: 8px;
}

.login-card p {
    color: var(--text-muted);
    font-size: 0.92rem;
    margin-bottom: 25px;
    line-height: 1.5;
}

.error-message {
    color: #ef4444;
    font-size: 0.88rem;
    margin-bottom: 15px;
    display: none;
    font-weight: 600;
    background: #fef2f2;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #fecaca;
}

/* ============================================================
   APLICACIÓN PRINCIPAL
   ============================================================ */

.container {
    display: none;
    background-color: var(--container-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    width: 100%;
    max-width: 920px;
    padding: 32px;
    box-shadow: var(--card-shadow);
}

/* Cabecera Principal */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
    margin-bottom: 25px;
}

.header-brand-group {
    display: flex;
    align-items: center;
    gap: 22px;
}

.header-divider {
    width: 1px;
    height: 44px;
    background-color: #cbd5e1;
}

.header-text-group h1 {
    font-size: 1.35rem;
    font-weight: 800;
    color: #000000;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.header-subtitle {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 3px;
    display: block;
}

.user-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    background-color: #f1f5f9;
    border: 1px solid #e2e8f0;
}

/* ============================================================
   CONTROLES DE CALENDARIO
   ============================================================ */

.calendar-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 15px;
    flex-wrap: wrap;
}

.date-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.date-picker-wrapper label {
    font-weight: 600;
    font-size: 0.92rem;
    color: #334155;
}

.date-nav-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-date-nav {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    color: #334155;
    width: 38px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.15s ease;
}

.btn-date-nav:hover {
    background-color: #f8fafc;
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.btn-date-nav:active {
    transform: scale(0.94);
}

.btn-date-today {
    background-color: rgba(228, 0, 124, 0.08);
    border: 1px solid rgba(228, 0, 124, 0.25);
    color: var(--accent-color);
    height: 40px;
    padding: 0 14px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-date-today:hover {
    background-color: var(--accent-color);
    color: #ffffff;
    border-color: var(--accent-color);
}

.btn-date-today:active {
    transform: scale(0.95);
}

/* ============================================================
   INPUTS, SELECTS Y BOTONES
   ============================================================ */

input[type="date"],
select,
input[type="text"],
input[type="password"] {
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    color: #0f172a;
    padding: 9px 14px;
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
}

input[type="date"] {
    height: 40px;
    font-weight: 600;
}

input[type="date"]:focus,
select:focus,
input[type="text"]:focus,
input[type="password"]:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(228, 0, 124, 0.16);
}

input:disabled,
select:disabled {
    background-color: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
    border-color: #e2e8f0;
}

#user-name {
    text-transform: uppercase;
}

/* --- Botones --- */
.btn {
    background-color: var(--accent-color);
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: background-color 0.18s, transform 0.1s, box-shadow 0.18s;
    box-shadow: 0 2px 8px rgba(228, 0, 124, 0.2);
}

.btn:hover {
    background-color: var(--accent-hover);
    box-shadow: 0 4px 12px rgba(228, 0, 124, 0.3);
}

.btn:active {
    transform: scale(0.98);
}

.btn-cancel {
    background-color: #64748b;
    box-shadow: none;
}

.btn-cancel:hover {
    background-color: #475569;
    box-shadow: 0 2px 8px rgba(71, 85, 105, 0.2);
}

.btn-danger {
    background-color: #ef4444;
    padding: 5px 11px;
    font-size: 0.82rem;
    border-radius: 6px;
    margin-top: 5px;
    border: none;
    color: #ffffff;
    font-weight: 600;
    cursor: pointer;
    box-shadow: none;
    transition: background-color 0.15s;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-edit {
    background-color: #f59e0b;
    padding: 5px 11px;
    font-size: 0.82rem;
    border-radius: 6px;
    border: none;
    color: #ffffff;
    font-weight: 600;
    cursor: pointer;
    margin-right: 5px;
    box-shadow: none;
    transition: background-color 0.15s;
}

.btn-edit:hover {
    background-color: #d97706;
}

/* ============================================================
   GRILLA DE HORARIOS Y SLOTS
   ============================================================ */

.schedule-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
    max-height: 480px;
    overflow-y: auto;
    padding-right: 6px;
}

.schedule-grid::-webkit-scrollbar {
    width: 6px;
}

.schedule-grid::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 10px;
}

.time-slot {
    background-color: var(--time-slot-bg);
    border: 1px solid var(--border-color);
    border-left: 5px solid #94a3b8;
    border-radius: 10px;
    padding: 15px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.15s, background-color 0.15s, border-color 0.15s;
}

.time-slot.available {
    border-left-color: #10b981;
    cursor: pointer;
}

.time-slot.available:hover {
    transform: translateX(4px);
    background-color: var(--time-slot-hover);
    border-color: #cbd5e1;
}

.time-slot.occupied {
    background-color: #f8fafc;
    border-left-color: var(--accent-color);
}

.time-text {
    font-weight: 700;
    font-size: 1.05rem;
    min-width: 140px;
    color: #1e293b;
}

.status-badge {
    padding: 5px 13px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 700;
    display: inline-block;
}

.status-badge.available {
    background-color: rgba(16, 185, 129, 0.12);
    color: #059669;
}

/* ============================================================
   MODALES
   ============================================================ */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.55);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    padding: 32px;
    border-radius: 18px;
    width: 90%;
    max-width: 440px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.18);
}

.modal-content h3 {
    font-size: 1.35rem;
    font-weight: 800;
    color: #000000;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.88rem;
    color: #475569;
    font-weight: 600;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 10px;
}

.loading-overlay {
    display: none;
    text-align: center;
    padding: 20px;
    font-size: 1.05rem;
    color: var(--accent-color);
    font-weight: 700;
}

/* ============================================================
   AVISOS Y CONFIRMACIONES PERSONALIZADOS (MODAL Y TOASTS)
   ============================================================ */

.custom-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: fadeInOverlay 0.18s ease-out;
}

.custom-dialog-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 18px;
    width: 90%;
    max-width: 400px;
    padding: 30px 26px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    text-align: center;
    animation: popDialog 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.dialog-icon-wrapper {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
}

.dialog-icon-wrapper.info {
    background: rgba(228, 0, 124, 0.12);
    color: var(--accent-color);
}

.dialog-icon-wrapper.success {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
}

.dialog-icon-wrapper.warning {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
}

.dialog-icon-wrapper.danger {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}

.dialog-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #000000;
    margin-bottom: 8px;
}

.dialog-message {
    color: #475569;
    font-size: 0.94rem;
    line-height: 1.55;
    margin-bottom: 22px;
    white-space: pre-line;
    word-break: break-word;
}

.dialog-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.dialog-actions .btn {
    min-width: 105px;
    padding: 10px 20px;
}

.dialog-actions .btn-danger-confirm {
    background-color: #ef4444;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.dialog-actions .btn-danger-confirm:hover {
    background-color: #dc2626;
}

/* --- Notificaciones Toasts --- */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast-item {
    pointer-events: auto;
    background: #ffffff;
    color: #0f172a;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent-color);
    padding: 14px 18px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.92rem;
    font-weight: 600;
    min-width: 260px;
    max-width: 360px;
    animation: slideInToast 0.25s ease-out, fadeOutToast 0.3s ease-in 3.2s forwards;
}

.toast-item.success {
    border-left-color: #10b981;
}

.toast-item.success i {
    color: #10b981;
}

.toast-item.error {
    border-left-color: #ef4444;
}

.toast-item.error i {
    color: #ef4444;
}

.toast-item.warning {
    border-left-color: #f59e0b;
}

.toast-item.warning i {
    color: #f59e0b;
}

.toast-item.info {
    border-left-color: var(--accent-color);
}

.toast-item.info i {
    color: var(--accent-color);
}

@keyframes fadeInOverlay {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes popDialog {
    from { opacity: 0; transform: scale(0.88); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes slideInToast {
    from { opacity: 0; transform: translateX(50px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes fadeOutToast {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(30px); }
}
