﻿/* =========================================================
   Bedaya — Exam Checkout
   File: wwwroot/css/examcheckout.css
   ========================================================= */

:root {
    --ec-bg: #f8fafc; /* slate-50 */
    --ec-card: #ffffff;
    --ec-text: #0f172a; /* slate-900 */
    --ec-muted: #64748b; /* slate-500 */
    --ec-border: #e2e8f0; /* slate-200 */
    --ec-primary: #6366f1; /* indigo-500 */
    --ec-primary-600: #4f46e5;
    --ec-accent: #8b5cf6; /* violet-500 */
    --ec-success: #10b981;
    --ec-warning: #f59e0b;
    --ec-danger: #ef4444;
    --ec-shadow: 0 10px 30px rgba(2,6,23,.08);
    --ec-radius: 16px;
}

/* Page scaffolding helpers (optional) */
.browse-exams-page,
body {
    background: var(--ec-bg);
    color: var(--ec-text);
}

/* Loading / Empty */
.loading-container,
.empty-state {
    background: var(--ec-card);
    border: 1px solid var(--ec-border);
    border-radius: var(--ec-radius);
    padding: 22px;
    text-align: center;
    box-shadow: var(--ec-shadow);
    margin: 10px 0;
}

    .loading-container p,
    .empty-state h3,
    .empty-state p {
        margin: 8px 0 0;
        color: var(--ec-muted);
    }

    .empty-state i {
        font-size: 28px;
        color: var(--ec-primary);
    }

/* Main card */
.checkout-card {
    background: var(--ec-card);
    border: 1px solid var(--ec-border);
    border-radius: 22px;
    box-shadow: var(--ec-shadow);
    padding: clamp(18px, 2.5vw, 28px);
    max-width: 820px;
    margin: 16px auto 32px;
}

    .checkout-card h2 {
        margin: 0 0 6px;
        font-size: clamp(20px, 2.6vw, 28px);
        font-weight: 800;
    }

    .checkout-card p {
        margin: 6px 0 0;
        color: var(--ec-muted);
        line-height: 1.6;
    }

/* Price box */
.price-box {
    margin: 16px 0 10px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #f8fafc;
    padding: 10px 14px;
    border: 1px solid var(--ec-border);
    border-radius: 12px;
}

    .price-box span {
        color: var(--ec-muted);
        font-weight: 700;
    }

    .price-box strong {
        font-size: 18px;
        font-weight: 900;
        color: var(--ec-primary-600);
    }

/* Bank info */
.bank-info {
    margin: 18px 0 10px;
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    border: 1px solid var(--ec-border);
    border-radius: 14px;
    padding: 16px;
}

    .bank-info h4 {
        margin: 0 0 10px;
        font-size: 16px;
        font-weight: 800;
    }

    .bank-info small {
        display: block;
        margin-top: 8px;
        color: var(--ec-muted);
    }

.bank-card {
    border: 1px dashed #cbd5e1;
    background: #fff;
    border-radius: 12px;
    padding: 12px 14px;
    margin: 10px 0;
}

    .bank-card ul {
        margin: 0;
        padding: 0;
        list-style: none;
        display: grid;
        gap: 6px;
    }

    .bank-card li {
        color: var(--ec-text);
    }

    .bank-card strong {
        font-weight: 800;
    }

/* Form layout */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 12px;
}

.full-width {
    grid-column: 1 / -1;
}

.form-group {
    display: grid;
    gap: 8px;
}

    .form-group label {
        font-weight: 800;
        font-size: 14px;
    }

.form-control,
input[type="text"],
input[type="email"],
input[type="number"],
select,
textarea {
    background: #fff;
    border: 1px solid var(--ec-border);
    border-radius: 12px;
    padding: 12px 14px;
    outline: none;
    color: var(--ec-text);
    transition: .15s ease-in-out;
    box-shadow: 0 1px 0 rgba(15,23,42,.02);
    font-family: inherit;
}

    .form-control:focus,
    input[type="text"]:focus,
    input[type="email"]:focus,
    input[type="number"]:focus,
    select:focus,
    textarea:focus {
        border-color: #c7d2fe;
        box-shadow: 0 0 0 3px rgba(99,102,241,.12);
    }

.hint {
    color: var(--ec-muted);
    font-size: .92rem;
}

/* File input with mini loader */
.file-input-wrap {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.spinner-sm {
    width: 16px;
    height: 16px;
    border: 2px solid #e5e7eb;
    border-top-color: var(--ec-primary);
    border-radius: 50%;
    display: inline-block;
    animation: ec-spin .8s linear infinite;
}

.muted {
    color: var(--ec-muted);
    font-size: .9rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 12px;
    padding: 12px 16px;
    border: 1px solid transparent;
    cursor: pointer;
    user-select: none;
    font-weight: 800;
    transition: .15s ease-in-out;
    text-decoration: none;
}

    .btn:disabled {
        opacity: .6;
        cursor: not-allowed;
    }

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--ec-primary), var(--ec-accent));
    color: #fff;
    box-shadow: var(--ec-shadow);
}

    .btn-primary:hover {
        filter: brightness(1.05);
        transform: translateY(-1px);
    }

.btn-accent {
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    color: #fff;
    box-shadow: var(--ec-shadow);
}

    .btn-accent:hover {
        filter: brightness(1.05);
        transform: translateY(-1px);
    }

.btn-secondary {
    background: #f1f5f9;
    border: 1px solid var(--ec-border);
    color: var(--ec-text);
}

    .btn-secondary:hover {
        background: #e9eef6;
    }

.checkout-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}

/* Alerts */
.alert-info {
    margin-top: 12px;
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    padding: 12px 14px;
    font-weight: 700;
}

/* Overlay upload progress */
.ec-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,.55);
    backdrop-filter: blur(3px);
    display: grid;
    place-items: center;
    z-index: 1200;
}

.ec-overlay-card {
    width: min(92vw, 380px);
    background: var(--ec-card);
    border: 1px solid var(--ec-border);
    border-radius: 16px;
    box-shadow: var(--ec-shadow);
    padding: 18px;
    text-align: center;
}

    .ec-overlay-card p {
        margin: 8px 0 0;
        color: var(--ec-muted);
    }

.ec-progress {
    height: 10px;
    background: #eef2ff;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
    margin: 12px 0 8px;
}

.ec-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--ec-primary), var(--ec-accent));
    width: 0%;
    transition: width .15s linear;
}

.ec-progress-text {
    font-weight: 800;
    color: var(--ec-primary-600);
}

/* Spinners */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #e5e7eb;
    border-top-color: var(--ec-primary);
    border-radius: 50%;
    display: inline-block;
    animation: ec-spin .8s linear infinite;
}

@keyframes ec-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Accessibility & focus visible */
.btn:focus-visible,
.form-control:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(99,102,241,.35);
    outline-offset: 2px;
}

/* Responsive */
@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .checkout-card {
        padding: 18px;
        border-radius: 18px;
    }

    .price-box strong {
        font-size: 16px;
    }
}

/* RTL support */
:root[dir="rtl"] .price-box {
    direction: rtl;
}

:root[dir="rtl"] .bank-card ul {
    direction: rtl;
}

:root[dir="rtl"] .checkout-actions {
    flex-direction: row-reverse;
    gap: 10px;
}

:root[dir="rtl"] .alert-info {
    text-align: right;
}
/* =========================================================
   Bedaya — Checkout Pending / Success Block
   (Append to examcheckout.css)
   ========================================================= */

/* بطاقة النجاح/قيد المراجعة */
.checkout-card.success {
    position: relative;
    border: 1px solid var(--ec-border);
    border-radius: 22px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    box-shadow: var(--ec-shadow);
    padding: clamp(18px, 2.5vw, 28px);
    overflow: hidden;
}

    /* خط زخرفي علوي لطيف */
    .checkout-card.success::before {
        content: "";
        position: absolute;
        inset: 0;
        height: 6px;
        background: linear-gradient(90deg, var(--ec-success), var(--ec-primary), var(--ec-accent));
        opacity: .85;
    }

/* أيقونة النجاح */
.success-icon {
    width: 64px;
    height: 64px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: #ecfdf5; /* أخضر فاتح */
    border: 1px solid #d1fae5;
    color: var(--ec-success);
    margin-bottom: 12px;
    box-shadow: 0 8px 24px rgba(16,185,129,.18);
}

    .success-icon i {
        font-size: 30px;
        animation: ec-pop .45s ease-out;
    }

@keyframes ec-pop {
    0% {
        transform: scale(.6);
        opacity: .2;
    }

    70% {
        transform: scale(1.08);
        opacity: 1;
    }

    100% {
        transform: scale(1);
    }
}

/* العنوان والنص */
.checkout-card.success h2 {
    margin: 8px 0 6px;
    font-size: clamp(20px, 2.4vw, 26px);
    font-weight: 900;
}

.checkout-card.success .lead {
    margin: 6px 0 14px;
    color: var(--ec-muted);
    line-height: 1.7;
    font-size: 1.03rem;
}

/* الملخص (امتحان، رقم الطلب، المبلغ، …) */
.pending-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 16px;
    background: #f8fafc;
    border: 1px dashed var(--ec-border);
    border-radius: 14px;
    padding: 12px 14px;
    margin: 10px 0 14px;
}

    .pending-summary > div {
        padding: 6px 0;
        color: var(--ec-text);
        word-break: break-word;
    }

    .pending-summary strong {
        font-weight: 900;
        color: #0b1220;
    }

    .pending-summary a {
        color: var(--ec-primary-600);
        font-weight: 800;
        text-decoration: none;
        border-bottom: 1px dashed #c7d2fe;
        padding-bottom: 1px;
    }

        .pending-summary a:hover {
            text-decoration: underline;
        }

/* قائمة الملاحظات */
.pending-help {
    margin: 8px 0 16px;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 8px;
    color: var(--ec-muted);
}

    .pending-help li {
        position: relative;
        padding-inline-start: 28px;
        line-height: 1.6;
    }

        .pending-help li::before {
            content: "\f058"; /* fa-check-circle */
            font-family: "Font Awesome 5 Free";
            font-weight: 900;
            position: absolute;
            inset-inline-start: 0;
            top: 2px;
            color: var(--ec-primary);
            opacity: .85;
        }

/* أزرار الإجراءات */
.checkout-card.success .checkout-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

/* زر إطار فقط (لم نُعرّفه سابقًا) */
.btn-outline {
    background: #fff;
    color: var(--ec-primary-600);
    border: 1px solid #c7d2fe;
}

    .btn-outline:hover {
        background: #eef2ff;
    }

/* صيغ صغيرة للشاشات */
@media (max-width: 720px) {
    .pending-summary {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

/* دعم RTL */
:root[dir="rtl"] .pending-help li {
    padding-inline-start: 0;
    padding-inline-end: 28px;
}

    :root[dir="rtl"] .pending-help li::before {
        inset-inline-start: auto;
        inset-inline-end: 0;
    }
