/* ============================================================
   WKU Dormitory — Enhancement Layer (enhance.css)
   Additive, non-breaking UI upgrades shared by all modules.
   Prefix new components with .eh- to avoid conflicts.
   ============================================================ */

:root {
    --eh-radius: 16px;
    --eh-radius-sm: 12px;
    --eh-shadow-1: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .1);
    --eh-shadow-2: 0 4px 12px rgba(16, 24, 40, .08), 0 2px 6px rgba(16, 24, 40, .06);
    --eh-shadow-3: 0 12px 28px rgba(16, 24, 40, .12), 0 4px 10px rgba(16, 24, 40, .08);
    --eh-grad-primary: linear-gradient(135deg, #1a73e8 0%, #4285f4 100%);
    --eh-grad-success: linear-gradient(135deg, #0f9d58 0%, #34a853 100%);
    --eh-grad-warning: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    --eh-grad-danger: linear-gradient(135deg, #e11d48 0%, #f43f5e 100%);
    --eh-grad-info: linear-gradient(135deg, #0891b2 0%, #22d3ee 100%);
    --eh-grad-purple: linear-gradient(135deg, #7c3aed 0%, #a78bfa 100%);
    --eh-grad-dark: linear-gradient(135deg, #1f2937 0%, #374151 100%);
    --eh-transition: all .25s cubic-bezier(.4, 0, .2, 1);
}

html { scroll-behavior: smooth; }

::selection { background: rgba(26, 115, 232, .18); }

/* Nicer scrollbars */
* { scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: #94a3b8; background-clip: content-box; }

/* Top scroll progress bar */
.eh-progressbar {
    position: fixed; top: 0; left: 0; height: 3px; width: 0;
    background: var(--eh-grad-primary); z-index: 2000;
    transition: width .1s linear;
    box-shadow: 0 0 10px rgba(26, 115, 232, .6);
}

/* ---------- Cards ---------- */
.eh-card {
    border: 0;
    border-radius: var(--eh-radius);
    box-shadow: var(--eh-shadow-2);
    background: #fff;
    transition: var(--eh-transition);
    overflow: hidden;
}
.eh-card:hover { box-shadow: var(--eh-shadow-3); transform: translateY(-3px); }
.eh-card-static:hover { transform: none; }

.eh-card-header {
    background: #fff;
    border-bottom: 1px solid #eef2f7;
    padding: 1rem 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: .5rem;
}

/* ---------- Gradient stat cards ---------- */
.eh-stat {
    position: relative;
    border: 0;
    border-radius: var(--eh-radius);
    color: #fff;
    padding: 1.1rem 1.25rem;
    overflow: hidden;
    box-shadow: var(--eh-shadow-2);
    transition: var(--eh-transition);
    min-height: 108px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.eh-stat:hover { transform: translateY(-4px); box-shadow: var(--eh-shadow-3); }
.eh-stat::after {
    content: "";
    position: absolute; right: -30px; top: -30px;
    width: 120px; height: 120px; border-radius: 50%;
    background: rgba(255, 255, 255, .14);
}
.eh-stat .eh-stat-value { font-size: 1.9rem; font-weight: 800; line-height: 1; }
.eh-stat .eh-stat-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; opacity: .92; font-weight: 600; }
.eh-stat .eh-stat-icon {
    position: absolute; right: 1rem; bottom: .9rem;
    font-size: 1.9rem; opacity: .35;
}
.eh-stat-primary { background: var(--eh-grad-primary); }
.eh-stat-success { background: var(--eh-grad-success); }
.eh-stat-warning { background: var(--eh-grad-warning); }
.eh-stat-danger  { background: var(--eh-grad-danger); }
.eh-stat-info    { background: var(--eh-grad-info); }
.eh-stat-purple  { background: var(--eh-grad-purple); }
.eh-stat-dark    { background: var(--eh-grad-dark); }

/* Soft-tinted stat variant */
.eh-stat-soft { background: #fff; color: #1f2937; border: 1px solid #eef2f7; }
.eh-stat-soft .eh-stat-label { color: #64748b; }
.eh-stat-soft::after { background: rgba(26, 115, 232, .06); }
.eh-stat-soft .eh-stat-icon { opacity: .9; }

/* ---------- Hero ---------- */
.eh-hero {
    position: relative;
    border-radius: var(--eh-radius);
    color: #fff;
    background: var(--eh-grad-primary);
    overflow: hidden;
    box-shadow: var(--eh-shadow-3);
}
.eh-hero::before {
    content: "";
    position: absolute; inset: 0;
    background:
        radial-gradient(circle at 85% 15%, rgba(255,255,255,.22), transparent 45%),
        radial-gradient(circle at 15% 90%, rgba(255,255,255,.14), transparent 40%);
}
.eh-hero > * { position: relative; z-index: 1; }

/* ---------- Icon badge ---------- */
.eh-icon {
    width: 52px; height: 52px;
    border-radius: 14px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.35rem;
}
.eh-icon-sm { width: 40px; height: 40px; border-radius: 11px; font-size: 1.05rem; }
.eh-icon-lg { width: 64px; height: 64px; border-radius: 18px; font-size: 1.7rem; }
.eh-icon-round { border-radius: 50%; }
.bg-soft-primary { background: rgba(26,115,232,.12); color: #1a73e8; }
.eh-icon-soft-primary { background: rgba(26,115,232,.12); color: #1a73e8; }
.eh-icon-soft-success { background: rgba(15,157,88,.14); color: #0f9d58; }
.eh-icon-soft-warning { background: rgba(245, 158, 11, .16); color: #b45309; }
.eh-icon-soft-danger  { background: rgba(225, 29, 72, .12); color: #e11d48; }

/* ---------- Quick action tiles ---------- */
.eh-quick {
    display: block;
    text-align: center;
    padding: 1.1rem .5rem;
    border-radius: var(--eh-radius-sm);
    background: #fff;
    border: 1px solid #eef2f7;
    color: #1f2937;
    text-decoration: none;
    transition: var(--eh-transition);
    height: 100%;
}
.eh-quick i { font-size: 1.6rem; margin-bottom: .5rem; display: block; transition: var(--eh-transition); }
.eh-quick span { font-size: .82rem; font-weight: 600; }
.eh-quick:hover {
    border-color: transparent;
    color: #fff;
    background: var(--eh-grad-primary);
    transform: translateY(-4px);
    box-shadow: var(--eh-shadow-3);
}
.eh-quick:hover i { transform: scale(1.15); }
.eh-quick.eh-quick-success:hover { background: var(--eh-grad-success); }
.eh-quick.eh-quick-warning:hover { background: var(--eh-grad-warning); }
.eh-quick.eh-quick-danger:hover  { background: var(--eh-grad-danger); }
.eh-quick.eh-quick-info:hover    { background: var(--eh-grad-info); }
.eh-quick.eh-quick-purple:hover  { background: var(--eh-grad-purple); }

/* ---------- Progress ring ---------- */
.eh-ring {
    --p: 0;
    --ring-color: #1a73e8;
    width: 92px; height: 92px; border-radius: 50%;
    background: conic-gradient(var(--ring-color) calc(var(--p) * 1%), #eef2f7 0);
    display: grid; place-items: center;
    position: relative;
    transition: background .6s ease;
}
.eh-ring::after {
    content: "";
    position: absolute; inset: 9px; border-radius: 50%; background: #fff;
}
.eh-ring > span {
    position: relative; z-index: 1; font-weight: 800; font-size: 1.1rem; color: #1f2937;
}
.eh-ring.eh-ring-lg { width: 120px; height: 120px; }
.eh-ring.eh-ring-lg > span { font-size: 1.5rem; }

/* ---------- Timeline ---------- */
.eh-timeline { position: relative; padding-left: 1.6rem; margin: 0; list-style: none; }
.eh-timeline::before {
    content: ""; position: absolute; left: .42rem; top: .3rem; bottom: .3rem;
    width: 2px; background: #e5eaf0;
}
.eh-timeline > li { position: relative; padding-bottom: 1.05rem; }
.eh-timeline > li:last-child { padding-bottom: 0; }
.eh-timeline > li::before {
    content: ""; position: absolute; left: -1.36rem; top: .25rem;
    width: 12px; height: 12px; border-radius: 50%;
    background: #cbd5e1; border: 3px solid #fff; box-shadow: 0 0 0 1px #e5eaf0;
}
.eh-timeline > li.eh-step-done::before { background: #34a853; }
.eh-timeline > li.eh-step-active::before { background: #1a73e8; box-shadow: 0 0 0 4px rgba(26,115,232,.15); }
.eh-timeline > li.eh-step-danger::before { background: #e11d48; }
.eh-timeline .eh-timeline-title { font-weight: 700; font-size: .9rem; }
.eh-timeline .eh-timeline-meta { font-size: .78rem; color: #64748b; }

/* ---------- Chips ---------- */
.eh-chip {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .35rem .75rem; border-radius: 999px;
    background: #f1f5f9; color: #334155;
    font-size: .78rem; font-weight: 600;
}
.eh-chip-primary { background: rgba(26,115,232,.12); color: #1a73e8; }
.eh-chip-success { background: rgba(52,168,83,.14); color: #0f9d58; }
.eh-chip-warning { background: rgba(245,158,11,.16); color: #b45309; }
.eh-chip-danger  { background: rgba(225,29,72,.12); color: #be123c; }
.eh-chip-info    { background: rgba(8,145,178,.14); color: #0e7490; }

/* ---------- Tables ---------- */
.eh-table { width: 100%; }
.eh-table thead th {
    position: sticky; top: 0; z-index: 2;
    background: #f8fafc;
    font-size: .72rem; letter-spacing: .06em; text-transform: uppercase;
    color: #64748b; font-weight: 700; border-bottom: 1px solid #eef2f7;
}
.eh-table tbody tr { transition: background .15s ease; }
.eh-table tbody tr:hover { background: #f8fafc; }

/* Avatar */
.eh-avatar {
    width: 42px; height: 42px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; color: #fff; background: var(--eh-grad-primary);
    text-transform: uppercase;
}
.eh-avatar-sm { width: 34px; height: 34px; font-size: .8rem; }
.eh-avatar-lg { width: 64px; height: 64px; font-size: 1.3rem; }

/* ---------- Buttons ---------- */
.btn { border-radius: 10px; transition: var(--eh-transition); font-weight: 600; }
.btn:not(.btn-link):hover { transform: translateY(-1px); }
.btn-primary { box-shadow: 0 2px 8px rgba(26,115,232,.28); }
.btn-success { box-shadow: 0 2px 8px rgba(52,168,83,.25); }

/* ---------- Forms ---------- */
.form-control, .form-select { border-radius: 10px; border-color: #e2e8f0; }
.form-control:focus, .form-select:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 .2rem rgba(26,115,232,.15);
}

/* ---------- Empty state ---------- */
.eh-empty { text-align: center; padding: 2.5rem 1rem; color: #94a3b8; }
.eh-empty i { font-size: 2.6rem; margin-bottom: .75rem; opacity: .6; display: block; }

/* ---------- Reveal on scroll ---------- */
.eh-reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
.eh-reveal.eh-in { opacity: 1; transform: none; }

/* ---------- Global polish (applies across all modules) ---------- */
.card { border-radius: var(--eh-radius); }
.card-header {
    border-top-left-radius: var(--eh-radius) !important;
    border-top-right-radius: var(--eh-radius) !important;
}
.card-footer {
    border-bottom-left-radius: var(--eh-radius) !important;
    border-bottom-right-radius: var(--eh-radius) !important;
}
.card-header h1, .card-header h2, .card-header h3,
.card-header h4, .card-header h5, .card-header h6 { margin-bottom: 0; }

.badge { border-radius: 8px; padding: .38em .7em; font-weight: 600; }
.badge.rounded-pill { border-radius: 999px !important; }

.progress { border-radius: 999px; background-color: #eef2f7; }
.progress-bar { border-radius: 999px; }

.alert { border: 0; border-radius: var(--eh-radius-sm); box-shadow: var(--eh-shadow-1); }
.alert-success { background: #ecfdf3; color: #05603a; }
.alert-danger  { background: #fef3f2; color: #912018; }
.alert-warning { background: #fffaeb; color: #93370d; }
.alert-info    { background: #eff8ff; color: #0b4a6f; }

.modal-content { border: 0; border-radius: var(--eh-radius); box-shadow: var(--eh-shadow-3); }
.dropdown-menu { border-radius: var(--eh-radius-sm); box-shadow: var(--eh-shadow-2); }

.pagination .page-link { border: 0; border-radius: 8px !important; margin: 0 2px; color: #334155; }
.pagination .page-item.active .page-link { background: var(--eh-grad-primary); box-shadow: 0 2px 8px rgba(26,115,232,.3); }

.nav-tabs .nav-link { border: 0; border-bottom: 3px solid transparent; color: #64748b; font-weight: 600; border-radius: 0; }
.nav-tabs .nav-link.active { border-bottom-color: #1a73e8; color: #1a73e8; background: transparent; }

.input-group-text { border-radius: 10px; background: #f8fafc; border-color: #e2e8f0; }

.list-group-item { border-color: #eef2f7; }
.table > :not(caption) > * > * { padding-top: .7rem; padding-bottom: .7rem; }
hr { opacity: .1; }

h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5 { letter-spacing: -.01em; }

/* Responsive tables */
@media (max-width: 767.98px) {
    .table-responsive { border-radius: var(--eh-radius-sm); }
}

/* Print: hide chrome */
@media print {
    .navbar, .footer, .style-changer-widget, .eh-progressbar, .eh-toast-wrap { display: none !important; }
    .eh-reveal { opacity: 1 !important; transform: none !important; }
}

/* ---------- Toasts ---------- */
.eh-toast-wrap {
    position: fixed; right: 1rem; bottom: 1rem; z-index: 2100;
    display: flex; flex-direction: column; gap: .5rem; max-width: 340px;
}
.eh-toast {
    background: #fff; border-radius: 12px; box-shadow: var(--eh-shadow-3);
    padding: .8rem 1rem; display: flex; align-items: flex-start; gap: .6rem;
    border-left: 4px solid #1a73e8; animation: eh-toast-in .3s ease;
}
.eh-toast.eh-toast-success { border-left-color: #34a853; }
.eh-toast.eh-toast-warning { border-left-color: #f59e0b; }
.eh-toast.eh-toast-danger  { border-left: 4px solid #e11d48; }
@keyframes eh-toast-in { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* Skeleton loader */
.eh-skeleton {
    background: linear-gradient(90deg, #eef2f7 25%, #f6f9fc 37%, #eef2f7 63%);
    background-size: 400% 100%;
    animation: eh-shimmer 1.3s ease infinite;
    border-radius: 8px;
}
@keyframes eh-shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* Soft background utilities */
.eh-bg-soft { background: #f6f9fc; }
.eh-rounded { border-radius: var(--eh-radius); }

/* Counter default */
.eh-count { font-variant-numeric: tabular-nums; }

/* Hover-grow image/icon */
.eh-hover-grow { transition: var(--eh-transition); }
.eh-hover-grow:hover { transform: scale(1.04); }

@media (max-width: 768px) {
    .eh-stat { min-height: 92px; }
    .eh-stat .eh-stat-value { font-size: 1.55rem; }
    .eh-hero { border-radius: var(--eh-radius-sm); }
}

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
    .eh-reveal { opacity: 1; transform: none; }
}
