/* ═══════════════════════════════════════════
   AL-Arcade 100 Quest — Public Design System
   ═══════════════════════════════════════════ */

:root {
    --aq-primary: #6C63FF;
    --aq-primary-dark: #5A52D5;
    --aq-success: #10b981;
    --aq-success-bg: #ecfdf5;
    --aq-warn: #f59e0b;
    --aq-warn-bg: #fffbeb;
    --aq-danger: #ef4444;
    --aq-danger-bg: #fef2f2;
    --aq-text: #1e293b;
    --aq-text2: #64748b;
    --aq-bg: #f8fafc;
    --aq-card: #ffffff;
    --aq-border: #e2e8f0;
    --aq-r: 16px;
    --aq-shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --aq-shadow-lg: 0 20px 40px rgba(0,0,0,.1);
}

/* ─── Wrappers ─── */
.aq-comp-wrap,
.aq-dash,
.aq-upload-wrap {
    max-width: 900px;
    margin: 0 auto;
    padding: 30px 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans Arabic', sans-serif;
    color: var(--aq-text);
    line-height: 1.7;
}

/* ─── Notices ─── */
.aq-notice {
    padding: 16px 20px;
    border-radius: var(--aq-r);
    font-size: 15px;
    text-align: center;
}

.aq-notice a {
    color: var(--aq-primary);
    font-weight: 600;
}

.aq-notice-warn {
    background: var(--aq-warn-bg);
    color: #92400e;
    border: 1px solid #fde68a;
}

/* ─── Hero ─── */
.aq-comp-hero {
    background: linear-gradient(135deg, var(--aq-primary) 0%, var(--aq-primary-dark) 50%, #312e81 100%);
    border-radius: var(--aq-r);
    padding: 48px 40px;
    color: #fff;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: var(--aq-shadow-lg);
    margin-bottom: 28px;
}

.aq-comp-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 30% 20%, rgba(255,255,255,.1) 0%, transparent 60%);
    pointer-events: none;
}

.aq-hero-content {
    position: relative;
    z-index: 1;
}

.aq-hero-badge {
    display: inline-block;
    padding: 6px 18px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    background: rgba(255,255,255,.2);
    backdrop-filter: blur(10px);
    margin-bottom: 16px;
    letter-spacing: .5px;
}

.aq-hero-title {
    font-size: 32px;
    font-weight: 800;
    margin: 0 0 12px;
    line-height: 1.3;
}

.aq-hero-desc {
    font-size: 16px;
    opacity: .9;
    max-width: 600px;
    margin: 0 auto 20px;
    line-height: 1.8;
}

.aq-hero-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 14px;
    opacity: .85;
}

.aq-hero-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ─── Action Area ─── */
.aq-action-area {
    margin-bottom: 24px;
}

.aq-action-card {
    background: var(--aq-card);
    border-radius: var(--aq-r);
    padding: 32px;
    box-shadow: var(--aq-shadow);
    text-align: center;
    border: 2px solid var(--aq-border);
    transition: transform .3s, box-shadow .3s;
}

.aq-action-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--aq-shadow-lg);
}

.aq-action-card h3 {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 700;
}

.aq-action-card p {
    color: var(--aq-text2);
    margin: 0 0 20px;
    font-size: 15px;
}

.aq-ac-login { border-color: var(--aq-warn); }
.aq-ac-course { border-color: var(--aq-primary); }
.aq-ac-enrolled { border-color: var(--aq-success); }
.aq-ac-eligible { border-color: var(--aq-primary); }

.aq-ac-progress {
    margin: 16px 0;
}

.aq-prog-bar {
    width: 100%;
    background: #e2e8f0;
    border-radius: 20px;
    height: 12px;
    overflow: hidden;
}

.aq-prog-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--aq-primary), var(--aq-success));
    border-radius: 20px;
    transition: width .8s ease;
}

.aq-ac-btns {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ─── Buttons ─── */
.aq-btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    text-decoration: none;
    background: linear-gradient(135deg, var(--aq-primary), var(--aq-primary-dark));
    color: #fff;
    transition: all .3s;
    box-shadow: 0 4px 15px rgba(108,99,255,.3);
}

.aq-btn-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(108,99,255,.4);
    color: #fff;
}

.aq-btn-action-alt {
    background: var(--aq-card);
    color: var(--aq-primary);
    border: 2px solid var(--aq-primary);
    box-shadow: none;
}

.aq-btn-action-alt:hover {
    background: var(--aq-primary);
    color: #fff;
    box-shadow: 0 8px 25px rgba(108,99,255,.3);
}

.aq-btn-full {
    width: 100%;
}

.aq-req {
    color: var(--aq-danger);
}

/* ─── Overlay & Modal ─── */
.aq-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,.5);
    backdrop-filter: blur(4px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all .3s;
}

.aq-overlay.open {
    opacity: 1;
    visibility: visible;
}

.aq-enroll-modal {
    background: var(--aq-card);
    border-radius: var(--aq-r);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--aq-shadow-lg);
    transform: translateY(30px) scale(.95);
    transition: transform .3s;
}

.aq-overlay.open .aq-enroll-modal {
    transform: translateY(0) scale(1);
}

.aq-modal-x {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,.2);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
}

[dir="rtl"] .aq-modal-x {
    left: auto;
    right: 16px;
}

.aq-modal-x:hover {
    background: rgba(255,255,255,.4);
}

.aq-modal-header {
    background: linear-gradient(135deg, var(--aq-primary), var(--aq-primary-dark));
    color: #fff;
    padding: 32px 28px 24px;
    text-align: center;
    position: relative;
}

.aq-modal-header h2 {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 700;
}

.aq-modal-header p {
    margin: 0;
    opacity: .85;
    font-size: 14px;
}

.aq-step-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

.aq-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,.3);
    transition: all .3s;
}

.aq-dot.active {
    background: #fff;
    width: 28px;
    border-radius: 5px;
}

.aq-modal-step {
    display: none;
    padding: 24px 28px 28px;
}

.aq-modal-step.active {
    display: block;
}

/* ─── Form Groups ─── */
.aq-fg {
    margin-bottom: 16px;
}

.aq-fg label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--aq-text);
}

.aq-fg input,
.aq-fg select,
.aq-fg textarea {
    width: 100%;
    padding: 12px 16px;
    border-radius: 10px;
    border: 2px solid var(--aq-border);
    font-size: 15px;
    color: var(--aq-text);
    background: var(--aq-card);
    transition: border-color .2s, box-shadow .2s;
    box-sizing: border-box;
}

.aq-fg input:focus,
.aq-fg select:focus,
.aq-fg textarea:focus {
    outline: none;
    border-color: var(--aq-primary);
    box-shadow: 0 0 0 4px rgba(108,99,255,.1);
}

.aq-fg.has-error input,
.aq-fg.has-error select,
.aq-fg.has-error textarea {
    border-color: var(--aq-danger);
}

.aq-fg-error {
    color: var(--aq-danger);
    font-size: 13px;
    margin-top: 4px;
    display: none;
}

.aq-fg.has-error .aq-fg-error {
    display: block;
}

/* ─── Confirmation Card ─── */
.aq-confirm-card {
    background: var(--aq-bg);
    border-radius: var(--aq-r);
    padding: 20px;
    margin-bottom: 20px;
}

.aq-cs-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--aq-border);
    font-size: 14px;
}

.aq-cs-row:last-child { border-bottom: none; }

.aq-cs-label {
    color: var(--aq-text2);
    font-weight: 500;
}

.aq-cs-value {
    font-weight: 600;
    color: var(--aq-text);
}

.aq-confirm-info {
    margin-top: 16px;
    padding: 12px 16px;
    background: rgba(108,99,255,.05);
    border-radius: 10px;
    border: 1px solid rgba(108,99,255,.15);
}

.aq-ci-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    padding: 4px 0;
}

.aq-confirm-btns {
    display: flex;
    gap: 12px;
}

.aq-modal-msg {
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    margin-top: 12px;
    padding: 8px;
    border-radius: 8px;
    display: none;
}

.aq-modal-msg.aq-msg-ok { display: block; background: var(--aq-success-bg); color: #065f46; }
.aq-modal-msg.aq-msg-err { display: block; background: var(--aq-danger-bg); color: #991b1b; }

/* ─── Completion Banner ─── */
.aq-complete-banner {
    background: linear-gradient(135deg, var(--aq-success) 0%, #059669 100%);
    color: #fff;
    border-radius: var(--aq-r);
    padding: 32px;
    text-align: center;
    margin-bottom: 28px;
    box-shadow: 0 10px 30px rgba(16,185,129,.3);
}

.aq-complete-icon {
    font-size: 52px;
    margin-bottom: 8px;
}

.aq-complete-banner h2 {
    margin: 0 0 8px;
    font-size: 26px;
    font-weight: 800;
}

.aq-complete-banner p {
    margin: 0;
    opacity: .9;
    font-size: 15px;
}

/* ─── Dashboard Header ─── */
.aq-dash-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 12px;
}

.aq-dash-header h1 {
    font-size: 26px;
    font-weight: 800;
    margin: 0;
}

.aq-dash-comp {
    color: var(--aq-text2);
    font-size: 14px;
}

/* ─── Progress Circle ─── */
.aq-dash-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.aq-prog-main {
    text-align: center;
}

.aq-prog-circle {
    position: relative;
    width: 180px;
    height: 180px;
}

.aq-prog-circle svg {
    transform: rotate(-90deg);
}

.aq-prog-bg-circle {
    fill: none;
    stroke: #e2e8f0;
    stroke-width: 10;
}

.aq-prog-fg-circle {
    fill: none;
    stroke: var(--aq-primary);
    stroke-width: 10;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease;
}

.aq-prog-pct {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 36px;
    font-weight: 800;
    color: var(--aq-text);
}

.aq-prog-label {
    font-size: 14px;
    color: var(--aq-text2);
    margin-top: 8px;
}

/* ─── Stat Boxes ─── */
.aq-sb-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.aq-sb {
    background: var(--aq-card);
    border-radius: var(--aq-r);
    padding: 20px;
    text-align: center;
    box-shadow: var(--aq-shadow);
    transition: transform .3s;
}

.aq-sb:hover {
    transform: translateY(-3px);
}

.aq-sb-num {
    font-size: 32px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
}

.aq-sb-label {
    font-size: 13px;
    color: var(--aq-text2);
    font-weight: 500;
}

.aq-c-success .aq-sb-num { color: var(--aq-success); }
.aq-c-warn .aq-sb-num { color: var(--aq-warn); }
.aq-c-danger .aq-sb-num { color: var(--aq-danger); }
.aq-c-primary .aq-sb-num { color: var(--aq-primary); }

/* ─── Gallery Section ─── */
.aq-gal-section {
    margin-bottom: 32px;
}

.aq-gal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.aq-gal-header h2 {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
}

.aq-gal-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.aq-gal-filter {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    border: 2px solid var(--aq-border);
    background: var(--aq-card);
    color: var(--aq-text2);
    cursor: pointer;
    transition: all .2s;
}

.aq-gal-filter:hover,
.aq-gal-filter.active {
    background: var(--aq-primary);
    color: #fff;
    border-color: var(--aq-primary);
}

.aq-gal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.aq-gal-card {
    background: var(--aq-card);
    border-radius: var(--aq-r);
    overflow: hidden;
    box-shadow: var(--aq-shadow);
    transition: transform .3s, box-shadow .3s, opacity .3s;
    position: relative;
}

.aq-gal-card.hidden {
    display: none;
}

.aq-gal-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--aq-shadow-lg);
}

.aq-gal-card-img {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--aq-bg);
}

.aq-gal-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s;
}

.aq-gal-card:hover .aq-gal-card-img img {
    transform: scale(1.05);
}

.aq-gal-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    opacity: .3;
}

.aq-gal-status {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

[dir="rtl"] .aq-gal-status {
    left: auto;
    right: 10px;
}

.aq-gal-status.pending { background: var(--aq-warn-bg); color: #92400e; }
.aq-gal-status.approved { background: var(--aq-success-bg); color: #065f46; }
.aq-gal-status.rejected { background: var(--aq-danger-bg); color: #991b1b; }

.aq-gal-card-body {
    padding: 14px 16px;
}

.aq-gal-card-body h4 {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 700;
}

.aq-gal-sample {
    font-size: 13px;
    color: var(--aq-text2);
    margin-bottom: 6px;
}

.aq-gal-pts {
    font-size: 13px;
    color: var(--aq-primary);
    font-weight: 600;
}

.aq-gal-notes {
    font-size: 12px;
    color: var(--aq-text2);
    margin-top: 4px;
    font-style: italic;
}

.aq-gal-card-footer {
    padding: 0 16px 14px;
    display: flex;
    justify-content: flex-end;
}

.aq-gal-delete {
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    background: var(--aq-danger-bg);
    color: var(--aq-danger);
    border: none;
    cursor: pointer;
    transition: all .2s;
}

.aq-gal-delete:hover {
    background: var(--aq-danger);
    color: #fff;
}

/* ─── Dashboard Empty ─── */
.aq-dash-empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--aq-text2);
}

.aq-dash-empty h3 {
    margin: 12px 0 8px;
    font-size: 18px;
    color: var(--aq-text);
}

/* ─── Upload Page ─── */
.aq-upload-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.aq-upload-header h1 {
    font-size: 26px;
    font-weight: 800;
    margin: 0;
}

.aq-upload-back {
    color: var(--aq-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

/* ─── Dropzone ─── */
.aq-dropzone {
    border: 3px dashed var(--aq-border);
    border-radius: var(--aq-r);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all .3s;
    background: var(--aq-bg);
    margin-bottom: 24px;
    position: relative;
}

.aq-dropzone:hover,
.aq-dropzone.dragover {
    border-color: var(--aq-primary);
    background: rgba(108,99,255,.04);
}

.aq-dz-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: .6;
}

.aq-dz-content h3 {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 600;
}

.aq-dz-content p {
    margin: 0;
    color: var(--aq-text2);
    font-size: 14px;
}

.aq-dz-preview {
    display: none;
    max-width: 300px;
    margin: 0 auto;
    position: relative;
}

.aq-dz-preview img {
    width: 100%;
    border-radius: 12px;
    box-shadow: var(--aq-shadow);
}

.aq-dz-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--aq-danger);
    color: #fff;
    border: none;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .2s;
}

[dir="rtl"] .aq-dz-remove {
    right: auto;
    left: -8px;
}

.aq-dz-remove:hover {
    transform: scale(1.15);
}

/* ─── Upload Fields ─── */
.aq-upload-fields {
    background: var(--aq-card);
    border-radius: var(--aq-r);
    padding: 28px;
    box-shadow: var(--aq-shadow);
    margin-bottom: 24px;
}

/* ─── Upload Footer ─── */
.aq-upload-footer {
    text-align: center;
}

.aq-upload-msg {
    font-size: 15px;
    font-weight: 600;
    padding: 12px 20px;
    border-radius: var(--aq-r);
    margin-top: 16px;
    display: none;
}

.aq-upload-msg.success { display: block; background: var(--aq-success-bg); color: #065f46; }
.aq-upload-msg.error { display: block; background: var(--aq-danger-bg); color: #991b1b; }

.aq-auto-approved-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 600;
}

/* ─── Scroll Animations ─── */
.aq-anim-ready {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity .6s ease, transform .6s ease;
}

.aq-anim-in {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .aq-anim-ready {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
    .aq-comp-hero {
        padding: 32px 24px;
    }
    .aq-hero-title {
        font-size: 24px;
    }
    .aq-hero-desc {
        font-size: 14px;
    }
    .aq-dash-header {
        flex-direction: column;
        text-align: center;
    }
    .aq-dash-progress {
        flex-direction: column;
        gap: 24px;
    }
    .aq-sb-row {
        grid-template-columns: 1fr 1fr;
    }
    .aq-gal-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    .aq-confirm-btns {
        flex-direction: column;
    }
    .aq-action-card {
        padding: 24px 20px;
    }
}

@media (max-width: 480px) {
    .aq-comp-wrap,
    .aq-dash,
    .aq-upload-wrap {
        padding: 16px 12px;
    }
    .aq-gal-grid {
        grid-template-columns: 1fr;
    }
    .aq-sb-row {
        grid-template-columns: 1fr;
    }
    .aq-hero-meta {
        flex-direction: column;
        gap: 8px;
    }
}