/* Noti Center Public Pages - Liquid Glass Design */
:root {
    --glass-bg: rgba(255, 255, 255, 0.12);
    --glass-border: rgba(255, 255, 255, 0.25);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --success: #16a34a;
    --error: #dc2626;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0f172a 100%);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    color: var(--text);
    direction: rtl;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.container {
    width: 100%;
    max-width: 420px;
}

.card.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2.5rem 2rem;
    box-shadow: var(--glass-shadow);
    text-align: center;
}

.icon-bell {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.qr-box {
    width: 148px;
    height: 148px;
    margin: 0 auto 1.25rem;
    padding: 8px;
    background: #fff;
    border-radius: 14px;
    box-shadow: var(--glass-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-box svg {
    width: 100%;
    height: 100%;
    display: block;
}

.ios-instructions {
    text-align: right;
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.35);
    border-radius: 12px;
    padding: 1rem 1.1rem;
    margin: 0.5rem 0 1rem;
    font-size: 0.88rem;
    line-height: 1.9;
}

.ios-instructions .ios-title {
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.ios-instructions ol {
    margin: 0;
    padding-inline-start: 1.25rem;
}

.ios-instructions .share-icon {
    display: inline-block;
}

.security-note {
    text-align: right;
    background: rgba(234, 179, 8, 0.12);
    border: 1px solid rgba(234, 179, 8, 0.35);
    border-radius: 12px;
    padding: 1rem 1.1rem;
    margin-top: 1.25rem;
    font-size: 0.82rem;
    line-height: 1.85;
    color: #fde68a;
}

.security-note-title {
    font-weight: 700;
    margin-bottom: 0.4rem;
    color: #fcd34d;
}

.security-note p:last-child {
    color: var(--text-muted);
}

h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.75rem;
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.btn.primary {
    background: var(--primary);
    color: #fff;
}

.btn.primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn.secondary {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--glass-border);
    margin-top: 0.75rem;
    text-decoration: none;
}

.btn.secondary:hover {
    background: rgba(255, 255, 255, 0.08);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.status-box {
    min-height: 2.5rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-radius: 10px;
    font-size: 0.9rem;
}

.status-box.success {
    background: rgba(22, 163, 74, 0.2);
    color: #4ade80;
}

.status-box.error {
    background: rgba(220, 38, 38, 0.2);
    color: #f87171;
}

.status-box.info {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
}

.hint {
    margin-top: 1.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.error-box h1 {
    color: var(--error);
}

/* Archive styles */
.archive-container {
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 1.5rem;
}

.archive-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}
.header-btn {
    width: auto;
    padding: 0.55rem 1.1rem;
    font-size: 0.83rem;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 10px;
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.header-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}
.subscribe-btn { background: rgba(59,130,246,0.18); color: #93c5fd; border-color: rgba(59,130,246,0.4); }
.subscribe-btn:hover { box-shadow: 0 6px 16px rgba(59,130,246,0.35); }
.charge-btn { background: rgba(34,197,94,0.18); color: #86efac; border-color: rgba(34,197,94,0.4); }
.charge-btn:hover { box-shadow: 0 6px 16px rgba(34,197,94,0.35); }
.help-btn { background: rgba(234,179,8,0.18); color: #fde68a; border-color: rgba(234,179,8,0.4); }
.help-btn:hover { box-shadow: 0 6px 16px rgba(234,179,8,0.35); }
.logout-btn { background: rgba(220,38,38,0.18); color: #fca5a5; border-color: rgba(220,38,38,0.4); }
.logout-btn:hover { box-shadow: 0 6px 16px rgba(220,38,38,0.35); }

@media (max-width: 640px) {
    .header-actions { width: 100%; }
    .header-btn { flex: 1 1 calc(50% - 0.6rem); justify-content: center; }
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.filters input,
.filters select {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 0.6rem 1rem;
    color: var(--text);
    font-family: inherit;
    font-size: 0.9rem;
}

.table-wrap {
    overflow-x: auto;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--glass-shadow);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

th, td {
    padding: 0.85rem 1rem;
    text-align: right;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

th {
    background: rgba(0,0,0,0.2);
    font-weight: 600;
    white-space: nowrap;
}

tr:hover td {
    background: rgba(255,255,255,0.04);
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-critical { background: rgba(220,38,38,0.3); color: #fca5a5; }
.badge-urgent { background: rgba(234,88,12,0.3); color: #fdba74; }
.badge-notice { background: rgba(37,99,235,0.3); color: #93c5fd; }
.badge-normal { background: rgba(22,163,74,0.3); color: #86efac; }
.badge-history { background: rgba(107,114,128,0.3); color: #d1d5db; }
.badge-active { background: rgba(34,197,94,0.25); color: #86efac; }
.badge-inactive { background: rgba(107,114,128,0.3); color: #d1d5db; }
.badge-pending { background: rgba(234,179,8,0.25); color: #fde68a; }
.badge-blocked { background: rgba(220,38,38,0.25); color: #fca5a5; }
.copy-btn { cursor: pointer; color: var(--primary, #3b82f6); font-size: 0.8rem; margin-right: 0.4rem; }

/* Tenant panel tabs */
.tab-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.12);
    padding-bottom: 0.5rem;
}
.tab-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    padding: 0.55rem 1rem;
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
}
.tab-btn:hover { background: rgba(255,255,255,0.06); }
.tab-btn.active { background: rgba(59,130,246,0.18); color: var(--text); border-color: rgba(59,130,246,0.4); }
.tab-panel { animation: fadein 0.15s ease; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

.wallet-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.wallet-actions a.btn { text-decoration: none; padding: 0.55rem 1.25rem; }

.account-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}
.info-box {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 1.25rem;
}
.info-box h3 { font-size: 0.95rem; margin-bottom: 1rem; }
.info-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    font-size: 0.85rem;
}
.info-row:last-child { border-bottom: none; }
.info-row span:first-child { color: var(--text-muted); flex: 0 0 auto; min-width: 130px; }
.info-row code { background: rgba(0,0,0,0.3); padding: 0.2rem 0.5rem; border-radius: 6px; font-size: 0.78rem; }

@media (max-width: 640px) {
    .tab-nav { gap: 0.35rem; }
    .tab-btn { padding: 0.5rem 0.7rem; font-size: 0.78rem; }
    .info-row span:first-child { min-width: 100%; }
}

/* Post-signup one-time welcome banner in archive.php */
.welcome-box {
    background: linear-gradient(135deg, rgba(34,197,94,0.14), rgba(59,130,246,0.1));
    border: 1px solid rgba(34,197,94,0.35);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.welcome-box h2 { font-size: 1.15rem; margin-bottom: 0.6rem; }
.welcome-box > p { font-size: 0.88rem; line-height: 1.9; color: var(--text); }
.welcome-box .warning-line { margin-top: 1rem; color: #fde68a; font-size: 0.82rem; line-height: 1.8; }

.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.pagination a, .pagination span {
    padding: 0.5rem 0.9rem;
    border-radius: 8px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
}

.pagination a:hover {
    background: rgba(255,255,255,0.2);
}

.pagination .current {
    background: var(--primary);
    border-color: var(--primary);
}

.login-form {
    max-width: 360px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.25rem;
    text-align: right;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    background: rgba(0,0,0,0.25);
    color: var(--text);
    font-family: inherit;
    font-size: 1rem;
}

.captcha-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.captcha-img {
    height: 62px;
    border-radius: 8px;
    cursor: pointer;
    flex: 0 0 auto;
}

.otp-boxes { display: flex; gap: 8px; direction: ltr; }
.otp-box {
    width: 40px;
    height: 48px;
    padding: 1px !important;
    text-align: center;
    font-size: 1.2rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    color: #111;
}
.otp-box:focus { border-color: #007bff; outline: none; box-shadow: 0 0 0 2px rgba(0,123,255,0.25); }

@media (max-width: 420px) {
    .captcha-row { flex-wrap: wrap; }
    .otp-box { width: 34px; height: 42px; font-size: 1.05rem; }
}

.btn.sm { width: auto; padding: 0.5rem 1rem; font-size: 0.85rem; }

.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex; align-items: center; justify-content: center;
    z-index: 200; padding: 1rem;
}
.modal {
    background: rgba(15, 23, 42, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.75rem;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    text-align: right;
}
.modal h2 { margin-bottom: 1.25rem; }
.modal-actions { display: flex; gap: 0.75rem; margin-top: 1.5rem; justify-content: flex-start; }

/* Notification detail modal (shared by dashboard/notifications/archive) */
.notif-modal { max-width: 560px; }
.notif-modal-body { display: flex; flex-direction: column; gap: 0.6rem; }
.notif-modal-title { font-size: 1.05rem; font-weight: 700; }
.notif-modal-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; font-size: 0.85rem; padding: 0.35rem 0; border-bottom: 1px solid rgba(255,255,255,0.08); }
.notif-modal-label { color: var(--text-muted); flex: 0 0 auto; }
.notif-modal-value { text-align: left; word-break: break-word; }
.notif-modal-counts { display: flex; gap: 0.5rem; margin: 0.4rem 0; }
.notif-modal-counts > div { flex: 1 1 0; background: rgba(0,0,0,0.25); border-radius: 8px; padding: 0.5rem; text-align: center; }
.notif-modal-counts span { display: block; font-size: 0.7rem; color: var(--text-muted); }
.notif-modal-counts b { font-size: 1rem; }
.notif-modal-message-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.3rem; }
.notif-modal-message { white-space: pre-wrap; word-break: break-word; background: rgba(0,0,0,0.25); border-radius: 10px; padding: 0.75rem; font-size: 0.9rem; line-height: 1.8; max-height: 240px; overflow-y: auto; }

.wallet-banner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.35);
    border-radius: 14px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
}
.wallet-banner.low { background: rgba(234, 179, 8, 0.14); border-color: rgba(234, 179, 8, 0.4); color: #fde68a; }
.wallet-banner.empty { background: rgba(220, 38, 38, 0.14); border-color: rgba(220, 38, 38, 0.4); color: #fca5a5; }
.wallet-banner .balance-value { font-size: 1.15rem; font-weight: 700; }

/* Landing / sign-up page */
.landing-container { max-width: 1100px; width: 100%; margin: 0 auto; padding: 1.5rem; text-align: right; }
.landing-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2.5rem; flex-wrap: wrap; gap: 1rem; }
.landing-nav .brand { font-size: 1.2rem; font-weight: 700; display: flex; align-items: center; gap: 0.5rem; }
.landing-nav a.btn { width: auto; padding: 0.55rem 1.25rem; font-size: 0.85rem; display: inline-block; }
.hero { text-align: center; padding: 2rem 1rem 3rem; }
.hero h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); margin-bottom: 0.9rem; }
.hero p { color: var(--text-muted); font-size: 1rem; max-width: 640px; margin: 0 auto 1.75rem; line-height: 2; }
.hero .btn { width: auto; padding: 0.8rem 2rem; display: inline-block; text-decoration: none; }
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1.25rem;
    margin-bottom: 3rem;
}
.feature-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: right;
}
.feature-card .f-icon { font-size: 1.8rem; margin-bottom: 0.6rem; display: block; }
.feature-card h3 { font-size: 1rem; margin-bottom: 0.5rem; }
.feature-card p { color: var(--text-muted); font-size: 0.85rem; line-height: 1.9; }
.signup-section { max-width: 560px; margin: 0 auto 2rem; }
.signup-section h2 { text-align: center; margin-bottom: 1.75rem; font-size: 1.3rem; }
.landing-footer { text-align: center; color: var(--text-muted); font-size: 0.8rem; padding: 2rem 0 0.5rem; }
.code-block {
    background: rgba(0,0,0,0.4);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    overflow-x: auto;
    direction: ltr;
    text-align: left;
    font-size: 0.82rem;
    line-height: 1.7;
    color: #d1e0ff;
    margin: 0.75rem 0 1.5rem;
}
.docs-section { max-width: 820px; margin: 0 auto 3rem; }
.docs-section h2 { text-align: center; margin-bottom: 0.5rem; font-size: 1.3rem; }
.docs-section > p.docs-intro { text-align: center; color: var(--text-muted); margin-bottom: 2rem; }
.docs-block { background: var(--glass-bg); backdrop-filter: blur(16px); border: 1px solid var(--glass-border); border-radius: 16px; padding: 1.5rem 1.75rem; margin-bottom: 1.5rem; text-align: right; }
.docs-block h3 { font-size: 1rem; margin-bottom: 0.5rem; }
.docs-block p { color: var(--text-muted); font-size: 0.88rem; line-height: 1.9; }
.docs-table { width: 100%; border-collapse: collapse; margin: 0.75rem 0; font-size: 0.85rem; }
.docs-table th, .docs-table td { padding: 0.5rem 0.6rem; border-bottom: 1px solid rgba(255,255,255,0.08); text-align: right; }
.docs-table th { color: var(--text-muted); font-weight: 600; }
.docs-table code { background: rgba(0,0,0,0.3); padding: 0.15rem 0.4rem; border-radius: 5px; direction: ltr; display: inline-block; }
.wp-download { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.wp-download a.btn { text-decoration: none; padding: 0.7rem 1.5rem; width: auto; }
/* Register.php inline form-control error/success boxes (reuses .status-box) */
.form-control-box,
.form-success-box {
    min-height: auto;
}
.hp-field { position: absolute; left: -9999px; opacity: 0; height: 0; width: 0; }

/* Wallet top-up page (pay.php) */
.pay-container { width: 100%; max-width: 640px; }
.quick-amounts { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.6rem; }
.quick-amount-btn { width: auto; padding: 0.45rem 1rem; }
.pay-gateway-box {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 14px;
    padding: 1.25rem 1.4rem;
    margin: 1.25rem 0;
}
.pay-gateway-box h3 { font-size: 1rem; margin-bottom: 0.5rem; }
.pay-gateway-box > p { color: var(--text-muted); font-size: 0.85rem; line-height: 1.9; margin-bottom: 1rem; }
.pay-gateway-box .btn.primary { width: auto; padding: 0.7rem 1.75rem; }
#amountInput { direction: ltr; text-align: center; font-size: 1.1rem; font-weight: 600; }

@media (max-width: 640px) {
    .pay-container { padding: 0 0.5rem; }
    .pay-gateway-box { padding: 1rem; }
}

@media (max-width: 700px) {
    .landing-container { padding: 1rem; }
    .hero { padding: 1.25rem 0.25rem 2rem; }
    .features-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .card.glass {
        padding: 1.75rem 1.25rem;
    }
    th, td {
        padding: 0.6rem 0.5rem;
        font-size: 0.8rem;
    }
    .filters { flex-direction: column; align-items: stretch; }
    .filters input, .filters select, .filters button { width: 100%; }
}

/* Responsive "stacked card" table for the tenant's notification archive,
   matching the same pattern used in the admin panel. */
@media (max-width: 700px) {
    .table-wrap table,
    .table-wrap thead,
    .table-wrap tbody,
    .table-wrap th,
    .table-wrap td,
    .table-wrap tr {
        display: block;
    }
    .table-wrap thead { position: absolute; top: -9999px; left: -9999px; }
    .table-wrap tr {
        border-bottom: 1px solid rgba(255,255,255,0.15);
        padding: 0.6rem 0.25rem;
    }
    .table-wrap td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 0.75rem;
        text-align: left;
        border-bottom: none;
        padding: 0.4rem 0.25rem;
        white-space: normal;
        word-break: break-word;
    }
    .table-wrap td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-muted);
        flex: 0 0 auto;
        margin-left: auto;
        padding-left: 0.75rem;
        font-size: 0.78rem;
    }
    .table-wrap td[data-label=""]::before,
    .table-wrap td:not([data-label])::before { content: none; }
}
