/* =============================================
   KlinoTime — Design System Global
   Paleta: Deep Navy + Teal/Cian + Glassmorphism
   Fuente: Inter (Google Fonts)
============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ─── Variables ─────────────────────────────── */
:root {
    color-scheme: dark;
    /* Fondo */
    --bg-base:       #04091A;
    --bg-primary:    #050D1A;
    --bg-secondary:  #0A1628;
    --bg-card:       rgba(255, 255, 255, 0.04);
    --bg-card-hover: rgba(255, 255, 255, 0.07);
    --bg-input:      rgba(255, 255, 255, 0.06);

    /* Acentos */
    --accent:        #00C9A7;
    --accent-dark:   #00A888;
    --accent-light:  #33D4B8;
    --accent-glow:   rgba(0, 201, 167, 0.25);
    --blue:          #3B82F6;
    --blue-dark:     #2563EB;
    --purple:        #8B5CF6;

    /* Texto */
    --text-primary:   #FFFFFF;
    --text-secondary: rgba(255, 255, 255, 0.55);
    --text-muted:     rgba(255, 255, 255, 0.30);

    /* Bordes */
    --border:        rgba(255, 255, 255, 0.08);
    --border-accent: rgba(0, 201, 167, 0.35);
    --border-hover:  rgba(255, 255, 255, 0.15);

    /* Sombras */
    --shadow-sm:   0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md:   0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg:   0 8px 48px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(0, 201, 167, 0.2);

    /* Estados de citas */
    --estado-pendiente:   #F59E0B;
    --estado-confirmada:  #00C9A7;
    --estado-consulta:    #3B82F6;
    --estado-completada:  #6B7280;
    --estado-cancelada:   #EF4444;

    /* Tamaños */
    --sidebar-w: 260px;
    --radius:    12px;
    --radius-sm:  8px;
    --radius-lg: 20px;

    /* Transiciones */
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Reset ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ─── Scrollbar ──────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ─── Tipografía ─────────────────────────────── */
h1 { font-size: 2rem;    font-weight: 800; line-height: 1.15; }
h2 { font-size: 1.5rem;  font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 600; }
h4 { font-size: 1rem;    font-weight: 600; }
p  { color: var(--text-secondary); }
a  { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Botones ────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    outline: none;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #041015;
    box-shadow: 0 4px 15px var(--accent-glow);
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 25px rgba(0, 201, 167, 0.4);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
}
.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #EF4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.5);
}

.btn-google {
    background: rgba(255,255,255,0.07);
    color: var(--text-primary);
    border: 1px solid var(--border);
    gap: 10px;
}
.btn-google:hover {
    background: rgba(255,255,255,0.12);
    border-color: var(--border-hover);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    background: rgba(255,255,255,0.05);
    border-color: var(--border-hover);
    color: var(--accent);
}

.btn-google img { width: 18px; height: 18px; }

.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-lg { padding: 13px 28px; font-size: 1rem;  }
.btn-full { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ─── Inputs / Select ────────────────────────── */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.input-group label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.input-group input,
.input-group select,
.input-group textarea {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    padding: 10px 14px;
    width: 100%;
    outline: none;
    transition: var(--transition);
}
.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
    border-color: var(--accent);
    background: rgba(0, 201, 167, 0.05);
    box-shadow: 0 0 0 3px rgba(0, 201, 167, 0.12);
}
.input-group select option { background: #0A1628; }
.input-group textarea { resize: vertical; min-height: 90px; }

/* ─── Tarjetas ───────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: var(--transition);
}
.card:hover { border-color: var(--border-hover); }

/* ─── Modal ──────────────────────────────────── */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(4, 9, 26, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}
.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}
.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px) scale(0.97);
    transition: var(--transition);
}
.modal-overlay.active .modal {
    transform: translateY(0) scale(1);
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
.modal-close {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: var(--transition);
    flex-shrink: 0;
}
.modal-close:hover { color: var(--text-primary); border-color: var(--border-hover); }

/* ─── Form Grid ──────────────────────────────── */
.form-grid { display: grid; gap: 16px; }
.form-grid-2 { grid-template-columns: 1fr 1fr; }

/* ─── Badges de estado ───────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}
.badge-pendiente  { background: rgba(245,158,11,0.15);  color: var(--estado-pendiente);  }
.badge-confirmada { background: rgba(0,201,167,0.15);   color: var(--estado-confirmada); }
.badge-consulta   { background: rgba(59,130,246,0.15);  color: var(--estado-consulta);   }
.badge-completada { background: rgba(107,114,128,0.15); color: var(--estado-completada); }
.badge-cancelada  { background: rgba(239,68,68,0.15);   color: var(--estado-cancelada);  }

/* ─── Banner de Suscripción Global ───────────── */
:root {
    --banner-height: 0px;
}

.sub-banner {
    width: 100%;
    height: var(--banner-height);
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2100; /* Por encima de todo */
    font-size: 0.88rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    backdrop-filter: blur(10px);
    border-bottom: 2px solid rgba(0,0,0,0.15);
    transition: var(--transition);
}

.sub-banner-warning {
    background: linear-gradient(90deg, #F59E0B, #D97706);
    color: #041015;
}

.sub-banner-danger {
    background: linear-gradient(90deg, #EF4444, #B91C1C);
    color: #FFFFFF;
}

.sub-banner-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sub-banner-icon { font-size: 1.2rem; }

/* Ajuste de Sidebars y Contenedores */
body { padding-top: var(--banner-height) !important; }
.sidebar { 
    top: var(--banner-height) !important; 
    bottom: 0 !important; 
    height: auto !important; 
    min-height: 0 !important; 
}
.dashboard-header { top: var(--banner-height) !important; }
.historial-panel { 
    top: var(--banner-height) !important; 
    bottom: 0 !important; 
    height: auto !important; 
    min-height: 0 !important; 
}

/* ─── Notificación Toast ─────────────────────── */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}
.toast {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 380px;
    box-shadow: var(--shadow-lg);
    pointer-events: all;
    animation: toastIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    position: relative;
    overflow: hidden;
}
.toast.toast-alert {
    border-color: var(--border-accent);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}
.toast.toast-success { border-color: rgba(0,201,167,0.3); }
.toast.toast-error   { border-color: rgba(239,68,68,0.3); }

.toast::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--accent);
    border-radius: 99px;
}
.toast.toast-error::before { background: #EF4444; }

.toast-icon { font-size: 1.3rem; flex-shrink: 0; }
.toast-body { flex: 1; }
.toast-title { font-size: 0.85rem; font-weight: 700; color: var(--text-primary); }
.toast-msg   { font-size: 0.78rem; color: var(--text-secondary); margin-top: 2px; }

.toast-out { animation: toastOut 0.3s ease forwards; }

@keyframes toastIn  { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; transform: translateX(0); }     to { opacity: 0; transform: translateX(40px); } }

/* ─── Fondo animado con gradiente ───────────────── */
.bg-gradient {
    background:
        radial-gradient(ellipse at 10% 20%, rgba(0, 201, 167, 0.08) 0%, transparent 55%),
        radial-gradient(ellipse at 90% 80%, rgba(59, 130, 246, 0.06) 0%, transparent 55%),
        var(--bg-base);
}

/* ─── Skeleton loader ──────────────────────────── */
.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ─── Utilidades ─────────────────────────────── */
.flex        { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between{ display: flex; align-items: center; justify-content: space-between; }
.gap-2       { gap: 8px; }
.gap-3       { gap: 12px; }
.gap-4       { gap: 16px; }
.mt-2        { margin-top: 8px; }
.mt-4        { margin-top: 16px; }
.mt-6        { margin-top: 24px; }
.text-accent { color: var(--accent); }
.text-sm     { font-size: 0.85rem; }
.text-xs     { font-size: 0.75rem; }
.w-full      { width: 100%; }
.divider     { height: 1px; background: var(--border); margin: 20px 0; }

/* ─── Responsive ─────────────────────────────── */
@media (max-width: 768px) {
    .form-grid-2 { grid-template-columns: 1fr; }
}

/* ── Pantalla de Bloqueo (Account Locked) ─────── */
.lock-screen-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(4, 9, 26, 0.85);
    backdrop-filter: blur(20px);
    z-index: 99999; /* Por encima de todo */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.lock-screen-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(239, 68, 68, 0.1);
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 450px;
    text-align: center;
    animation: lockScreenIn 0.5s ease-out;
}

@keyframes lockScreenIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.lock-screen-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    display: inline-block;
    filter: drop-shadow(0 0 15px rgba(239, 68, 68, 0.5));
}

.lock-screen-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 12px;
}

.lock-screen-text {
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.6;
    margin-bottom: 30px;
    font-size: 1rem;
}

.lock-screen-btn {
    background: #EF4444;
    color: #fff;
    border: none;
    padding: 14px 28px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    width: 100%;
    font-family: inherit;
}

.lock-screen-btn:hover {
    background: #DC2626;
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}

/* ─── Modal de Confirmación Personalizado ──────── */
.modal-confirm-content {
    background: #0D1B2E;
    border: 1px solid rgba(139, 92, 246, 0.3);
    padding: 32px;
    border-radius: 20px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.6), 0 0 30px rgba(139, 92, 246, 0.15);
    animation: confirmIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes confirmIn {
    from { opacity: 0; transform: scale(0.9) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.confirm-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    display: inline-block;
    filter: drop-shadow(0 0 15px rgba(139, 92, 246, 0.5));
}

.confirm-title {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 12px;
    color: #fff;
    letter-spacing: -0.01em;
}

.confirm-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 30px;
}

.confirm-actions {
    display: flex;
    gap: 12px;
}

.confirm-actions .btn {
    flex: 1;
    padding: 14px;
    font-weight: 700;
}

#btn-confirm-yes {
    background: linear-gradient(135deg, #8B5CF6, #7C3AED);
    color: white;
    border: none;
}

#btn-confirm-yes:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(139, 92, 246, 0.4);
}

#btn-confirm-no {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: white;
}

#btn-confirm-no:hover {
    background: rgba(255, 255, 255, 0.1);
}
