/* ═══════════════════════════════════════════════════════
   ENHANCED FRONTEND STYLES — RMS IC System
   Overrides & enhancements for index.php
   ═══════════════════════════════════════════════════════ */

/* ── Smooth scroll ── */
html {
    scroll-behavior: smooth;
}

/* ── Body: subtle animated gradient ── */
body {
    background:
        radial-gradient(
            ellipse 80% 60% at 20% 0%,
            rgba(79, 70, 229, 0.035) 0%,
            transparent 60%
        ),
        radial-gradient(
            ellipse 60% 50% at 80% 100%,
            rgba(124, 58, 237, 0.025) 0%,
            transparent 55%
        ),
        radial-gradient(
            ellipse 50% 40% at 50% 50%,
            rgba(79, 70, 229, 0.015) 0%,
            transparent 70%
        ),
        var(--bg, #f8fafc);
    background-attachment: fixed;
}

/* ── NAVBAR: premium glass ── */
#navbar {
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(22px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(22px) saturate(180%) !important;
    border-bottom: 1px solid rgba(226, 232, 240, 0.4) !important;
}
#navbar.scrolled {
    box-shadow: 0 4px 28px rgba(0, 0, 0, 0.09) !important;
    border-bottom-color: rgba(226, 232, 240, 0.75) !important;
}

/* Logo glow */
.nav-logo {
    transition: transform 0.2s ease;
}
.nav-logo:hover {
    transform: translateY(-1px);
}
.nav-logo img {
    filter: drop-shadow(0 2px 8px rgba(79, 70, 229, 0.18));
}
.nav-logo-text {
    background: linear-gradient(135deg, #4f46e5, #7c3aed) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

/* Nav link underline animation */
.nav-link {
    position: relative;
    transition: all 0.2s ease !important;
}
.nav-link::after {
    content: "";
    position: absolute;
    bottom: 1px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #4f46e5, #7c3aed);
    border-radius: 2px;
    transition: width 0.25s ease;
}
.nav-link:hover::after,
.nav-link.active::after {
    width: 55%;
}
.nav-link:hover,
.nav-link.active {
    background: rgba(238, 242, 255, 0.8) !important;
    color: #4f46e5 !important;
}

/* ── LOGIN BUTTON: shimmer effect ── */
.btn-login {
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease !important;
}
.btn-login::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.25),
        transparent
    );
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}
.btn-login:hover::after {
    transform: translateX(100%);
}
.btn-login:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 28px rgba(79, 70, 229, 0.45) !important;
}
.btn-login:active {
    transform: translateY(0) scale(0.97) !important;
}

/* ── STATS BAR: frosted glass ── */
.stats-bar {
    background: rgba(255, 255, 255, 0.75) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow:
        0 8px 32px rgba(79, 70, 229, 0.08),
        0 2px 8px rgba(0, 0, 0, 0.04) !important;
    border: 1px solid rgba(226, 232, 240, 0.6) !important;
}
.stat-num {
    font-size: 2rem !important;
    letter-spacing: -0.02em;
}
.stat-item {
    transition: transform 0.25s ease;
}
.stat-item:hover {
    transform: translateY(-3px);
}

/* ── CARDS: enhanced hover ── */
.card {
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.04),
        0 4px 16px rgba(79, 70, 229, 0.04);
}
.card:hover {
    transform: translateY(-6px) !important;
    box-shadow:
        0 20px 40px rgba(79, 70, 229, 0.12),
        0 0 0 1px rgba(79, 70, 229, 0.15),
        0 4px 12px rgba(0, 0, 0, 0.06) !important;
    border-color: rgba(79, 70, 229, 0.25) !important;
}
.card:hover .card-img-wrap img {
    transform: scale(1.06);
}
.card:hover .card-title {
    color: #4f46e5;
}

/* ── DEP CARDS: polished ── */
.dep-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
.dep-card:hover {
    transform: translateY(-4px) !important;
    box-shadow:
        0 16px 36px rgba(79, 70, 229, 0.12),
        0 0 0 1px rgba(79, 70, 229, 0.12) !important;
    border-color: rgba(79, 70, 229, 0.3) !important;
}

/* ── SECTION HEADINGS: decorative line ── */
.section-head h2 {
    position: relative;
    padding-bottom: 0.5rem;
}
.section-head h2::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 48px;
    height: 3px;
    background: linear-gradient(90deg, #4f46e5, #7c3aed);
    border-radius: 3px;
}

/* ── PAGE HERO: enhanced gradient ── */
.page-hero {
    background: linear-gradient(
        135deg,
        #4338ca 0%,
        #4f46e5 40%,
        #7c3aed 100%
    ) !important;
    position: relative;
    overflow: hidden;
}
.page-hero::before {
    content: "";
    position: absolute;
    top: -50%;
    right: -20%;
    width: 500px;
    height: 500px;
    background: radial-gradient(
        circle,
        rgba(255, 255, 255, 0.08) 0%,
        transparent 70%
    );
    border-radius: 50%;
}
.page-hero::after {
    content: "";
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(
        circle,
        rgba(255, 255, 255, 0.05) 0%,
        transparent 70%
    );
    border-radius: 50%;
}

/* ── DEPARTMENT HERO: enhanced ── */
.dep-hero {
    background: linear-gradient(
        135deg,
        #3730a3 0%,
        #4f46e5 40%,
        #7c3aed 100%
    ) !important;
    position: relative;
    overflow: hidden;
}
.dep-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(
            circle at 20% 50%,
            rgba(255, 255, 255, 0.06) 0%,
            transparent 50%
        ),
        radial-gradient(
            circle at 80% 20%,
            rgba(255, 255, 255, 0.04) 0%,
            transparent 50%
        );
}

/* ── TAB BUTTONS: polished ── */
.tab-btn {
    transition: all 0.25s ease !important;
}
.tab-btn:hover {
    background: #eef2ff !important;
    color: #4f46e5 !important;
    transform: translateY(-1px);
}
.tab-btn.active {
    background: linear-gradient(135deg, #4f46e5, #7c3aed) !important;
    color: white !important;
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.3) !important;
}

/* ── TABS PANEL: fade animation ── */
.tab-panel {
    animation: tabFadeIn 0.3s ease;
}
@keyframes tabFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── EMPTY STATE: enhanced ── */
.empty-state i {
    opacity: 0.18;
    filter: grayscale(0.3);
}
.empty-state p {
    color: #94a3b8;
    font-weight: 300;
}

/* ── ESTABLISHMENT CARD: enhanced ── */
.est-card {
    transition: all 0.3s ease !important;
}
.est-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(79, 70, 229, 0.08) !important;
    border-color: rgba(79, 70, 229, 0.2) !important;
}

/* ── TESTING CARD: enhanced ── */
.test-card {
    transition: all 0.3s ease !important;
}
.test-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 36px rgba(79, 70, 229, 0.1) !important;
}

/* ── FOOTER: subtle top border glow ── */
footer {
    background: linear-gradient(180deg, #0f172a, #1e293b) !important;
    position: relative;
    overflow: hidden;
}
footer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(79, 70, 229, 0.4),
        rgba(124, 58, 237, 0.4),
        transparent
    );
}
.footer-brand {
    background: linear-gradient(135deg, #a5b4fc, #c4b5fd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.footer-h {
    position: relative;
    padding-bottom: 0.5rem;
}
.footer-h::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 24px;
    height: 2px;
    background: rgba(99, 102, 241, 0.5);
    border-radius: 2px;
}

/* ── FLOATING TOOLS: enhanced ── */
.float-btn {
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    box-shadow: 0 8px 28px rgba(79, 70, 229, 0.1) !important;
    transition: all 0.25s ease !important;
}
.float-btn:hover {
    transform: translateY(-3px) scale(1.06) !important;
    background: linear-gradient(135deg, #4f46e5, #7c3aed) !important;
    color: white !important;
    box-shadow: 0 14px 32px rgba(79, 70, 229, 0.35) !important;
}

/* ── TOAST: enhanced ── */
.toast {
    background: linear-gradient(135deg, #1e293b, #0f172a) !important;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25) !important;
}

/* ── SEARCH OVERLAY: deeper glass ── */
.search-overlay {
    background: rgba(15, 23, 42, 0.55) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
}
.search-dialog {
    border: 1px solid rgba(255, 255, 255, 0.6) !important;
}

/* ── BREADCRUMB: subtle ── */
.breadcrumb a {
    transition: color 0.2s ease;
}
.breadcrumb a:hover {
    color: white !important;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ── VIEW ALL LINK: hover animation ── */
.view-all {
    transition: all 0.25s ease !important;
}
.view-all:hover {
    background: #eef2ff !important;
    gap: 0.6rem !important;
}
.view-all:hover i {
    transform: translateX(3px);
    transition: transform 0.2s ease;
}

/* ── MEGA DROPDOWN: polished ── */
.mega-wrap {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.95) !important;
    box-shadow:
        0 24px 48px rgba(79, 70, 229, 0.12),
        0 4px 16px rgba(0, 0, 0, 0.06) !important;
}

/* ── DROP MENU: polished ── */
.drop-menu {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: rgba(255, 255, 255, 0.92) !important;
    box-shadow:
        0 16px 36px rgba(79, 70, 229, 0.1),
        0 2px 8px rgba(0, 0, 0, 0.04) !important;
}

/* ── HERO PLAIN (no banner): enhanced ── */
.hero-plain {
    background: linear-gradient(
        135deg,
        #eef2ff 0%,
        #f5f3ff 40%,
        #f0fdfa 100%
    ) !important;
    position: relative;
    overflow: hidden;
}
.hero-plain::before {
    content: "";
    position: absolute;
    top: -30%;
    right: -15%;
    width: 400px;
    height: 400px;
    background: radial-gradient(
        circle,
        rgba(79, 70, 229, 0.06) 0%,
        transparent 70%
    );
    border-radius: 50%;
}
.hero-plain h1 span {
    background: linear-gradient(135deg, #4f46e5, #7c3aed) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

/* ── SLIDER: smoother transitions ── */
.slide {
    transition: opacity 1s ease;
}
.slide-overlay {
    background: linear-gradient(
        to right,
        rgba(15, 23, 42, 0.65) 0%,
        rgba(15, 23, 42, 0.15) 50%,
        transparent 100%
    ) !important;
}
.slide-text h2 {
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.4);
}

/* ── SECTION ALT: subtle stripes ── */
.section-alt {
    background: linear-gradient(
        180deg,
        #fafbff 0%,
        #f5f3ff 50%,
        #f8fafc 100%
    ) !important;
}

/* ── LIST FILTER: enhanced ── */
.list-filter {
    transition: all 0.25s ease;
    box-shadow: 0 2px 12px rgba(79, 70, 229, 0.05) !important;
}
.list-filter:focus-within {
    box-shadow:
        0 4px 20px rgba(79, 70, 229, 0.1),
        0 0 0 3px rgba(79, 70, 229, 0.06) !important;
    border-color: #c7d2fe !important;
}

/* ── SEARCH WRAP: enhanced ── */
.search-wrap {
    box-shadow: 0 4px 20px rgba(79, 70, 229, 0.06) !important;
}
.search-wrap:focus-within {
    box-shadow:
        0 6px 28px rgba(79, 70, 229, 0.1),
        0 0 0 3px rgba(79, 70, 229, 0.05) !important;
}

/* ── RESPONSIVE: mobile tweaks ── */
@media (max-width: 768px) {
    .section-head h2::after {
        width: 36px;
    }
    .card:hover {
        transform: translateY(-3px) !important;
    }
    .float-btn {
        width: 42px;
        height: 42px;
        border-radius: 13px;
    }
    .hero-plain h1 {
        font-size: 2rem !important;
    }
}

/* ── SELECTION: branded ── */
::selection {
    background: rgba(79, 70, 229, 0.18);
    color: #3730a3;
}

/* ── SCROLLBAR: slim and themed ── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ── FOCUS RING: subtle indigo ── */
input:focus-visible,
button:focus-visible,
a:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid rgba(79, 70, 229, 0.3);
    outline-offset: 2px;
}

/* ── NEWS DETAIL BODY: readable ── */
.news-detail-body {
    font-size: 0.97rem !important;
    line-height: 2 !important;
    color: #334155 !important;
}
.news-detail-body p {
    margin-bottom: 1.25rem;
}

/* ── PILL/BADGE: micro-refinement ── */
.pill {
    letter-spacing: 0.02em;
}

/* ── SECTION SPACING: breathing room ── */
.section {
    padding: 4rem 0;
}
