/* ────────────────────────────────────────────────────────────
   SIMPKL custom layer — loaded ON TOP of Mazer (public/mazer/css)
   Bootstrap + theme styles now come from Mazer, this file only
   holds app-specific helpers, loading state, compat + landing.
   ──────────────────────────────────────────────────────────── */

/* ─── Page header (compat for remaining views using page-header) ─── */
.page-header {
    margin-bottom: 1.25rem;
}
.page-header h2 {
    font-weight: 700;
    font-size: 1.4rem;
    margin-bottom: 0.1rem;
    color: var(--bs-body-color);
}
.page-subtitle {
    font-size: 0.85rem;
    color: var(--bs-secondary-color);
}

/* ─── Avatar circle (about page + fallbacks) ─── */
.avatar-circle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--bs-primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
    flex-shrink: 0;
}

/* ─── Top navbar user avatar (Mazer header) ─── */
.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #435ebe, #7847b6);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* ─── Mazer top navbar tweaks ─── */
.top-navbar {
    padding: 0.5rem 0.75rem;
    margin: 0.5rem 1.25rem 0.75rem;
    border-radius: 1rem;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}
.top-navbar .burger-btn {
    color: var(--bs-body-color);
}

/* ─── Mazer-style welcome banner (dashboards) ─── */
.mazer-welcome {
    background: linear-gradient(135deg, #435ebe 0%, #6253c4 55%, #7847b6 100%);
    border-radius: 1rem;
    padding: 1.5rem 1.75rem;
    color: #fff;
}
.mazer-welcome h4 {
    color: #fff;
    font-weight: 700;
}
.mazer-welcome .stats-icon {
    background: rgba(255, 255, 255, 0.18);
}

/* ─── Brand accent buttons (kept for existing views) ─── */
.btn-gold {
    background: #d4a027;
    border-color: #d4a027;
    color: #fff;
}
.btn-gold:hover {
    background: #b98a1e;
    border-color: #b98a1e;
    color: #fff;
}
.btn-outline-gold {
    border-color: #d4a027;
    color: #b98a1e;
}
.btn-outline-gold:hover {
    background: #d4a027;
    border-color: #d4a027;
    color: #fff;
}

/* ─── Scroll to Top ─── */
#scrollTopBtn {
    position: fixed;
    right: 30px;
    bottom: 30px;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #435ebe, #7847b6);
    color: #fff;
    font-size: 1.3rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
}
#scrollTopBtn.visible {
    opacity: 1;
    visibility: visible;
}
#scrollTopBtn:hover {
    transform: translateY(-3px);
}

/* ─── Loading overlay ─── */
.page-loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.1s;
}
.page-loading-overlay.show {
    opacity: 1;
    pointer-events: all;
}
.page-loading-overlay .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(67, 94, 190, 0.15);
    border-top-color: #435ebe;
    border-radius: 50%;
    animation: btn-spin 0.7s linear infinite;
}

.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.8;
}
.btn-loading::after {
    content: '';
    display: inline-block;
    width: 1rem;
    height: 1rem;
    margin-left: 0.5rem;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: btn-spin 0.6s linear infinite;
    vertical-align: middle;
}
@keyframes btn-spin {
    to { transform: rotate(360deg); }
}

/* ─────────────────────────────────────────────
   LANDING PAGE
   ───────────────────────────────────────────── */
body.landing-page {
    background: #fff;
    overflow-x: hidden;
}

.landing-navbar {
    background: rgba(12, 18, 38, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 0.7rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.12;
    letter-spacing: -0.03em;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.15);
}
.hero-subtitle {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.72);
    max-width: 520px;
    line-height: 1.8;
    margin: 1.25rem 0 1.75rem;
    font-weight: 400;
}
.btn-hero {
    padding: 0.8rem 2.5rem;
    font-size: 0.95rem;
    border-radius: 50px;
    font-weight: 600;
    background: linear-gradient(135deg, #435ebe, #7847b6);
    border: none;
    color: #fff;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(67, 94, 190, 0.35);
}
.btn-hero:hover {
    background: linear-gradient(135deg, #384f9e, #6a3fa4);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(67, 94, 190, 0.45);
}
.hero-logo-wrap {
    display: inline-block;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 1.5rem;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.hero-logo-wrap img {
    max-height: 160px;
    width: auto;
    filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.2));
}
.hero-icon {
    font-size: 7rem;
    color: rgba(158, 198, 255, 0.35);
}

/* ─── Stats Section ─── */
.stats-section {
    background: #f7fafe;
    padding: 5rem 0;
    position: relative;
}
.stats-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(67, 94, 190, 0.25), transparent);
}
.stats-card {
    background: #fff;
    border: none;
    border-radius: 20px;
    padding: 2.5rem 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
}
.stats-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 2rem;
    right: 2rem;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: linear-gradient(90deg, #435ebe, #7847b6);
    opacity: 0;
    transition: opacity 0.3s;
}
.stats-card:hover::after {
    opacity: 1;
}
.stats-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);
}
.stats-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.bg-primary-grad {
    background: linear-gradient(135deg, #435ebe, #6253c4);
}
.bg-success-grad {
    background: linear-gradient(135deg, #22c55e, #4ade80);
}
.bg-purple-grad {
    background: linear-gradient(135deg, #7847b6, #9b6bd4);
}
.stats-number {
    font-size: 2.2rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
    letter-spacing: -0.02em;
}
.stats-label {
    font-size: 0.85rem;
    color: #94a3b8;
    font-weight: 600;
    margin-top: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ─── Features Section ─── */
.features-section {
    background: #fff;
    padding: 5rem 0;
}
.section-badge {
    display: inline-block;
    background: rgba(67, 94, 190, 0.1);
    color: #435ebe;
    padding: 0.35rem 1.2rem;
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: 1px solid rgba(67, 94, 190, 0.2);
    margin-bottom: 1rem;
}
.section-title {
    font-size: 2rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}
.section-desc {
    font-size: 1rem;
    color: #94a3b8;
    max-width: 500px;
    margin: 0 auto;
}
.feature-card {
    background: #fff;
    border: 1px solid #f1f5f9;
    border-radius: 20px;
    padding: 2rem;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    height: 100%;
    position: relative;
}
.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    border-color: rgba(67, 94, 190, 0.18);
}
.feature-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    font-size: 1.4rem;
    transition: transform 0.3s;
}
.feature-card:hover .feature-icon {
    transform: scale(1.05);
}
.icon-monitoring {
    background: rgba(67, 94, 190, 0.1);
    color: #435ebe;
}
.icon-penilaian {
    background: rgba(120, 71, 182, 0.1);
    color: #7847b6;
}
.feature-card h5 {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: #0f172a;
}
.feature-card p {
    font-size: 0.88rem;
    color: #64748b;
    line-height: 1.7;
    margin-bottom: 0;
}

.landing-footer {
    background: #f7fafe;
    border-top: 1px solid #e8eefb;
}

/* ─── Scroll Animation ─── */
.stats-card, .feature-card {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.stats-card.animate, .feature-card.animate {
    opacity: 1;
    transform: translateY(0);
    transition-delay: calc(var(--i, 0) * 0.1s);
}

/* ─── Dark theme overrides for custom layer ─── */
html[data-bs-theme="dark"] .page-loading-overlay {
    background: rgba(15, 23, 42, 0.72);
}
html[data-bs-theme="dark"] .page-loading-overlay .spinner {
    border-color: rgba(255, 255, 255, 0.15);
    border-top-color: #8ea2ff;
}
html[data-bs-theme="dark"] body.landing-page {
    background: #12182b;
}
html[data-bs-theme="dark"] .hero-wrapper {
    background:
        radial-gradient(620px 420px at 8% 12%, rgba(120, 71, 182, 0.25), transparent 62%),
        radial-gradient(720px 500px at 92% 8%, rgba(67, 94, 190, 0.30), transparent 62%),
        linear-gradient(135deg, #10182e 0%, #1b2a55 55%, #3a2c66 100%);
}
html[data-bs-theme="dark"] .stats-section,
html[data-bs-theme="dark"] .landing-footer {
    background: #12182b;
}
html[data-bs-theme="dark"] .stats-card,
html[data-bs-theme="dark"] .feature-card {
    background: #1d2745;
    border-color: #28345a;
}
html[data-bs-theme="dark"] .stats-number,
html[data-bs-theme="dark"] .section-title,
html[data-bs-theme="dark"] .feature-card h5 {
    color: #f1f5f9;
}

/* ─── Responsive ─── */
@media (max-width: 767.98px) {
    .top-navbar {
        margin: 0.5rem 0.5rem 0.75rem;
    }
    .hero-title {
        font-size: 2rem;
    }
}

/* ─── Reduced Motion ─── */
@media (prefers-reduced-motion: reduce) {
    .stats-card,
    .feature-card {
        transition: none !important;
        animation: none !important;
    }
    .stats-card:hover,
    .feature-card:hover {
        transform: none !important;
    }
}