/* ============================================================
   Swish Payment Modal — School Green & Orange Theme
   c:\xampp\htdocs\srms\assets\css\swish-payment-modal.css
   ============================================================ */

/* ── School colour palette ──────────────────────────────────── */
:root {
    --swish-green:        #228B22;
    --swish-dark-green:   #006400;
    --swish-orange:       #FF8C00;
    --swish-orange-dark:  #e07800;
    --swish-light-green:  #e8f5e8;
    --swish-light-orange: #fff4e0;
    --swish-confirm:      #1a7a1a;
    --swish-confirm-bg:   #d4edda;
}

/* ── Overlay ─────────────────────────────────────────────────── */
#swishPaymentOverlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 50, 0, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: swishFadeIn 0.3s ease;
}
#swishPaymentOverlay.active {
    display: flex;
}
@keyframes swishFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Modal card ──────────────────────────────────────────────── */
.swish-modal {
    background: #ffffff;
    border-radius: 20px;
    box-shadow:
        0 28px 70px rgba(0, 100, 0, 0.25),
        0 0 0 1px rgba(34,139,34,0.12);
    max-width: 540px;
    width: 100%;
    overflow: hidden;
    animation: swishSlideUp 0.38s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}
@keyframes swishSlideUp {
    from { transform: translateY(50px) scale(0.96); opacity: 0; }
    to   { transform: translateY(0)    scale(1);    opacity: 1; }
}

/* ── Header ──────────────────────────────────────────────────── */
.swish-modal-header {
    background: linear-gradient(135deg, var(--swish-dark-green) 0%, var(--swish-green) 100%);
    padding: 24px 28px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.swish-modal-header .swish-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 0;
}
.swish-brand-icon {
    width: 46px;
    height: 46px;
    background: rgba(255,255,255,0.20);
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(0,0,0,0.18);
}
.swish-modal-header h2 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.swish-modal-header p {
    margin: 2px 0 0;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.78);
}
.swish-modal-close {
    background: rgba(255,255,255,0.18);
    border: none;
    color: #fff;
    font-size: 18px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}
.swish-modal-close:hover { background: rgba(255,255,255,0.32); }

/* ── Amount banner ───────────────────────────────────────────── */
.swish-amount-banner {
    background: linear-gradient(90deg, var(--swish-orange) 0%, var(--swish-orange-dark) 100%);
    padding: 13px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.swish-amount-banner .label {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.85);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    font-weight: 600;
}
.swish-amount-banner .amount {
    font-size: 1.75rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.02em;
}
.swish-amount-banner .currency {
    font-size: 0.9rem;
    font-weight: 700;
    color: rgba(255,255,255,0.88);
    margin-right: 3px;
    vertical-align: super;
    line-height: 0;
}

/* ── Body ────────────────────────────────────────────────────── */
.swish-modal-body {
    padding: 24px 28px 20px;
}

/* ── Method tabs — 2×2 grid to avoid overflow ────────────────── */
.swish-method-tabs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 22px;
}
.swish-tab-btn {
    background: #f5faf5;
    border: 2px solid #d6e8d6;
    border-radius: 12px;
    padding: 13px 10px 11px;
    cursor: pointer;
    text-align: center;
    transition: all 0.22s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-start;
}
.swish-tab-btn .tab-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    transition: all 0.22s;
    background: rgba(34,139,34,0.12);
    color: var(--swish-green);
}
.swish-tab-btn .tab-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: #444;
    line-height: 1.25;
    text-align: left;
    white-space: normal;
    word-break: break-word;
}
.swish-tab-btn:hover {
    border-color: var(--swish-green);
    background: var(--swish-light-green);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(34,139,34,0.14);
}
.swish-tab-btn.active {
    border-color: var(--swish-orange);
    background: var(--swish-light-orange);
    box-shadow: 0 4px 14px rgba(255,140,0,0.20);
}
.swish-tab-btn.active .tab-icon {
    background: linear-gradient(135deg, var(--swish-green), var(--swish-dark-green));
    color: #fff;
    box-shadow: 0 3px 8px rgba(34,139,34,0.3);
}
.swish-tab-btn.active .tab-label { color: var(--swish-dark-green); }

/* ── Method panels ───────────────────────────────────────────── */
.swish-panel { display: none; }
.swish-panel.active { display: block; animation: swishPanelIn 0.25s ease; }
@keyframes swishPanelIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.swish-panel-desc {
    background: var(--swish-light-green);
    border: 1px solid #b8d8b8;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 0.855rem;
    color: #2d4d2d;
    line-height: 1.6;
    margin-bottom: 16px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
.swish-panel-desc .info-icon {
    font-size: 15px;
    color: var(--swish-green);
    margin-top: 2px;
    flex-shrink: 0;
}

/* ── Form controls ───────────────────────────────────────────── */
.swish-form-group {
    margin-bottom: 14px;
}
.swish-form-group label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.swish-form-group input {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #c8ddc8;
    border-radius: 10px;
    font-size: 0.97rem;
    background: #fafffe;
    color: #111;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}
.swish-form-group input:focus {
    outline: none;
    border-color: var(--swish-green);
    box-shadow: 0 0 0 3px rgba(34,139,34,0.13);
}
.swish-form-group small {
    color: #7a8a7a;
    font-size: 0.73rem;
    margin-top: 4px;
    display: block;
}

/* ── QR image display ────────────────────────────────────────── */
.swish-qr-box {
    text-align: center;
    padding: 14px 0 4px;
}
.swish-qr-box img {
    width: 180px;
    height: 180px;
    border: 3px solid var(--swish-orange);
    border-radius: 14px;
    padding: 8px;
    background: #fff;
}
.swish-qr-box p {
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 8px;
}

/* ── Action button ───────────────────────────────────────────── */
.swish-pay-btn {
    display: block;
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--swish-green) 0%, var(--swish-dark-green) 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 0.97rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.18s, box-shadow 0.2s;
    box-shadow: 0 5px 18px rgba(34,139,34,0.30);
    margin-top: 4px;
}
.swish-pay-btn:hover:not(:disabled) {
    opacity: 0.92;
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(34,139,34,0.38);
}
.swish-pay-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ── Status / Polling screen ─────────────────────────────────── */
.swish-status-screen {
    display: none;
    text-align: center;
    padding: 8px 0 18px;
}
.swish-status-screen.active { display: block; }

.swish-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid #d4ead4;
    border-top-color: var(--swish-orange);
    border-radius: 50%;
    animation: swishSpin 0.85s linear infinite;
    margin: 0 auto 18px;
}
@keyframes swishSpin {
    to { transform: rotate(360deg); }
}

.swish-status-screen h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--swish-dark-green);
    margin: 0 0 8px;
}
.swish-status-screen p {
    font-size: 0.845rem;
    color: #555;
    margin: 0 0 14px;
    line-height: 1.6;
}
.swish-countdown {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--swish-light-orange);
    border: 1px solid #f5d08a;
    border-radius: 10px;
    padding: 8px 18px;
    font-size: 0.87rem;
    font-weight: 600;
    color: #6b4700;
}
.swish-countdown .timer-val {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--swish-orange-dark);
    font-variant-numeric: tabular-nums;
}

/* ── Result screens ──────────────────────────────────────────── */
.swish-result {
    display: none;
    text-align: center;
    padding: 14px 0 6px;
}
.swish-result.active { display: block; animation: swishPanelIn 0.3s ease; }

.swish-result-icon {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 36px;
}
.swish-result.success .swish-result-icon { background: var(--swish-light-green); color: var(--swish-dark-green); }
.swish-result.failed  .swish-result-icon { background: #fee2e2; color: #991b1b; }

.swish-result h3 {
    font-size: 1.1rem;
    font-weight: 800;
    margin: 0 0 10px;
}
.swish-result.success h3 { color: var(--swish-dark-green); }
.swish-result.failed  h3 { color: #991b1b; }

.swish-result p {
    font-size: 0.855rem;
    color: #5a6a5a;
    line-height: 1.6;
    margin: 0 0 20px;
}

.swish-result-btn {
    display: inline-block;
    padding: 12px 32px;
    border-radius: 10px;
    font-size: 0.93rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.2s, transform 0.15s;
}
.swish-result-btn:hover { opacity: 0.88; transform: translateY(-1px); }
.swish-result.success .swish-result-btn { background: var(--swish-green); color: #fff; }
.swish-result.failed  .swish-result-btn { background: #6b7280; color: #fff; }

/* ── Footer note ─────────────────────────────────────────────── */
.swish-modal-footer-note {
    background: var(--swish-light-green);
    border-top: 1px solid #c8ddc8;
    padding: 11px 28px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.73rem;
    color: #5a7a5a;
}
.swish-modal-footer-note i { color: var(--swish-orange); font-size: 13px; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 560px) {
    .swish-modal { border-radius: 16px; }
    .swish-modal-header,
    .swish-amount-banner,
    .swish-modal-body,
    .swish-modal-footer-note { padding-left: 18px; padding-right: 18px; }
    .swish-amount-banner .amount { font-size: 1.5rem; }
    .swish-tab-btn .tab-label { font-size: 0.78rem; }
}
