/* ============================================
   YAKESPEN Portal Peserta — Self-Service Theme
   Mobile-first design, optimized for senior users
   ============================================ */

/* === Base === */
.portal-body {
    background: #f8fafc;
    font-family: 'Inter', sans-serif;
    color: var(--yk-text-dark);
    padding-bottom: 80px; /* space for bottom nav on mobile */
    min-height: 100vh;
}

@media (min-width: 992px) {
    .portal-body {
        padding-bottom: 0;
    }
}

/* === Header === */
.portal-header {
    background: linear-gradient(135deg, var(--yk-primary) 0%, var(--yk-primary-dark) 100%);
    color: #fff;
    padding: 0.85rem 0;
    box-shadow: 0 2px 12px rgba(13, 138, 114, 0.15);
    position: sticky;
    top: 0;
    z-index: 100;
}

.portal-brand-title {
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    line-height: 1;
}

.portal-brand-subtitle {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.7rem;
}

.portal-nav {
    gap: 0.25rem;
}

.portal-nav-link {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.88rem;
    font-weight: 500;
    padding: 0.55rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    transition: var(--yk-transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.portal-nav-link:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.portal-nav-link.active {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
    font-weight: 600;
}

.portal-icon-btn {
    color: rgba(255, 255, 255, 0.9);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: var(--yk-transition);
}

.portal-icon-btn:hover {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}

.portal-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #ef4444;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.1em 0.4em;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    border: 2px solid var(--yk-primary);
}

.portal-avatar-btn {
    background: transparent;
    border: none;
    color: #fff;
    padding: 0.25rem 0.5rem;
    display: inline-flex;
    align-items: center;
    border-radius: 24px;
    transition: var(--yk-transition);
}

.portal-avatar-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.portal-avatar-btn::after {
    margin-left: 0.4rem;
}

.portal-avatar-circle {
    width: 34px;
    height: 34px;
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

/* === Main === */
.portal-main {
    padding: 1.5rem 0 2rem;
}

@media (max-width: 575.98px) {
    .portal-main {
        padding: 1rem 0 1.5rem;
    }
}

/* === Hero Card === */
.portal-hero {
    background: linear-gradient(135deg, var(--yk-primary) 0%, #0ea5e9 100%);
    color: #fff;
    border-radius: 16px;
    padding: 1.75rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(13, 138, 114, 0.2);
}

.portal-hero::before {
    content: '';
    position: absolute;
    top: -80px;
    right: -80px;
    width: 280px;
    height: 280px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 50%;
}

.portal-hero::after {
    content: '';
    position: absolute;
    bottom: -60px;
    left: -40px;
    width: 180px;
    height: 180px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 50%;
}

.portal-hero-content {
    position: relative;
    z-index: 1;
}

.portal-hero h4 {
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 1.4rem;
}

.portal-hero .hero-meta {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9rem;
    margin-bottom: 0;
}

.portal-hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
}

@media (max-width: 575.98px) {
    .portal-hero-stats {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
}

.portal-hero-stat {
    color: #fff;
}

.portal-hero-stat-label {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.portal-hero-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.1;
}

.portal-hero-stat-meta {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.75);
    margin-top: 0.25rem;
}

/* === Quick Actions === */
.portal-quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-top: 1rem;
}

@media (max-width: 575.98px) {
    .portal-quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }
}

.portal-quick-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem 1rem;
    text-align: center;
    text-decoration: none;
    color: var(--yk-text-dark);
    transition: var(--yk-transition);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border: 1px solid #f1f5f9;
    display: block;
}

.portal-quick-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(13, 138, 114, 0.12);
    color: var(--yk-text-dark);
    text-decoration: none;
    border-color: var(--yk-primary-light);
}

.portal-quick-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    margin: 0 auto 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.portal-quick-icon.icon-claim { background: var(--yk-primary-light); color: var(--yk-primary); }
.portal-quick-icon.icon-card { background: var(--yk-accent-light); color: var(--yk-accent-dark); }
.portal-quick-icon.icon-family { background: #eef2ff; color: #6366f1; }
.portal-quick-icon.icon-help { background: #fef3c7; color: #b45309; }

.portal-quick-card-title {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--yk-text-dark);
}

.portal-quick-card-sub {
    font-size: 0.72rem;
    color: var(--yk-text-muted);
    margin-top: 0.15rem;
}

/* === Section Title === */
.portal-section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1.75rem 0 0.85rem;
    padding: 0 0.25rem;
}

.portal-section-title h6 {
    font-weight: 700;
    margin: 0;
    font-size: 1rem;
    color: var(--yk-text-dark);
}

.portal-section-title a {
    font-size: 0.85rem;
    color: var(--yk-primary);
    font-weight: 500;
    text-decoration: none;
}

.portal-section-title a:hover {
    text-decoration: underline;
}

/* === Limit Cards (per coverage) === */
.portal-limit-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.1rem 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border: 1px solid #f1f5f9;
    margin-bottom: 0.85rem;
    transition: var(--yk-transition);
}

.portal-limit-card:hover {
    box-shadow: 0 6px 16px rgba(0,0,0,0.06);
}

.portal-limit-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.85rem;
    gap: 0.75rem;
}

.portal-limit-code {
    background: var(--yk-primary-light);
    color: var(--yk-primary-dark);
    font-weight: 700;
    font-size: 0.75rem;
    padding: 0.35em 0.7em;
    border-radius: 6px;
    display: inline-block;
}

.portal-limit-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--yk-text-dark);
    margin-top: 0.4rem;
}

.portal-limit-amounts {
    text-align: right;
}

.portal-limit-remaining {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--yk-primary-dark);
    line-height: 1.1;
}

.portal-limit-remaining-label {
    font-size: 0.7rem;
    color: var(--yk-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-top: 2px;
}

.portal-limit-progress {
    height: 10px;
    background: #f1f5f9;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.portal-limit-bar {
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease;
}

.portal-limit-bar.bar-safe { background: linear-gradient(90deg, #10b981, #34d399); }
.portal-limit-bar.bar-warn { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.portal-limit-bar.bar-danger { background: linear-gradient(90deg, #ef4444, #f87171); }

.portal-limit-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 0.6rem;
    font-size: 0.78rem;
    color: var(--yk-text-muted);
}

.portal-limit-footer strong {
    color: var(--yk-text-dark);
}

/* === Recent Claims === */
.portal-claim-card {
    background: #fff;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border: 1px solid #f1f5f9;
    margin-bottom: 0.75rem;
    transition: var(--yk-transition);
}

.portal-claim-card:hover {
    box-shadow: 0 6px 16px rgba(0,0,0,0.06);
    transform: translateX(2px);
}

.portal-claim-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.portal-claim-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--yk-primary-light);
    color: var(--yk-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.portal-claim-info {
    flex: 1;
    min-width: 0;
}

.portal-claim-provider {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--yk-text-dark);
    margin-bottom: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.portal-claim-diag {
    font-size: 0.78rem;
    color: var(--yk-text-muted);
}

.portal-claim-date {
    font-size: 0.72rem;
    color: var(--yk-text-muted);
    margin-top: 0.15rem;
}

.portal-claim-amount {
    text-align: right;
    flex-shrink: 0;
}

.portal-claim-amount-value {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--yk-text-dark);
}

.portal-claim-status {
    margin-top: 0.25rem;
}

/* === Notification Cards === */
.portal-notif {
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    transition: var(--yk-transition);
}

.portal-notif.notif-warn {
    background: linear-gradient(135deg, #fefce8 0%, #fef9c3 100%);
    border: 1px solid #fde68a;
}

.portal-notif.notif-info {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #bfdbfe;
}

.portal-notif.notif-success {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 1px solid #bbf7d0;
}

.portal-notif-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.portal-notif.notif-warn .portal-notif-icon { background: #fde68a; color: #92400e; }
.portal-notif.notif-info .portal-notif-icon { background: #bfdbfe; color: #1e40af; }
.portal-notif.notif-success .portal-notif-icon { background: #bbf7d0; color: #065f46; }

.portal-notif-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
}

.portal-notif-text {
    font-size: 0.82rem;
    color: var(--yk-text-muted);
    margin-bottom: 0.4rem;
}

/* === Mobile Bottom Nav === */
.portal-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.04);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0.5rem 0;
    z-index: 100;
}

.portal-bottom-link {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--yk-text-muted);
    padding: 0.4rem 0;
    font-size: 0.7rem;
    font-weight: 500;
    transition: var(--yk-transition);
}

.portal-bottom-link i {
    font-size: 1.15rem;
    margin-bottom: 3px;
}

.portal-bottom-link.active {
    color: var(--yk-primary);
}

.portal-bottom-link.active i {
    transform: scale(1.1);
}

.portal-bottom-link:hover {
    color: var(--yk-primary-dark);
}

/* === Footer === */
.portal-footer {
    background: #fff;
    border-top: 1px solid #e2e8f0;
    margin-top: 2rem;
}

.portal-footer a {
    text-decoration: none;
}

.portal-footer a:hover {
    color: var(--yk-primary);
}


/* === Portal user dropdown ============================
   Pastikan menu profile mengambang di atas konten apapun
   (hero card, quick actions, tombol primary di body)
   ==================================================== */
.portal-header .dropdown-menu {
    z-index: 1080;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.15), 0 2px 6px rgba(15, 23, 42, 0.06);
    padding: 0.4rem;
    min-width: 240px;
    margin-top: 0.5rem !important;
    overflow: hidden;
}

.portal-header .dropdown-menu .dropdown-item {
    border-radius: 10px;
    padding: 0.6rem 0.75rem;
    font-size: 0.92rem;
    color: var(--yk-text-dark);
    transition: var(--yk-transition);
    display: flex;
    align-items: center;
}

.portal-header .dropdown-menu .dropdown-item i {
    width: 22px;
    text-align: center;
    color: var(--yk-text-muted);
}

.portal-header .dropdown-menu .dropdown-item:hover,
.portal-header .dropdown-menu .dropdown-item:focus {
    background: var(--yk-primary-light);
    color: var(--yk-primary-dark);
}

.portal-header .dropdown-menu .dropdown-item:hover i {
    color: var(--yk-primary);
}

.portal-header .dropdown-menu .dropdown-item.text-danger:hover,
.portal-header .dropdown-menu .dropdown-item.text-danger:focus {
    background: #fef2f2;
    color: #dc2626 !important;
}

.portal-header .dropdown-menu .dropdown-item.text-danger i {
    color: #ef4444;
}

.portal-header .dropdown-menu .dropdown-divider {
    margin: 0.35rem 0.25rem;
    border-color: #eef2f7;
}

/* Header info user di dalam dropdown portal */
.portal-header .dropdown-user-header {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.7rem 0.75rem 0.85rem;
    border-bottom: 1px solid #eef2f7;
    margin-bottom: 0.35rem;
}

.portal-header .dropdown-user-header .user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--yk-primary), var(--yk-primary-dark));
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.portal-header .dropdown-user-header .user-meta {
    min-width: 0;
    line-height: 1.25;
}

.portal-header .dropdown-user-header .user-name {
    font-weight: 600;
    color: var(--yk-text-dark);
    font-size: 0.92rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.portal-header .dropdown-user-header .user-sub {
    color: var(--yk-text-muted);
    font-size: 0.78rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Trigger avatar topbar portal: padding kecil + radius pill */
.portal-avatar-btn {
    background: rgba(255, 255, 255, 0.12);
    border: 0;
    color: #fff;
    padding: 0.25rem 0.65rem 0.25rem 0.25rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    transition: var(--yk-transition);
}

.portal-avatar-btn:hover,
.portal-avatar-btn:focus {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}

.portal-avatar-btn::after {
    color: rgba(255, 255, 255, 0.8);
}

.portal-avatar-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    color: var(--yk-primary-dark);
    font-weight: 700;
    font-size: 0.78rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}


/* === Portal notification dropdown ============================
   Sama-sama z-index 1080 agar tidak ketutup hero/limit card
   ============================================================ */
.portal-header .notif-menu {
    width: 360px;
    max-width: calc(100vw - 1rem);
    padding: 0 !important;
    overflow: hidden;
    z-index: 1080;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.15), 0 2px 6px rgba(15, 23, 42, 0.06);
    margin-top: 0.5rem !important;
}

.portal-header .notif-menu .notif-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid #eef2f7;
}

.portal-header .notif-menu .notif-header-title {
    font-weight: 600;
    color: var(--yk-text-dark);
    font-size: 0.95rem;
}

.portal-header .notif-menu .notif-header-action {
    color: var(--yk-primary);
    font-size: 0.8rem;
    font-weight: 500;
    background: transparent;
    border: 0;
    padding: 0;
}

.portal-header .notif-menu .notif-list {
    max-height: 380px;
    overflow-y: auto;
}

.portal-header .notif-menu .notif-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    text-decoration: none;
    color: var(--yk-text-dark);
    transition: background 0.15s ease;
    position: relative;
}

.portal-header .notif-menu .notif-item:last-child {
    border-bottom: 0;
}

.portal-header .notif-menu .notif-item:hover {
    background: #f8fafc;
}

.portal-header .notif-menu .notif-item.unread {
    background: rgba(13, 138, 114, 0.04);
}

.portal-header .notif-menu .notif-item.unread::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 4px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--yk-primary);
    transform: translateY(-50%);
}

.portal-header .notif-menu .notif-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.95rem;
}
.portal-header .notif-icon.cat-payment { background: var(--yk-primary-light); color: var(--yk-primary-dark); }
.portal-header .notif-icon.cat-claim   { background: #dbeafe; color: #1d4ed8; }
.portal-header .notif-icon.cat-info    { background: #fef3c7; color: #92400e; }
.portal-header .notif-icon.cat-system  { background: #e2e8f0; color: #475569; }

.portal-header .notif-menu .notif-body { min-width: 0; flex: 1; }
.portal-header .notif-menu .notif-title {
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--yk-text-dark);
    line-height: 1.3;
    margin-bottom: 2px;
}
.portal-header .notif-menu .notif-snippet {
    font-size: 0.8rem;
    color: var(--yk-text-muted);
    line-height: 1.35;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.portal-header .notif-menu .notif-time {
    font-size: 0.72rem;
    color: var(--yk-text-muted);
    margin-top: 4px;
}

.portal-header .notif-menu .notif-footer {
    border-top: 1px solid #eef2f7;
    text-align: center;
    padding: 0.6rem;
}
.portal-header .notif-menu .notif-footer a {
    color: var(--yk-primary);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
}
.portal-header .notif-menu .notif-footer a:hover {
    color: var(--yk-primary-dark);
    text-decoration: underline;
}
