/* ═══════════════════════════════════════════════════════════
   ICDET Payment System - Complete Stylesheet
   ═══════════════════════════════════════════════════════════ */

/* ── CSS Variables ──────────────────────────────────────── */
:root {
    --primary: #e0a84a;
    --primary-dark: #c99438;
    --primary-light: #f0c878;
    --secondary: #6fd2b1;
    --success: #6fd2b1;
    --success-bg: rgba(111,210,177,0.15);
    --danger: #e05555;
    --danger-bg: rgba(224,85,85,0.12);
    --warning: #e0a84a;
    --warning-bg: rgba(224,168,74,0.12);
    --info: #6fd2b1;
    --info-bg: rgba(111,210,177,0.1);
    --bg: #0a1c1d;
    --card-bg: rgba(255,255,255,0.08);
    --text: #f7f2e9;
    --text-muted: #c3d0ca;
    --border: rgba(255,255,255,0.12);
    --shadow: 0 24px 60px rgba(6,14,16,0.35);
    --shadow-lg: 0 24px 60px rgba(6,14,16,0.5);
    --radius: 10px;
    --radius-lg: 18px;
    --font: 'Space Grotesk', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --sidebar-width: 240px;
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body {
    font-family: var(--font);
    background:
        radial-gradient(1200px 900px at 12% 12%, #1c3b3e 0%, transparent 60%),
        radial-gradient(900px 700px at 90% 10%, #274437 0%, transparent 55%),
        linear-gradient(140deg, var(--bg) 0%, #123033 60%, #0b1516 100%);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--primary-light); }
img { max-width: 100%; }
code { background: rgba(255,255,255,0.06); padding: 2px 6px; border-radius: 4px; font-size: .875rem; color: var(--primary); }
pre { background: rgba(0,0,0,0.3); color: #c3d0ca; padding: 16px; border-radius: var(--radius); overflow-x: auto; font-size: .85rem; }
hr { border: 0; border-top: 1px solid var(--border); margin: 24px 0; }

/* ── Container ──────────────────────────────────────────── */
.container { max-width: 960px; margin: 0 auto; padding: 0 20px; }

/* ── Buttons ────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 10px 20px; border: none; border-radius: var(--radius);
    font-size: .9375rem; font-weight: 600; cursor: pointer;
    transition: all .2s; text-decoration: none; gap: 8px;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); text-decoration: none; }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--primary); color: #1a1408; font-weight: 700; }
.btn-primary:hover { background: var(--primary-dark); color: #1a1408; }
.btn-secondary { background: var(--secondary); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { display: flex; width: 100%; }
.btn-lg { padding: 14px 28px; font-size: 1.0625rem; }
.btn-sm { padding: 6px 12px; font-size: .8125rem; }
.btn-group { display: flex; gap: 8px; }

/* ── Forms ──────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .875rem; color: var(--text); }
.form-control {
    display: block; width: 100%; padding: 10px 14px;
    border: 2px solid var(--border); border-radius: var(--radius);
    font-size: .9375rem; font-family: var(--font);
    transition: border-color .2s, box-shadow .2s;
    background: rgba(255,255,255,0.06); color: var(--text);
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(224,168,74,.15); }
.form-control-lg { padding: 14px 18px; font-size: 1.125rem; }
.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 200px; }
.flex-1 { flex: 1; }
.flex-2 { flex: 2; }
.search-form .form-row { align-items: flex-end; }
.search-form .btn { margin-bottom: 16px; }

textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control { cursor: pointer; }
select.form-control option {
    background: #1a2e2f;
    color: #e8e4dc;
    padding: 8px;
}
input[type="file"].form-control { padding: 8px; }
.checkbox-label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; }

/* ── Cards ──────────────────────────────────────────────── */
.card {
    background: var(--card-bg); border-radius: var(--radius-lg);
    box-shadow: var(--shadow); overflow: hidden;
}
.card-header {
    padding: 20px 24px; border-bottom: 1px solid var(--border);
    background: rgba(255,255,255,0.04);
}
.card-header h2 { font-size: 1.125rem; font-weight: 700; }
.card-body { padding: 24px; }
.mt-20 { margin-top: 20px; }
.mt-10 { margin-top: 10px; }

/* ── Alerts ─────────────────────────────────────────────── */
.alert {
    padding: 14px 18px; border-radius: var(--radius); margin-bottom: 16px;
    font-size: .9375rem; border-left: 4px solid;
}
.alert-success { background: var(--success-bg); color: var(--success); border-color: var(--success); }
.alert-danger  { background: var(--danger-bg);  color: var(--danger); border-color: var(--danger); }
.alert-warning { background: var(--warning-bg); color: var(--warning); border-color: var(--warning); }
.alert-info    { background: var(--info-bg);    color: var(--secondary); border-color: var(--info); }
.alert ul { margin: 8px 0 0 20px; }

/* ── Badges ─────────────────────────────────────────────── */
.badge {
    display: inline-block; padding: 3px 10px; border-radius: 20px;
    font-size: .75rem; font-weight: 600; text-transform: uppercase;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-info    { background: var(--info-bg);    color: var(--secondary); }

/* ── Tables ─────────────────────────────────────────────── */
.table-responsive { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); font-size: .875rem; color: var(--text-muted); }
.table th { background: rgba(255,255,255,0.04); font-weight: 700; white-space: nowrap; color: var(--text); }
.table tr:hover { background: rgba(255,255,255,0.03); }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════════════════════════════ */
.login-page {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh; background: linear-gradient(140deg, #0a1c1d 0%, #123033 60%, #0b1516 100%);
}
.login-container { width: 100%; max-width: 420px; padding: 20px; }
.login-card {
    background: rgba(255,255,255,0.08); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg); padding: 40px; border: 1px solid rgba(255,255,255,0.12);
}
.login-header { text-align: center; margin-bottom: 32px; }
.login-header h1 { font-size: 1.5rem; color: var(--primary); font-family: 'Fraunces', 'Times New Roman', serif; }
.login-header p { color: var(--text-muted); font-size: .875rem; margin-top: 4px; }

/* ═══════════════════════════════════════════════════════════
   ADMIN LAYOUT
   ═══════════════════════════════════════════════════════════ */
.admin-layout { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-width); background: rgba(0,0,0,0.3); color: #c3d0ca;
    position: fixed; top: 0; left: 0; bottom: 0; overflow-y: auto; z-index: 100;
    border-right: 1px solid rgba(255,255,255,0.08);
}
.sidebar-header {
    padding: 24px 20px; border-bottom: 1px solid rgba(255,255,255,.1);
}
.sidebar-header h2 { font-size: 1.125rem; color: var(--primary); font-family: 'Fraunces', 'Times New Roman', serif; }
.sidebar-nav { padding: 16px 0; }
.sidebar-nav a {
    display: block; padding: 10px 20px; color: var(--text-muted);
    font-size: .9375rem; transition: all .2s;
    text-decoration: none; border-left: 3px solid transparent;
}
.sidebar-nav a:hover { background: rgba(255,255,255,.05); color: var(--text); text-decoration: none; }
.sidebar-nav a.active { background: rgba(224,168,74,.1); color: var(--primary); border-left-color: var(--primary); }
.sidebar-nav .logout-link { margin-top: 20px; border-top: 1px solid rgba(255,255,255,.1); padding-top: 20px; color: #f87171; }
.sidebar-nav .logout-link:hover { background: rgba(248,113,113,.1); }

.admin-main {
    margin-left: var(--sidebar-width); flex: 1; padding: 24px 32px;
    min-height: 100vh;
}
.admin-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.admin-header h1 { font-size: 1.5rem; font-weight: 700; }
.admin-user { font-size: .875rem; color: var(--text-muted); }

/* ── Stats Grid ─────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
    background: var(--card-bg); border-radius: var(--radius-lg);
    padding: 24px; box-shadow: var(--shadow);
    border-left: 4px solid var(--text-muted);
    border: 1px solid var(--border);
}
.stat-card.stat-success { border-left-color: var(--success); }
.stat-card.stat-primary { border-left-color: var(--primary); }
.stat-card.stat-warning { border-left-color: var(--warning); }
.stat-number { font-size: 1.75rem; font-weight: 800; line-height: 1.2; }
.stat-label { font-size: .8125rem; color: var(--text-muted); margin-top: 4px; text-transform: uppercase; letter-spacing: .5px; }
/* ── Fee Management ─────────────────────────────────────── */
.fee-type-item {
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 16px; margin-bottom: 12px; display: flex; gap: 12px; align-items: flex-start;
}
.fee-type-item.inactive { opacity: .6; background: #f8fafc; }
.fee-type-item .fee-edit-form { flex: 1; }
.fee-type-item .inline-form { display: flex; align-items: flex-end; padding-bottom: 16px; }
.inline-form { display: inline; }
.form-row.align-center { align-items: center; }

.csv-template { background: #1e293b; color: #e2e8f0; padding: 16px; border-radius: var(--radius); margin: 16px 0; }
.csv-template strong { color: #fff; display: block; margin-bottom: 8px; }

/* ═══════════════════════════════════════════════════════════
   PAYMENT PAGE (PUBLIC)
   ═══════════════════════════════════════════════════════════ */
.payment-page { min-height: 100vh; display: flex; flex-direction: column; }

.payment-header {
    background: linear-gradient(130deg, rgba(224,168,74,0.18), rgba(111,210,177,0.14));
    color: var(--text); padding: 32px 0; text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.payment-header h1 { font-size: 1.75rem; font-weight: 800; font-family: 'Fraunces', 'Times New Roman', serif; }
.payment-header p { color: var(--text-muted); margin-top: 4px; }

.payment-footer {
    text-align: center; padding: 24px 0; margin-top: auto;
    border-top: 1px solid var(--border); color: var(--text-muted); font-size: .8125rem;
}
/* ── Steps Bar ──────────────────────────────────────────── */
.steps-bar {
    display: flex; align-items: center; justify-content: center;
    padding: 32px 0; gap: 0; flex-wrap: wrap;
}
.step {
    display: flex; align-items: center; gap: 10px;
    opacity: .4; transition: opacity .3s;
}
.step.active, .step.completed { opacity: 1; }
.step-number {
    width: 36px; height: 36px; border-radius: 50%;
    background: rgba(255,255,255,0.15); color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .875rem;
}
.step.active .step-number { background: var(--primary); color: #1a1408; }
.step.completed .step-number { background: var(--success); color: #0a1c1d; }
.step-label { font-weight: 600; font-size: .875rem; }
.step-line {
    width: 60px; height: 2px; background: var(--border); margin: 0 8px;
}

/* ── Step Panels ────────────────────────────────────────── */
.step-panel { display: none; margin-bottom: 40px; }
.step-panel.active { display: block; animation: fadeIn .3s ease; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.form-actions { display: flex; justify-content: space-between; margin-top: 24px; gap: 12px; }

/* ── Submission Details ─────────────────────────────────── */
.submission-details {
    background: rgba(111,210,177,0.08); border: 1px solid rgba(111,210,177,0.2); border-radius: var(--radius);
    padding: 20px; margin-bottom: 24px;
}
.detail-row { display: flex; margin-bottom: 8px; gap: 12px; }
.detail-row:last-child { margin-bottom: 0; }
.detail-label { font-weight: 700; min-width: 140px; color: var(--text); }
.detail-value { color: var(--text-muted); flex: 1; }

/* ── Fee Options ────────────────────────────────────────── */
.fee-options { display: flex; flex-direction: column; gap: 12px; margin: 16px 0; }
.fee-option {
    display: block; cursor: pointer;
}
.fee-option input[type="radio"] { display: none; }
.fee-option-content {
    border: 2px solid var(--border); border-radius: var(--radius-lg);
    padding: 20px; transition: all .2s;
}
.fee-option input:checked + .fee-option-content {
    border-color: var(--primary); background: rgba(224,168,74,.06);
    box-shadow: 0 0 0 3px rgba(224,168,74,.1);
}
.fee-option:hover .fee-option-content { border-color: var(--primary-light); }
.fee-option-header { display: flex; justify-content: space-between; align-items: center; }
.fee-option-label { font-size: 1.0625rem; font-weight: 700; }
.fee-option-price { font-size: 1.25rem; font-weight: 800; color: var(--primary); }
.fee-option-price small { font-size: .75rem; font-weight: 400; color: var(--text-muted); }
.fee-option-desc { margin-top: 6px; font-size: .875rem; color: var(--text-muted); }

/* ── Order Summary ──────────────────────────────────────── */
.order-summary {
    background: rgba(255,255,255,0.04); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 24px; margin-bottom: 24px;
}
.order-summary h3 { margin-bottom: 16px; font-size: 1rem; }
.summary-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: .9375rem; color: var(--text-muted); }
.summary-row:last-child { border-bottom: none; }
.summary-total { font-size: 1.125rem; font-weight: 800; color: var(--primary); border-top: 2px solid var(--primary); padding-top: 12px; margin-top: 4px; }

/* ── Payment Methods ────────────────────────────────────── */
.payment-methods { margin: 24px 0; }
.payment-method-section {
    border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 0; margin-bottom: 16px; overflow: hidden;
}
.payment-method-section h4 { margin-bottom: 8px; font-size: 1rem; }
.payment-method-header {
    background: rgba(255,255,255,0.04); padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.payment-method-option {
    display: flex; align-items: center; gap: 12px; cursor: pointer; margin: 0;
}
.payment-method-option input[type="radio"] {
    width: 20px; height: 20px; accent-color: var(--primary);
}
.payment-method-label { display: flex; flex-direction: column; }
.payment-method-label strong { font-size: 1rem; color: var(--text); }
.payment-method-label .text-muted { font-size: 0.875rem; }
.payment-method-body { 
    padding: 20px; 
    background: #ffffff; 
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
#paypal-button-container { 
    margin-top: 16px; 
    max-width: 500px; 
    background: #ffffff; 
    padding: 16px; 
    border-radius: var(--radius-md); 
}
.btn-block { width: 100%; max-width: 500px; }

/* ── Processing Overlay ─────────────────────────────────── */
.processing-overlay {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; padding: 40px; text-align: center;
}
.spinner {
    width: 48px; height: 48px; border: 4px solid var(--border);
    border-top-color: var(--primary); border-radius: 50%;
    animation: spin 1s linear infinite; margin-bottom: 16px;
}@keyframes spin { to { transform: rotate(360deg); } }

/* ── Already Paid Notice ────────────────────────────────── */
.already-paid-notice { margin-top: 20px; }

/* ═══════════════════════════════════════════════════════════
   CONFIRMATION / RECEIPT
   ═══════════════════════════════════════════════════════════ */
.confirmation-card {
    max-width: 640px; margin: 40px auto; text-align: center;
    background: var(--card-bg); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg); padding: 40px; overflow: hidden;
    border: 1px solid var(--border);
}
.confirmation-icon {
    width: 80px; height: 80px; border-radius: 50%;
    background: var(--success-bg); color: var(--success);
    display: flex; align-items: center; justify-content: center;
    font-size: 2.5rem; font-weight: 800; margin: 0 auto 24px;
}
.confirmation-icon.error-icon { background: var(--danger-bg); color: var(--danger); }
.confirmation-icon.warning-icon { background: var(--warning-bg); color: var(--warning); }
.confirmation-card h2 { font-size: 1.5rem; margin-bottom: 8px; }
.confirmation-actions { display: flex; gap: 12px; justify-content: center; margin-top: 24px; }

/* ── Receipt ────────────────────────────────────────────── */
.receipt {
    text-align: left; margin: 24px 0;
    border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden;
}
.receipt-header {
    background: linear-gradient(130deg, rgba(224,168,74,0.25), rgba(111,210,177,0.2));
    color: var(--text); padding: 20px 24px; text-align: center;
}
.receipt-header h3 { font-size: 1.125rem; }
.receipt-header p { font-size: .875rem; opacity: .85; }
.receipt-body { padding: 20px 24px; }
.receipt-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: .9375rem; gap: 16px; }
.receipt-row:last-child { border-bottom: none; }
.receipt-label { color: var(--text-muted); min-width: 160px; }
.receipt-value { text-align: right; font-weight: 500; flex: 1; word-break: break-all; }
.receipt-total .receipt-value { font-size: 1.25rem; font-weight: 800; color: var(--primary); }
.receipt-footer { text-align: center; padding: 20px 24px; background: rgba(255,255,255,0.04); border-top: 1px solid var(--border); }

/* ── Print Styles ───────────────────────────────────────── */
@media print {
    body { background: #fff; color: #000; }
    .payment-header, .payment-footer, .confirmation-actions, .btn { display: none !important; }
    .confirmation-card { box-shadow: none; margin: 0; max-width: 100%; padding: 0; background: #fff; color: #000; border: none; }
    .receipt { border: 2px solid #333; }
    .receipt-header { background: #333 !important; color: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .receipt-row, .receipt-label, .receipt-value { color: #000; }
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .admin-layout { flex-direction: column; }
    .sidebar {
        position: relative; width: 100%;
        display: flex; flex-wrap: wrap; align-items: center;
    }
    .sidebar-header { padding: 12px 16px; }
    .sidebar-nav { display: flex; flex-wrap: wrap; padding: 8px; gap: 4px; }
    .sidebar-nav a { padding: 8px 12px; font-size: .8125rem; border-left: none; border-radius: 4px; }
    .admin-main { margin-left: 0; padding: 16px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    
    .form-row { flex-direction: column; }
    .form-row .form-group { min-width: 100%; }
    
    .steps-bar { gap: 4px; }
    .step-label { display: none; }
    .step-line { width: 30px; }
    
    .detail-row { flex-direction: column; gap: 2px; }
    .fee-option-header { flex-direction: column; align-items: flex-start; gap: 4px; }
    
    .receipt-row { flex-direction: column; gap: 2px; }
    .receipt-value { text-align: left; }
    
    .confirmation-card { margin: 20px; padding: 24px; }
    .fee-type-item { flex-direction: column; }
}

@media (max-width: 480px) {
    .container { padding: 0 12px; }
    .payment-header { padding: 24px 0; }
    .payment-header h1 { font-size: 1.25rem; }
    .stats-grid { grid-template-columns: 1fr; }
}
