/* ============================================================
   STAI Kuala Kapuas Alumni System — Modern Stylesheet v2.0
   Bootstrap 5 + Dark/Light + Glassmorphism + Elegant UI
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

/* ===== CSS VARIABLES ===== */
:root {
    /* Brand */
    --primary:        #0b1d3a;
    --secondary:      #1e40af;
    --primary-mid:    #1a3a6b;
    --primary-light:  #2563eb;
    --primary-glow:   rgba(37,99,235,0.15);
    --accent:         #f59e0b;
    --accent-dark:    #d97706;
    --accent-light:   #fde68a;

    /* UI */
    --text:           #0f172a;
    --text-soft:      #334155;
    --text-muted:     #64748b;
    --bg:             #f1f5f9;
    --bg-card:        #ffffff;
    --bg-alt:         #f8fafc;
    --border:         #e2e8f0;
    --bg-sidebar:     #0b1d3a;

    /* Shadows */
    --shadow-xs:      0 1px 3px rgba(15,23,42,0.08);
    --shadow-sm:      0 4px 12px rgba(15,23,42,0.08);
    --shadow:         0 8px 24px rgba(15,23,42,0.10);
    --shadow-lg:      0 20px 48px rgba(15,23,42,0.14);
    --shadow-primary: 0 8px 24px rgba(37,99,235,0.25);

    /* Shape */
    --radius:         14px;
    --radius-sm:      8px;
    --radius-xs:      6px;
    --radius-pill:    100px;

    /* Gradients */
    --grad-primary:   linear-gradient(135deg, #0b1d3a 0%, #1e40af 100%);
    --grad-accent:    linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);

    --navbar-bg:      var(--grad-primary);
    --footer-bg:      #0b1d3a;
}

[data-theme="dark"] {
    --text:           #f1f5f9;
    --text-soft:      #cbd5e1;
    --text-muted:     #94a3b8;
    --bg:             #0f172a;
    --bg-card:        #1e293b;
    --bg-alt:         #0f172a;
    --border:         #334155;
    --bg-sidebar:     #0a1628;
    --secondary:      #2563eb;
    --shadow-xs:      0 1px 3px rgba(0,0,0,0.30);
    --shadow-sm:      0 4px 12px rgba(0,0,0,0.25);
    --shadow:         0 8px 24px rgba(0,0,0,0.35);
    --shadow-lg:      0 20px 48px rgba(0,0,0,0.45);
    --shadow-primary: 0 8px 24px rgba(37,99,235,0.35);
    --grad-primary:   linear-gradient(135deg, #0a1628 0%, #1e3a8a 100%);
    --navbar-bg:      var(--grad-primary);
    --footer-bg:      #060d1a;
    --primary-glow:   rgba(37,99,235,0.22);
}

/* ===== BASE ===== */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    transition: background-color .3s, color .3s;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

main, .main-content { flex: 1; }

a { color: var(--primary-light); text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent); }

img { max-width: 100%; height: auto; }

::selection { background: var(--primary-glow); color: var(--primary-light); }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary-light), var(--primary-mid));
    border-radius: 3px;
}

/* ===== NAVBAR ===== */
.navbar-custom {
    background: var(--navbar-bg) !important;
    padding-block: 0;
    min-height: 64px;
    box-shadow: 0 2px 20px rgba(11,29,58,0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.navbar-custom .container {
    min-height: 64px;
    display: flex;
    align-items: center;
}

.navbar-custom .navbar-brand {
    color: #fff !important;
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: -0.01em;
    gap: 10px;
    display: flex;
    align-items: center;
}

.navbar-custom .navbar-brand img {
    height: 38px;
    width: 38px;
    object-fit: contain;
    border-radius: 8px;
    background: rgba(255,255,255,0.12);
    padding: 4px;
}

.navbar-custom .nav-link {
    color: rgba(255,255,255,0.82) !important;
    font-weight: 500;
    font-size: 0.88rem;
    padding: 0.45rem 0.85rem !important;
    border-radius: var(--radius-xs);
    transition: background .2s, color .2s;
    position: relative;
}

.navbar-custom .nav-link:hover,
.navbar-custom .nav-link.active {
    color: #fff !important;
    background: rgba(255,255,255,0.12);
}

.navbar-custom .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 18px;
    height: 2px;
    background: var(--accent);
    border-radius: 2px;
}

.navbar-custom .navbar-toggler {
    color: #fff;
    border-color: rgba(255,255,255,0.2);
}

/* ===== THEME TOGGLE ===== */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.18);
    color: rgba(255,255,255,0.9);
    padding: 5px 14px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: background .2s, border-color .2s;
    font-family: inherit;
}

.theme-toggle:hover {
    background: rgba(255,255,255,0.20);
    border-color: rgba(255,255,255,0.30);
}

.toggle-icon { font-size: 0.95rem; line-height: 1; }
.toggle-label { font-size: 0.78rem; }

/* Login btn in navbar */
.navbar-custom .btn-warning {
    background: var(--accent);
    color: var(--primary) !important;
    font-weight: 700;
    font-size: 0.85rem;
    border-radius: var(--radius-pill);
    border: none;
    transition: background .2s, box-shadow .2s, transform .15s;
}

.navbar-custom .btn-warning:hover {
    background: var(--accent-dark);
    color: #fff !important;
    box-shadow: 0 4px 14px rgba(245,158,11,0.45);
    transform: translateY(-1px);
}

/* ===== HERO SECTION ===== */
.hero-section {
    background: var(--grad-primary);
    min-height: 100vh;
    padding: 0;
    color: #fff;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.hero-section::before,
.hero-section::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.hero-section::before {
    width: 550px;
    height: 550px;
    background: radial-gradient(circle, rgba(37,99,235,0.22) 0%, transparent 70%);
    top: -180px;
    right: -180px;
    animation: heroOrb1 9s ease-in-out infinite alternate;
}

.hero-section::after {
    width: 360px;
    height: 360px;
    background: radial-gradient(circle, rgba(245,158,11,0.14) 0%, transparent 70%);
    bottom: -100px;
    left: 12%;
    animation: heroOrb2 11s ease-in-out infinite alternate;
}

@keyframes heroOrb1 { to { transform: translate(40px, 30px) scale(1.1); } }
@keyframes heroOrb2 { to { transform: translate(-30px, -20px) scale(1.08); } }
@keyframes bounceDown {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(6px); }
}

.hero-section .container { position: relative; z-index: 2; padding-block: 6rem 5rem; }

/* ===== SEARCH HERO FUTURISTIC BACKGROUND ===== */
/* Only override fullscreen on search.php (no .hero-home class) */
.hero-section.hero-search:not(.hero-home) {
    min-height: unset;
    display: block;
    align-items: unset;
}
.hero-search {
    isolation: isolate;
    background: linear-gradient(130deg,
        #08162f 0%,
        #0b1d3a 18%,
        #1d4ed8 42%,
        #2563eb 62%,
        #d97706 82%,
        #f59e0b 100%);
    background-size: 280% 280%;
    animation: heroGradientFlow 8s ease-in-out infinite;
    position: relative;
}

.hero-search::before,
.hero-search::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.hero-search::before {
    background:
        radial-gradient(circle at 15% 25%, rgba(255,255,255,0.18), transparent 26%),
        radial-gradient(circle at 80% 30%, rgba(255,255,255,0.12), transparent 24%),
        radial-gradient(circle at 65% 78%, rgba(255,255,255,0.10), transparent 22%);
    animation: heroGlowDrift 9s ease-in-out infinite alternate;
    z-index: 0;
}

.hero-search::after {
    background: linear-gradient(115deg, transparent 25%, rgba(255,255,255,0.14) 50%, transparent 75%);
    transform: translateX(-140%) skewX(-18deg);
    animation: heroShineSweep 6.5s linear infinite;
    z-index: 0;
}

.hero-home {
    background: none;
    animation: none;
}

.hero-home .hero-video-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.hero-home .hero-video-bg video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hero-home .hero-video-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(135deg,
        rgba(6,19,39,0.78) 0%,
        rgba(11,29,58,0.74) 16%,
        rgba(29,78,216,0.62) 38%,
        rgba(37,99,235,0.60) 58%,
        rgba(30,64,175,0.65) 72%,
        rgba(217,119,6,0.65) 88%,
        rgba(245,158,11,0.70) 100%);
    background-size: 320% 320%;
    animation: heroGradientFlowHome 10s ease-in-out infinite;
}

@keyframes heroGradientFlowHome {
    0%   { background-position: 0% 50%,   center; }
    25%  { background-position: 100% 35%,  center; }
    50%  { background-position: 85% 100%,  center; }
    75%  { background-position: 15% 70%,   center; }
    100% { background-position: 0% 50%,   center; }
}

.hero-home::before {
    background:
        radial-gradient(circle at 12% 22%, rgba(255,255,255,0.22), transparent 24%),
        radial-gradient(circle at 82% 18%, rgba(255,255,255,0.14), transparent 22%),
        radial-gradient(circle at 70% 82%, rgba(255,255,255,0.12), transparent 20%),
        radial-gradient(circle at 30% 78%, rgba(245,158,11,0.12), transparent 18%);
    animation-duration: 11s;
}

.hero-home::after {
    background:
        linear-gradient(110deg, transparent 18%, rgba(255,255,255,0.14) 40%, transparent 62%),
        linear-gradient(130deg, transparent 30%, rgba(255,255,255,0.08) 52%, transparent 74%);
    transform: translateX(-140%) skewX(-18deg);
    animation-duration: 8s;
}

@keyframes heroGradientFlow {
    0% { background-position: 0% 50%; }
    25% { background-position: 100% 35%; }
    50% { background-position: 85% 100%; }
    75% { background-position: 15% 70%; }
    100% { background-position: 0% 50%; }
}

@keyframes heroGlowDrift {
    from { transform: translate3d(0, 0, 0) scale(1); opacity: 0.95; }
    to { transform: translate3d(10px, -8px, 0) scale(1.06); opacity: 1; }
}

@keyframes heroShineSweep {
    0% { transform: translateX(-140%) skewX(-18deg); opacity: 0; }
    12% { opacity: 0.55; }
    55% { opacity: 0.35; }
    100% { transform: translateX(140%) skewX(-18deg); opacity: 0; }
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(245,158,11,0.15);
    border: 1px solid rgba(245,158,11,0.35);
    color: #fde68a;
    padding: 6px 16px;
    border-radius: var(--radius-pill);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 1.25rem;
}

.hero-title {
    font-size: clamp(2.1rem, 5vw, 3.2rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1.1rem;
    color: #fff;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: 1rem;
    opacity: 0.80;
    line-height: 1.75;
    max-width: 520px;
    font-weight: 400;
}

/* ===== SEARCH BOX (hero) ===== */
.search-box {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.97);
    border-radius: var(--radius-pill);
    padding: 6px 6px 6px 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.20);
    max-width: 480px;
    transition: box-shadow .25s;
}

.search-box:focus-within {
    box-shadow: 0 8px 40px rgba(37,99,235,0.25), 0 0 0 2px var(--primary-light);
}

.search-box input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.93rem;
    color: #1e293b;
    font-family: inherit;
    font-weight: 500;
}

.search-box input::placeholder { color: #94a3b8; }

.search-box button {
    background: var(--grad-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-pill);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity .2s, transform .15s;
    flex-shrink: 0;
}

.search-box button:hover { opacity: 0.85; transform: scale(1.06); }

/* ===== STATS CARDS ===== */
.stats-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.75rem 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: transform .3s cubic-bezier(.4,0,.2,1), box-shadow .3s;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.stats-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--grad-primary);
    opacity: 0;
    transition: opacity .3s;
}

.stats-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow);
}

.stats-card:hover::before { opacity: 1; }

.stats-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin: 0 auto 1rem;
}

.stats-icon.blue   { background: rgba(37,99,235,0.10);  color: #2563eb; }
.stats-icon.green  { background: rgba(5,150,105,0.10);  color: #059669; }
.stats-icon.amber  { background: rgba(245,158,11,0.10); color: #d97706; }
.stats-icon.rose   { background: rgba(225,29,72,0.10);  color: #e11d48; }

/* Legacy icon colors for backward compat */
.stats-icon.text-primary { background: rgba(37,99,235,0.10);  color: #2563eb !important; font-size: inherit; }
.stats-icon.text-success { background: rgba(5,150,105,0.10);  color: #059669 !important; font-size: inherit; }
.stats-icon.text-warning { background: rgba(245,158,11,0.10); color: #d97706 !important; font-size: inherit; }
.stats-icon.text-danger  { background: rgba(225,29,72,0.10);  color: #e11d48 !important; font-size: inherit; }

.stats-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
    margin-bottom: 0.4rem;
    letter-spacing: -0.03em;
}

.stats-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ===== SECTION TITLE ===== */
.section-title {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 0.5rem;
    position: relative;
    padding-bottom: 0.9rem;
    letter-spacing: -0.02em;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 44px;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), #ef4444);
    border-radius: 2px;
}

.section-title.text-center::after {
    left: 50%;
    transform: translateX(-50%);
}

[data-theme="dark"] .section-title { color: var(--text); }

/* ===== ALUMNI CARD ===== */
.alumni-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--border);
    transition: transform .3s cubic-bezier(.4,0,.2,1), box-shadow .3s, border-color .3s;
    height: 100%;
}

.alumni-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(37,99,235,0.18);
}

.alumni-card .card-img-wrap {
    overflow: hidden;
}

.alumni-card img {
    width: 100%;
    height: 190px;
    object-fit: cover;
    transition: transform .4s ease;
    display: block;
}

.alumni-card:hover img { transform: scale(1.06); }

.alumni-card .card-body { padding: 1.1rem 1.2rem; }

.alumni-card .card-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.alumni-card .card-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ===== DASH-CARD (admin stats) ===== */
.dash-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.4rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    transition: transform .3s, box-shadow .3s;
}

.dash-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--grad-primary);
    border-radius: 4px 0 0 4px;
}

.dash-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.dash-card h3 {
    font-size: 1.85rem;
    font-weight: 800;
    margin: 0 0 2px;
    line-height: 1;
    letter-spacing: -0.03em;
}

.dash-card p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
    font-weight: 500;
}

.icon-box {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}

/* ===== PAGE HEADER ===== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.75rem;
    padding-bottom: 1.1rem;
    border-bottom: 1px solid var(--border);
}

.page-header h4 {
    font-weight: 800;
    color: var(--text);
    margin: 0;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}

/* ===== SIDEBAR ===== */
.sidebar {
    background: var(--bg-sidebar);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0,0,0,0.2);
    position: sticky;
    top: 80px;
    border: 1px solid rgba(255,255,255,0.05);
}

.sidebar-header {
    background: rgba(0,0,0,0.25);
    padding: 1.5rem 1rem;
    text-align: center;
    position: relative;
}

.sidebar-header::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}

.sidebar-header img {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255,255,255,0.18);
    box-shadow: 0 0 0 4px rgba(37,99,235,0.25);
    margin-bottom: 0.8rem;
}

.sidebar-header h6 {
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    margin: 0 0 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-header small {
    color: rgba(255,255,255,0.48);
    font-size: 0.72rem;
}

.sidebar-menu {
    list-style: none;
    padding: 0.5rem 0 0.75rem;
    margin: 0;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.65rem 1.2rem;
    color: rgba(255,255,255,0.65);
    font-size: 0.86rem;
    font-weight: 500;
    transition: all .2s;
    border-left: 3px solid transparent;
}

.sidebar-menu li a i {
    width: 18px;
    text-align: center;
    font-size: 0.88rem;
    opacity: 0.75;
    transition: opacity .2s;
}

.sidebar-menu li a:hover {
    background: rgba(255,255,255,0.07);
    color: #fff;
    border-left-color: rgba(255,255,255,0.2);
    padding-left: 1.5rem;
}

.sidebar-menu li a:hover i { opacity: 1; }

.sidebar-menu li a.active {
    background: rgba(37,99,235,0.18);
    color: #fff;
    border-left-color: var(--accent);
    font-weight: 600;
}

.sidebar-menu li a.active i { opacity: 1; }

.sidebar-menu li a .badge {
    margin-left: auto;
    font-size: 0.68rem;
    padding: 0.2em 0.55em;
}

.sidebar-menu li a.text-danger { color: rgba(252,165,165,0.8) !important; }

.sidebar-menu li a.text-danger:hover {
    background: rgba(239,68,68,0.12);
    color: #fca5a5 !important;
    border-left-color: #ef4444;
}

/* ===== CARDS / PANELS (generic) ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
    overflow: hidden;
}

.card-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    color: var(--text);
    font-size: 0.9rem;
    padding: 1rem 1.25rem;
}

.card-header-custom {
    background: var(--grad-primary);
    color: #fff;
    font-weight: 700;
    font-size: 0.88rem;
    padding: 0.9rem 1.25rem;
    display: flex;
    align-items: center;
}

/* ===== TABLE ===== */
.table-responsive { border-radius: var(--radius-sm); overflow: hidden; }

.table {
    --bs-table-bg: var(--bg-card);
    --bs-table-color: var(--text);
    --bs-table-border-color: var(--border);
    --bs-table-striped-bg: var(--bg-alt);
    --bs-table-hover-bg: rgba(37,99,235,0.04);
    margin-bottom: 0;
    font-size: 0.875rem;
}

.table thead th {
    background: var(--primary);
    color: rgba(255,255,255,0.9);
    font-weight: 600;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: none;
    padding: 0.85rem 1rem;
    white-space: nowrap;
}

.table tbody td { padding: 0.8rem 1rem; vertical-align: middle; border-color: var(--border); }
.table tbody tr:last-child td { border-bottom: none; }

/* ===== FORMS ===== */
.form-control, .form-select {
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    color: var(--text);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    transition: border-color .2s, box-shadow .2s;
    padding: 0.55rem 0.85rem;
}

.form-control:focus, .form-select:focus {
    background: var(--bg-card);
    border-color: var(--primary-light);
    color: var(--text);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

.form-control::placeholder { color: var(--text-muted); opacity: 1; }

.form-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-soft, var(--text));
    margin-bottom: 0.4rem;
}

.input-group .btn { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

.input-group-text {
    background: var(--bg-alt);
    border: 1.5px solid var(--border);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ===== BUTTONS ===== */
.btn {
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.87rem;
    transition: transform .15s, box-shadow .2s, opacity .2s;
    font-family: inherit;
    letter-spacing: 0.01em;
}
.btn:hover   { transform: translateY(-1px); }
.btn:active  { transform: none; }

.btn-primary {
    background: var(--primary-light);
    border-color: var(--primary-light);
    color: #fff;
}
.btn-primary:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
    box-shadow: var(--shadow-primary);
}

.btn-outline-primary {
    color: var(--primary-light);
    border-color: var(--primary-light);
}
.btn-outline-primary:hover {
    background: var(--primary-light);
    border-color: var(--primary-light);
    box-shadow: var(--shadow-primary);
}

.btn-warning {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--primary);
    font-weight: 700;
}
.btn-warning:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
    color: #fff;
    box-shadow: 0 6px 18px rgba(245,158,11,0.4);
}

/* ===== ACTION BUTTON GROUP ===== */
.action-group {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.3rem;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 999px;
    box-shadow: var(--shadow-xs);
}

.action-group form {
    margin: 0;
}

.btn-icon {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 50%;
    background: transparent;
    color: var(--text-soft);
    text-decoration: none;
    position: relative;
    transition: all .2s ease;
    cursor: pointer;
}

.btn-icon i {
    font-size: 0.88rem;
}

.btn-icon:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-icon:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.16);
}

.btn-icon-detail {
    background: rgba(37,99,235,0.10);
    color: #1d4ed8;
    border-color: rgba(37,99,235,0.16);
}

.btn-icon-detail:hover {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

.btn-icon-edit {
    background: rgba(245,158,11,0.12);
    color: #b45309;
    border-color: rgba(245,158,11,0.18);
}

.btn-icon-edit:hover {
    background: #f59e0b;
    color: #fff;
    border-color: #f59e0b;
}

.btn-icon-delete {
    background: rgba(239,68,68,0.10);
    color: #dc2626;
    border-color: rgba(239,68,68,0.16);
}

.btn-icon-delete:hover {
    background: #ef4444;
    color: #fff;
    border-color: #ef4444;
}

.btn-icon[data-tip]::after {
    content: attr(data-tip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    transform: translateX(-50%) translateY(4px);
    background: rgba(15,23,42,0.92);
    color: #fff;
    padding: 0.35rem 0.55rem;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
    box-shadow: var(--shadow-sm);
    z-index: 20;
}

.btn-icon[data-tip]:hover::after,
.btn-icon[data-tip]:focus-visible::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

[data-theme="dark"] .action-group {
    background: rgba(255,255,255,0.03);
    border-color: var(--border);
}

[data-theme="dark"] .btn-icon {
    color: var(--text-soft);
}

[data-theme="dark"] .btn-icon-detail {
    background: rgba(37,99,235,0.18);
    color: #93c5fd;
    border-color: rgba(37,99,235,0.24);
}

[data-theme="dark"] .btn-icon-edit {
    background: rgba(245,158,11,0.18);
    color: #fcd34d;
    border-color: rgba(245,158,11,0.24);
}

[data-theme="dark"] .btn-icon-delete {
    background: rgba(239,68,68,0.18);
    color: #fca5a5;
    border-color: rgba(239,68,68,0.24);
}

/* ===== BADGES ===== */
.badge { font-weight: 600; font-size: 0.72rem; padding: 0.3em 0.65em; }

.badge-prodi {
    display: inline-block;
    background: rgba(37,99,235,0.10);
    color: #1d4ed8;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(37,99,235,0.18);
}

[data-theme="dark"] .badge-prodi {
    background: rgba(37,99,235,0.20);
    color: #93c5fd;
    border-color: rgba(37,99,235,0.28);
}

.recent-alumni-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}
.recent-alumni-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(37,99,235,0.15) !important;
}

.badge-tahun {
    display: inline-block;
    background: rgba(245,158,11,0.10);
    color: #b45309;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 9px;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(245,158,11,0.20);
}

[data-theme="dark"] .badge-tahun {
    background: rgba(245,158,11,0.18);
    color: #fcd34d;
    border-color: rgba(245,158,11,0.28);
}

/* ===== ALERTS ===== */
.alert {
    border-radius: var(--radius-sm);
    border: none;
    font-size: 0.88rem;
    font-weight: 500;
    padding: 0.85rem 1.1rem;
}
.alert-success { background: #dcfce7; color: #166534; }
.alert-danger   { background: #fee2e2; color: #991b1b; }
.alert-warning  { background: #fef3c7; color: #92400e; }
.alert-info     { background: #dbeafe; color: #1e40af; }

[data-theme="dark"] .alert-success { background: rgba(21,128,61,0.18);  color: #86efac; }
[data-theme="dark"] .alert-danger  { background: rgba(153,27,27,0.18);  color: #fca5a5; }
[data-theme="dark"] .alert-warning { background: rgba(120,53,15,0.18);  color: #fcd34d; }
[data-theme="dark"] .alert-info    { background: rgba(30,64,175,0.18);  color: #93c5fd; }

/* ===== DISCUSSION ITEM ===== */
.discussion-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem 1.25rem;
    transition: border-color .2s, box-shadow .2s, transform .2s;
    height: 100%;
}

.discussion-item:hover {
    border-color: rgba(37,99,235,0.25);
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

.discussion-title {
    font-weight: 700;
    font-size: 0.93rem;
    color: var(--text);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.discussion-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.discussion-meta span { display: flex; align-items: center; gap: 4px; }

/* ===== AVATAR SM ===== */
.avatar-sm {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
    flex-shrink: 0;
}

/* ===== LOGIN PAGE ===== */
.login-wrapper {
    min-height: 100vh;
    background: var(--grad-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    position: relative;
    overflow: hidden;
}

.login-wrapper::before,
.login-wrapper::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.login-wrapper::before {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(37,99,235,0.20) 0%, transparent 70%);
    top: -200px;
    right: -200px;
}

.login-wrapper::after {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(245,158,11,0.12) 0%, transparent 70%);
    bottom: -150px;
    left: 10%;
}

.login-card {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 2.75rem 2.25rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,255,255,0.06);
    position: relative;
    z-index: 1;
    border: 1px solid rgba(255,255,255,0.08);
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo img {
    height: 72px;
    width: 72px;
    object-fit: contain;
    margin-bottom: 0.9rem;
    filter: drop-shadow(0 4px 16px rgba(37,99,235,0.3));
}

.login-logo h4 {
    font-weight: 800;
    color: var(--text);
    font-size: 1.15rem;
    margin-bottom: 0.25rem;
    letter-spacing: -0.02em;
}

.login-logo p {
    color: var(--text-muted);
    font-size: 0.83rem;
    margin: 0;
}

/* ===== AVATAR MD ===== */
.avatar-md {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
    flex-shrink: 0;
}

/* ===== DISCUSSION ITEM AS LINK ===== */
a.discussion-item {
    display: block;
    text-decoration: none;
    color: inherit;
}

a.discussion-item:hover {
    border-color: rgba(37,99,235,0.30);
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
    color: inherit;
}

/* ===== CHAT LAYOUT ===== */
.chat-wrapper {
    display: flex;
    height: calc(100vh - 220px);
    min-height: 480px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.chat-contacts {
    width: 300px;
    min-width: 300px;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    flex-shrink: 0;
}

.chat-contacts-header {
    background: var(--grad-primary);
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.chat-contacts-list {
    overflow-y: auto;
    flex: 1;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    transition: background .15s;
    cursor: pointer;
    color: var(--text);
}

.contact-item:hover {
    background: var(--bg-alt);
    text-decoration: none;
    color: var(--text);
}

.contact-item.active {
    background: var(--primary-glow);
    border-left: 3px solid var(--primary-light);
    color: var(--text);
}

.contact-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
    flex-shrink: 0;
}

.contact-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 2px;
    line-height: 1.3;
}

.contact-nim {
    font-size: 0.71rem;
    color: var(--text-muted);
    margin: 0;
}

.unread-badge {
    background: var(--primary-light);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    border-radius: 10px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Chat box (right panel) */
.chat-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-alt);
    min-width: 0;
}

.chat-box-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 0.7rem 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    box-shadow: var(--shadow-xs);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.msg-bubble {
    max-width: 65%;
    padding: 0.55rem 0.9rem;
    border-radius: 18px;
    font-size: 0.875rem;
    line-height: 1.55;
    word-break: break-word;
}

.msg-sent {
    background: var(--primary-light);
    color: #fff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 8px rgba(37,99,235,0.18);
    align-self: flex-end;
}

.msg-recv {
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
    align-self: flex-start;
}

.d-flex.flex-column.align-items-end   > .msg-bubble { align-self: flex-end; }
.d-flex.flex-column.align-items-start > .msg-bubble { align-self: flex-start; }

.msg-time {
    display: block;
    font-size: 0.63rem;
    opacity: 0.55;
    margin-top: 3px;
    text-align: right;
}
.msg-recv .msg-time { text-align: left; }

.chat-input-area {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 0.8rem 1.1rem;
    flex-shrink: 0;
}

/* Dark mode */
[data-theme="dark"] .msg-recv {
    background: #1e2d45;
    border-color: var(--border);
}
[data-theme="dark"] .chat-box { background: #0d1b2e; }
[data-theme="dark"] .chat-messages { background: #0d1b2e; }
[data-theme="dark"] .contact-item.active { background: rgba(37,99,235,0.15); }

/* Mobile: JS toggles visibility between contacts and chat */
@media (max-width: 767.98px) {
    .chat-wrapper {
        height: calc(100vh - 152px); /* 64px navbar + 62px bottom nav + 26px py */
        min-height: 400px;
        border-radius: var(--radius-sm);
    }

    .chat-contacts {
        width: 100%;
        min-width: 0;
        border-right: none;
    }

    .chat-box {
        width: 100%;
        position: absolute;
        inset: 0;
        border-radius: inherit;
        z-index: 5;
    }

    .chat-wrapper { position: relative; }

    .msg-bubble { max-width: 80%; }

    .contact-item { padding: 0.7rem 0.85rem; }
}

/* Legacy .chat-bubble fallback */
.chat-bubble {
    max-width: 72%;
    padding: 0.65rem 1.05rem;
    border-radius: 16px;
    font-size: 0.875rem;
    line-height: 1.55;
    word-break: break-word;
}
.chat-bubble.me    { align-self:flex-end; background:var(--primary-light); color:#fff; border-bottom-right-radius:5px; }
.chat-bubble.other { align-self:flex-start; background:var(--bg-card); color:var(--text); border:1.5px solid var(--border); border-bottom-left-radius:5px; }
.chat-bubble .chat-time { font-size:0.68rem; opacity:0.60; margin-top:5px; }

/* ===== FOOTER ===== */
footer {
    background: var(--footer-bg);
    color: rgba(255,255,255,0.72);
    padding: 3rem 0 0;
    margin-top: auto;
    position: relative;
}

footer::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(37,99,235,0.5), rgba(245,158,11,0.5), transparent);
}

footer h6 {
    color: #fff;
    font-weight: 700;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

footer p.small {
    font-size: 0.82rem;
    line-height: 1.7;
}

footer a {
    color: rgba(255,255,255,0.52);
    transition: color .2s;
    font-size: 0.84rem;
}

footer a:hover { color: var(--accent); }

footer ul li { margin-bottom: 0.5rem; }

footer ul li a::before {
    content: '';
    display: inline-block;
    width: 5px;
    height: 5px;
    background: var(--accent);
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
    opacity: 0.6;
    transition: opacity .2s;
}

footer ul li a:hover::before { opacity: 1; }

.footer-bottom {
    background: rgba(0,0,0,0.25);
    padding: 1.1rem 0;
    font-size: 0.79rem;
    color: rgba(255,255,255,0.38);
    text-align: center;
    margin-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.05);
}

/* ===== BACKGROUNDS (light/dark) ===== */
.bg-white { background-color: var(--bg-card) !important; }
.bg-light  { background-color: var(--bg-alt) !important; }

[data-theme="dark"] .text-dark       { color: var(--text) !important; }
[data-theme="dark"] .text-muted      { color: var(--text-muted) !important; }
[data-theme="dark"] .text-primary    { color: #93c5fd !important; }
[data-theme="dark"] .border          { border-color: var(--border) !important; }
[data-theme="dark"] .bg-white        { background-color: var(--bg-card) !important; }
[data-theme="dark"] .bg-light        { background-color: rgba(255,255,255,0.04) !important; }

/* ===== UTILITIES ===== */
.rounded-4  { border-radius: 1rem !important; }
.gap-2      { gap: 0.5rem !important; }
.gap-3      { gap: 0.75rem !important; }

.overflow-hidden { overflow: hidden; }

/* ===== MOBILE BOTTOM NAVIGATION ===== */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1040;
    background: var(--bg-sidebar);
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: stretch;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.35);
    height: 62px;
    padding: 0;
}

.mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: rgba(255,255,255,0.50);
    font-size: 0.62rem;
    font-weight: 600;
    text-decoration: none;
    padding: 6px 2px;
    transition: color .2s, background .2s;
    position: relative;
    overflow: hidden;
}

.mobile-nav-item i {
    font-size: 1.15rem;
    line-height: 1;
    transition: transform .2s;
}

.mobile-nav-item span {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 52px;
    text-align: center;
}

.mobile-nav-item:hover {
    color: rgba(255,255,255,0.85);
    background: rgba(255,255,255,0.06);
}

.mobile-nav-item.active {
    color: var(--accent);
}

.mobile-nav-item.active i { transform: translateY(-2px); }

.mobile-nav-item.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 2px;
    background: var(--accent);
    border-radius: 0 0 4px 4px;
}

/* padding bawah body supaya konten tidak tertutup bottom nav */
@media (max-width: 767.98px) {
    body:has(.mobile-bottom-nav) {
        padding-bottom: 72px;
    }
}

[data-theme="dark"] .mobile-bottom-nav {
    background: #060d1a;
    border-top-color: rgba(255,255,255,0.06);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 991.98px) {
    .sidebar {
        position: static;
        margin-bottom: 1.5rem;
    }

    .hero-section    { min-height: 100svh; }
    .hero-section .container { padding-block: 5rem 4rem; }
    .hero-title      { font-size: 1.9rem; }
    .hero-subtitle   { font-size: 0.93rem; }
    .search-box      { max-width: 100%; }
}

@media (max-width: 575.98px) {
    .dash-card               { flex-direction: column; text-align: center; padding: 1.25rem; }
    .dash-card::before       { width: 100%; height: 3px; bottom: auto; right: auto; border-radius: 4px 4px 0 0; }
    .icon-box                { margin: 0 auto; }
    .login-card              { padding: 2rem 1.35rem; }
    .stats-number            { font-size: 1.65rem; }
    .hero-title              { font-size: 1.65rem; }
    .section-title           { font-size: 1.35rem; }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(22px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.94); }
    to   { opacity: 1; transform: scale(1); }
}

.stats-card  { animation: fadeInUp .5s ease both; }
.alumni-card { animation: fadeInUp .5s ease both; }
.dash-card   { animation: fadeInUp .45s ease both; }
.card        { animation: scaleIn  .4s ease both; }

/* Staggered delays */
.row > :nth-child(1) { animation-delay: .05s; }
.row > :nth-child(2) { animation-delay: .10s; }
.row > :nth-child(3) { animation-delay: .15s; }
.row > :nth-child(4) { animation-delay: .20s; }
.row > :nth-child(5) { animation-delay: .25s; }
.row > :nth-child(6) { animation-delay: .30s; }
