/* Custom CSS for XL Axiata Manager */

:root {
    --primary-color: #0066cc;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;

    /* Soft light palette (anti-glare) */
    --bg-main: #f3f5f9;
    --bg-surface: #E5E4E2;
    --bg-surface-soft: #ECEAE7;
    --bg-elevated: #E5E4E2;
    --border-dark: #dbe3ee;
    --text-main: #1f2937;
    --text-muted-dark: #6b7280;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Global dark outer background for all pages */
body.app-dark-bg {
    background-color: #0f172a;
}

body.app-dark-bg main,
body.app-dark-bg .container {
    color: #e5e7eb;
}

/* Keep cards readable (platinum card, dark text) */
body.app-dark-bg .card,
body.app-dark-bg .quota-package-card {
    background: linear-gradient(135deg, #ECEAE7 0%, #E5E4E2 50%, #D8D6D2 100%);
    color: #111827;
    border: 1px solid #C8C6C2;
}

body.app-dark-bg .card.myrewards-platinum-card {
    background: linear-gradient(135deg, #c8c5ce 0%, #aba7b3 34%, #8f8a97 66%, #6f6a77 100%) !important;
    border: 1px solid #7f7a86 !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.52), 0 10px 24px rgba(15, 23, 42, 0.14);
    position: relative;
    overflow: hidden;
}

body.app-dark-bg .card.myrewards-platinum-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(120deg, rgba(255, 255, 255, 0.24) 0%, rgba(255, 255, 255, 0.08) 22%, rgba(255, 255, 255, 0) 44%),
        radial-gradient(circle at 78% 18%, rgba(120, 110, 145, 0.22) 0%, rgba(120, 110, 145, 0) 42%);
    pointer-events: none;
}

body.app-dark-bg .card.myrewards-platinum-card .card-title,
body.app-dark-bg .card.myrewards-platinum-card .text-muted,
body.app-dark-bg .card.myrewards-platinum-card .table,
body.app-dark-bg .card.myrewards-platinum-card strong {
    color: #1f2937 !important;
}

body.app-dark-bg .card.myrewards-platinum-card .badge.bg-warning {
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
}

body.app-dark-bg .card.myrewards-platinum-card .myrewards-accent {
    color: #4b0f6f !important;
}

body.app-dark-bg .card.myrewards-platinum-card .myrewards-accent-badge {
    background: linear-gradient(135deg, #4b0f6f 0%, #2f0f4c 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 6px 14px rgba(47, 15, 76, 0.28);
}

body.app-dark-bg .card.myrewards-platinum-card .myrewards-accent-badge i {
    color: #ffffff !important;
}

body.app-dark-bg .card.myrewards-platinum-card .myrewards-accent-bar {
    background: linear-gradient(90deg, #ef4444 0%, #dc2626 45%, #991b1b 100%) !important;
}

body.app-dark-bg .card.myrewards-platinum-card .card-body {
    position: relative;
    z-index: 1;
}

body.app-dark-bg .card.profile-silver-card {
    background: linear-gradient(135deg, #c8c5ce 0%, #aba7b3 34%, #8f8a97 66%, #6f6a77 100%) !important;
    border: 1px solid #7f7a86 !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.52), 0 10px 24px rgba(15, 23, 42, 0.14);
    position: relative;
    overflow: hidden;
}

body.app-dark-bg .card.profile-silver-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(120deg, rgba(255, 255, 255, 0.24) 0%, rgba(255, 255, 255, 0.08) 22%, rgba(255, 255, 255, 0) 44%),
        radial-gradient(circle at 78% 18%, rgba(120, 110, 145, 0.22) 0%, rgba(120, 110, 145, 0) 42%);
    pointer-events: none;
}

body.app-dark-bg .card.profile-silver-card .card-body {
    position: relative;
    z-index: 1;
}

body.app-dark-bg .card.profile-silver-card .card-title,
body.app-dark-bg .card.profile-silver-card .text-muted,
body.app-dark-bg .card.profile-silver-card .table,
body.app-dark-bg .card.profile-silver-card strong {
    color: #111827 !important;
}

body.app-dark-bg .card h1,
body.app-dark-bg .card h2,
body.app-dark-bg .card h3,
body.app-dark-bg .card h4,
body.app-dark-bg .card h5,
body.app-dark-bg .card h6,
body.app-dark-bg .card .lead,
body.app-dark-bg .card .form-label,
body.app-dark-bg .card .text-muted {
    color: #1f2937 !important;
}

body.app-dark-bg .footer-dark {
    background-color: #0b1220;
    border-top: 1px solid #223047;
}

body.app-dark-bg .footer-dark p,
body.app-dark-bg .footer-dark .text-muted {
    color: #94a3b8 !important;
}

/* Quota page: dark outer background, white package cards */
body.quota-page-dark {
    background-color: #0f172a;
}

body.quota-page-dark main,
body.quota-page-dark .container {
    color: #e5e7eb;
}

body.quota-page-dark h1,
body.quota-page-dark h2,
body.quota-page-dark h3,
body.quota-page-dark h4,
body.quota-page-dark h5,
body.quota-page-dark h6,
body.quota-page-dark .lead,
body.quota-page-dark .form-label,
body.quota-page-dark .text-muted {
    color: #cbd5e1 !important;
}

body.quota-page-dark .quota-package-card {
    background: linear-gradient(135deg, #ECEAE7 0%, #E5E4E2 50%, #D8D6D2 100%) !important;
    color: #111827 !important;
    border: 1px solid #C8C6C2;
}

body.quota-page-dark .quota-package-title,
body.quota-page-dark .quota-benefit-title {
    color: #111827 !important;
}

body.quota-page-dark .quota-benefit-foot,
body.quota-page-dark .quota-package-divider,
body.quota-page-dark .quota-benefit-row {
    color: #64748b !important;
}

body.quota-page-dark .quota-benefit-row {
    border-bottom-color: rgba(148, 163, 184, 0.35);
}

body.quota-page-dark .quota-progress {
    background-color: rgba(148, 163, 184, 0.35);
}

a {
    color: #2563eb;
}

a:hover {
    color: #1d4ed8;
}

h1, h2, h3, h4, h5, h6,
.lead,
.form-label {
    color: var(--text-main);
}

/* Keep headings readable on global dark outer background */
body.app-dark-bg h1,
body.app-dark-bg h2,
body.app-dark-bg h3,
body.app-dark-bg h4,
body.app-dark-bg h5,
body.app-dark-bg h6,
body.app-dark-bg .lead,
body.app-dark-bg .form-label {
    color: #e5e7eb;
}

hr,
.border,
.card,
.table,
.table-responsive {
    border-color: var(--border-dark) !important;
}

main {
    flex: 1;
}

/* Navbar */
.navbar-brand {
    font-weight: 600;
    font-size: 1.25rem;
}

.navbar {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.app-nav-dark {
    background: linear-gradient(90deg, #0b1630 0%, #10203f 100%);
}

.navbar .nav-link.profile-toggle {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    color: #ffffff !important;
    border-radius: 10px;
    padding: 0.4rem 0.9rem !important;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.35);
    transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.navbar .nav-link.profile-toggle:hover,
.navbar .nav-link.profile-toggle:focus {
    background: linear-gradient(135deg, #708098 0%, #526077 100%);
    color: #ffffff !important;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.45);
    transform: translateY(-1px);
}

.app-menu-dropdown {
    background-color: #0f1d35;
    border: 1px solid rgba(148, 163, 184, 0.25);
    min-width: 240px;
    border-radius: 14px;
    padding: 0.5rem;
    margin-top: 0.5rem;
    box-shadow: 0 18px 40px rgba(2, 6, 23, 0.55);
    overflow: hidden;
}

.app-menu-dropdown .dropdown-item,
.app-menu-dropdown .dropdown-item-text {
    color: #e5e7eb;
    border-radius: 10px;
    padding: 0.55rem 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-weight: 500;
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.app-menu-dropdown .dropdown-item i {
    font-size: 1.05rem;
    color: #60a5fa;
    width: 1.4rem;
    text-align: center;
    transition: color 0.15s ease;
}

.app-menu-dropdown .dropdown-item-text {
    color: #94a3b8;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.app-menu-dropdown .dropdown-item-text i {
    color: #64748b;
}

.app-menu-dropdown .dropdown-item:hover,
.app-menu-dropdown .dropdown-item:focus {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.35) 0%, rgba(37, 99, 235, 0.18) 100%);
    color: #ffffff;
    transform: translateX(2px);
}

.app-menu-dropdown .dropdown-item:hover i,
.app-menu-dropdown .dropdown-item:focus i {
    color: #ffffff;
}

.app-menu-dropdown .dropdown-item.text-danger {
    color: #f87171;
}

.app-menu-dropdown .dropdown-item.text-danger i {
    color: #f87171;
}

.app-menu-dropdown .dropdown-item.text-danger:hover,
.app-menu-dropdown .dropdown-item.text-danger:focus {
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.32) 0%, rgba(239, 68, 68, 0.15) 100%);
    color: #ffffff;
}

.app-menu-dropdown .dropdown-item.text-danger:hover i,
.app-menu-dropdown .dropdown-item.text-danger:focus i {
    color: #ffffff;
}

.app-menu-dropdown .dropdown-divider {
    border-top-color: rgba(148, 163, 184, 0.2);
    margin: 0.4rem 0.3rem;
}

.nav-pulsa-chip {
    background: rgba(148, 163, 184, 0.22);
    border: 1px solid rgba(148, 163, 184, 0.35);
    color: #e5e7eb;
    border-radius: 999px;
    padding: 0.28rem 0.7rem;
    font-size: 0.92rem;
    white-space: nowrap;
}

.nav-pulsa-chip .label {
    opacity: 0.92;
}

.nav-pulsa-chip .value {
    color: #facc15;
    font-weight: 700;
}

.navbar .nav-link {
    color: #e7efff !important;
}

.navbar .nav-link:hover,
.navbar .nav-link:focus {
    color: #ffffff !important;
}

/* Cards */
.card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-dark);
    color: var(--text-main);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card-header {
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

.card .text-muted,
.text-muted {
    color: var(--text-muted-dark) !important;
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-lg {
    padding: 12px 24px;
}

/* Forms */
.form-control, .form-select {
    background-color: var(--bg-surface-soft);
    color: var(--text-main);
    border-radius: 8px;
    border: 2px solid var(--border-dark);
    transition: all 0.3s ease;
}

.form-control::placeholder {
    color: var(--text-muted-dark);
}

.form-control:disabled,
.form-select:disabled {
    background-color: #eef2f7;
    color: #94a3b8;
}

.form-control:focus, .form-select:focus {
    background-color: var(--bg-surface-soft);
    color: var(--text-main);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.25);
}

/* Alerts */
.alert {
    border-radius: 8px;
    border: none;
}

.alert-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.alert-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.alert-success {
    background-color: #dcfce7;
    color: #166534;
}

.alert-info {
    background-color: #e0f2fe;
    color: #0c4a6e;
}

/* Badges */
.badge {
    padding: 6px 12px;
    font-weight: 500;
    border-radius: 6px;
}

/* List Group */
.list-group-item {
    background-color: var(--bg-surface);
    color: var(--text-main);
    border-radius: 8px;
    margin-bottom: 8px;
    border: 2px solid var(--border-dark);
    transition: all 0.3s ease;
}

.list-group-item:hover {
    background-color: var(--bg-surface-soft);
    border-color: var(--primary-color);
    transform: translateX(5px);
}

/* Table */
.table {
    color: var(--text-main);
    border-radius: 8px;
    overflow: hidden;
}

.table thead th {
    background-color: var(--bg-surface-soft);
    color: var(--text-main);
    border-bottom: 2px solid var(--primary-color);
    font-weight: 600;
}

.table tbody td,
.table tbody th {
    background-color: var(--bg-surface);
    color: var(--text-main);
    border-color: #273449;
}

.table-hover > tbody > tr:hover > * {
    background-color: rgba(148, 163, 184, 0.08) !important;
    color: var(--text-main);
}

/* Footer */
footer {
    margin-top: auto;
}

.footer-dark {
    background-color: #eef2f7;
    border-top: 1px solid var(--border-dark);
}

.footer-dark p,
.footer-dark .text-muted {
    color: #64748b !important;
}

.btn-close {
    filter: none;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card, .alert {
    animation: fadeIn 0.5s ease;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1rem;
    }
    
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
}

/* QR Code Container */
.qr-code-container {
    background: linear-gradient(135deg, #ECEAE7 0%, #E5E4E2 50%, #D8D6D2 100%);
    padding: 20px;
    border-radius: 10px;
    display: inline-block;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Loading Spinner */
.spinner-border-custom {
    width: 3rem;
    height: 3rem;
}

/* Hover effects for action cards */
.hover-card {
    cursor: pointer;
    transition: all 0.3s ease;
}

.hover-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

/* Status badges */
.badge-status {
    font-size: 0.9rem;
    padding: 8px 16px;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #eef2f7;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #0052a3;
}

/* Quota visual cards */
.quota-mobile-shell {
    max-width: 760px;
}

@media (max-width: 992px) {
    .quota-mobile-shell {
        max-width: 620px;
    }
}

@media (max-width: 768px) {
    .quota-mobile-shell {
        max-width: 520px;
    }
}

@media (max-width: 576px) {
    .quota-mobile-shell {
        max-width: 420px;
    }
}

.quota-package-card {
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.22);
}

.quota-package-body {
    padding: 0.72rem 0.9rem;
}

.quota-package-top {
    margin-bottom: 0.2rem;
}

.quota-package-icon {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #60a5fa;
    background: rgba(96, 165, 250, 0.15);
}

.quota-package-title {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.1px;
}

.quota-package-divider {
    border-color: rgba(148, 163, 184, 0.25);
    margin: 0.3rem 0 0.12rem;
}

.quota-active-period {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.9rem;
    padding: 0.6rem 0.8rem;
    border-radius: 10px;
    background: rgba(34, 197, 94, 0.18);
    border: 1px solid rgba(34, 197, 94, 0.5);
    font-size: 0.9rem;
    color: #22c55e;
}

.quota-active-period i {
    color: #22c55e;
    font-size: 1rem;
}

.quota-active-label {
    color: #16a34a;
    font-weight: 600;
}

.quota-active-date {
    font-weight: 800;
    color: #15803d;
}

.quota-active-remaining {
    font-weight: 700;
    color: #16a34a;
}

.quota-active-period-expired {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.3);
    color: #b91c1c;
}

.quota-active-period-expired i {
    color: #ef4444;
}

.quota-active-period-expired .quota-active-label,
.quota-active-period-expired .quota-active-date,
.quota-active-period-expired .quota-active-remaining {
    color: #dc2626;
}

body.quota-page-dark .quota-active-period {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    border: 1px solid #22c55e;
    color: #ffffff;
    box-shadow: 0 0 16px rgba(34, 197, 94, 0.55);
}

body.quota-page-dark .quota-active-period i {
    color: #ffffff;
}

body.quota-page-dark .quota-active-label {
    color: #eafff3;
    font-weight: 600;
}

body.quota-page-dark .quota-active-date {
    color: #ffffff;
    font-weight: 800;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

body.quota-page-dark .quota-active-remaining {
    color: #d1fae5;
    font-weight: 700;
}

body.quota-page-dark .quota-active-remaining-num {
    color: #ff5252;
    font-weight: 800;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

body.quota-page-dark .quota-active-period-expired {
    background: rgba(239, 68, 68, 0.16);
    border-color: rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}

body.quota-page-dark .quota-active-period-expired .quota-active-label,
body.quota-page-dark .quota-active-period-expired .quota-active-date,
body.quota-page-dark .quota-active-period-expired .quota-active-remaining {
    color: #fca5a5;
}

.quota-benefits-list {
    display: block;
}

.quota-benefit-row {
    padding: 0.58rem 0.1rem 0.58rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.quota-benefit-row:first-child {
    padding-top: 0.12rem;
}

.quota-benefit-row:last-child {
    border-bottom: none;
    padding-bottom: 0.12rem;
}

.quota-benefit-title {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0;
}

.quota-benefit-remaining {
    font-size: 0.94rem;
    font-weight: 800;
    color: #1d4ed8;
    line-height: 1;
}

.quota-benefit-remaining-low {
    color: #e11d48 !important;
}

.quota-progress {
    height: 9px;
    border-radius: 999px;
    background-color: rgba(148, 163, 184, 0.25);
    overflow: hidden;
}

.quota-progress .progress-bar {
    border-radius: 999px;
    transition: width 0.4s ease;
}

.quota-progress-active {
    background: linear-gradient(90deg, #10b981 0%, #14b8a6 100%);
}

.quota-progress-low {
    background: linear-gradient(90deg, #10b981 0%, #14b8a6 100%);
}

.quota-progress-empty {
    background: #9ca3af;
}

.quota-benefit-foot {
    font-size: 0.8rem;
    line-height: 1.05;
}

.quota-benefit-total {
    font-weight: 600;
    color: #334155;
}

body.quota-page-dark .quota-benefit-total {
    color: #475569;
}

.quota-page-title {
    color: #facc15;
    font-weight: 700;
}

.quota-header-shell {
    background: rgba(148, 163, 184, 0.22);
    border: 1px solid rgba(148, 163, 184, 0.38);
    border-radius: 10px;
    padding: 0.45rem 0.7rem;
}

.quota-header-shell .quota-page-title {
    margin-right: 0.75rem;
}

.quota-signal-icon {
    display: inline-flex;
    align-items: flex-end;
    gap: 4px;
    width: 28px;
    height: 28px;
}

.quota-signal-icon .bar {
    width: 5px;
    border-radius: 2px;
    display: inline-block;
}

.quota-signal-icon .bar-sm {
    height: 10px;
    background: #facc15; /* yellow */
}

.quota-signal-icon .bar-md {
    height: 16px;
    background: #fb923c; /* orange */
}

.quota-signal-icon .bar-lg {
    height: 22px;
    background: #22c55e; /* green */
}

.quota-back-btn {
    background-color: #dc2626;
    border: 1px solid #dc2626;
    color: #ffffff;
}

.quota-back-btn:hover,
.quota-back-btn:focus {
    background-color: #b91c1c;
    border-color: #b91c1c;
    color: #ffffff;
}

/* Generic utility overrides for dark pages */
.bg-light {
    background-color: var(--bg-surface-soft) !important;
    color: var(--text-main) !important;
}

code {
    color: #be185d;
}

/* Payment result API response panel (readable on dark outer pages) */
.response-api-panel {
    background-color: #0f172a;
    border: 1px solid #1e293b;
    color: #e2e8f0;
}

.response-api-pre {
    color: #e2e8f0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    max-height: 320px;
    overflow: auto;
}

body.app-dark-bg .response-api-panel {
    background-color: #0f172a;
    border-color: #1e293b;
    color: #e2e8f0;
}

body.app-dark-bg .response-api-pre {
    color: #e2e8f0;
}

.wa-float {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1050;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: #25d366;
    color: #ffffff;
    font-size: 1.6rem;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.wa-float:hover,
.wa-float:focus {
    background-color: #1ebe5d;
    color: #ffffff;
    transform: scale(1.08);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.32);
}

@media (max-width: 576px) {
    .wa-float {
        right: 16px;
        bottom: 16px;
        width: 50px;
        height: 50px;
        font-size: 1.45rem;
    }
}
