/* =============================================================================
   Oxford English Centre — Certificates Page
   Depends on app.css tokens (--ox-*). Loaded via @section('css') in blade.
   ============================================================================= */

/* ── PAGE WRAPPER ──────────────────────────────────────────────────────────── */
.cert-page {
    background: var(--ox-gray-50);
    min-height: 60vh;
}

/* ── SEARCH HERO ───────────────────────────────────────────────────────────── */
.cert-hero {
    background: var(--ox-gradient-deep);
    position: relative;
    overflow: hidden;
    padding: 80px 0 100px;
    text-align: center;
}

.cert-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 80% at 20% 50%, rgba(44,154,183,.18) 0%, transparent 70%),
        radial-gradient(ellipse 50% 70% at 80% 50%, rgba(247,183,51,.10) 0%, transparent 70%);
    pointer-events: none;
}

/* Decorative rings */
.cert-hero__ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.06);
    pointer-events: none;
    animation: cert-ring-pulse 6s ease-in-out infinite;
}
.cert-hero__ring:nth-child(1) { width: 400px; height: 400px; top: -120px; right: -80px; animation-delay: 0s; }
.cert-hero__ring:nth-child(2) { width: 260px; height: 260px; bottom: -60px; left: 5%; animation-delay: 2s; }
.cert-hero__ring:nth-child(3) { width: 160px; height: 160px; top: 20%; left: 12%; border-color: rgba(247,183,51,.1); animation-delay: 4s; }

@keyframes cert-ring-pulse {
    0%, 100% { transform: scale(1); opacity: .6; }
    50%       { transform: scale(1.06); opacity: 1; }
}

.cert-hero__inner {
    position: relative;
    z-index: 2;
    max-width: 640px;
    margin: 0 auto;
    padding: 0 20px;
}

.cert-hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(247,183,51,.15);
    border: 1px solid rgba(247,183,51,.35);
    color: var(--ox-accent);
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: 5px 16px;
    border-radius: 999px;
    margin-bottom: 20px;
}
.cert-hero__eyebrow .cert-dot {
    width: 6px; height: 6px;
    background: var(--ox-accent);
    border-radius: 50%;
    animation: cert-dot-blink 1.6s ease-in-out infinite;
}
@keyframes cert-dot-blink {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: .4; transform: scale(1.5); }
}

.cert-hero h1 {
    font-family: var(--ox-font-ar);
    font-size: clamp(1.9rem, 3.5vw, 2.8rem);
    font-weight: 900;
    color: #fff;
    line-height: 1.15;
    margin: 0 0 12px;
}
.cert-hero h1 em {
    font-style: normal;
    color: var(--ox-accent);
}
.cert-hero__sub {
    color: rgba(255,255,255,.6);
    font-size: .98rem;
    margin: 0 0 36px;
}

/* ── SEARCH BOX (hero bottom overlap) ─────────────────────────────────────── */
.cert-search-wrap {
    position: relative;
}

.cert-search-box {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 999px;
    box-shadow: 0 20px 60px -10px rgba(15,76,129,.35);
    overflow: hidden;
    border: 2px solid transparent;
    transition: border-color .25s ease, box-shadow .25s ease;
    padding: 6px 6px 6px 24px;
}
.cert-search-box:focus-within {
    border-color: var(--ox-primary);
    box-shadow: 0 0 0 4px rgba(15,76,129,.12), 0 20px 60px -10px rgba(15,76,129,.3);
}
.cert-search-box.is-error {
    border-color: var(--ox-danger);
    box-shadow: 0 0 0 4px rgba(239,68,68,.12);
    animation: cert-shake .45s cubic-bezier(.36,.07,.19,.97) both;
}
.cert-search-box.is-loading {
    border-color: var(--ox-secondary);
}

@keyframes cert-shake {
    10%, 90% { transform: translateX(-3px); }
    20%, 80% { transform: translateX(5px);  }
    30%, 50%, 70% { transform: translateX(-6px); }
    40%, 60% { transform: translateX(6px);  }
}

.cert-search-icon {
    color: var(--ox-primary);
    font-size: 1.15rem;
    margin-left: 10px;
    flex-shrink: 0;
    transition: color .2s;
}
.cert-search-box.is-loading .cert-search-icon { display: none; }

.cert-search-spinner {
    display: none;
    width: 18px; height: 18px;
    border: 2.5px solid rgba(15,76,129,.2);
    border-top-color: var(--ox-primary);
    border-radius: 50%;
    animation: cert-spin .7s linear infinite;
    margin-left: 10px;
    flex-shrink: 0;
}
.cert-search-box.is-loading .cert-search-spinner { display: block; }

@keyframes cert-spin {
    to { transform: rotate(360deg); }
}

.cert-search-input {
    flex: 1;
    border: none !important;
    outline: none !important;
    background: transparent !important;
    font-size: 1rem;
    font-family: var(--ox-font-ar);
    font-weight: 600;
    color: var(--ox-gray-800);
    padding: 10px 14px;
    box-shadow: none !important;
    min-width: 0;
}
.cert-search-input::placeholder { color: var(--ox-gray-400); font-weight: 400; }

.cert-search-btn {
    flex-shrink: 0;
    background: var(--ox-gradient-brand);
    color: #fff;
    border: none;
    border-radius: 999px;
    font-size: .92rem;
    font-weight: 700;
    padding: 12px 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: filter .2s ease, transform .15s ease;
    white-space: nowrap;
}
.cert-search-btn:hover  { filter: brightness(1.1); transform: scale(1.02); }
.cert-search-btn:active { transform: scale(.98); }
.cert-search-btn:disabled { filter: brightness(.7); cursor: not-allowed; transform: none; }

.cert-search-hint {
    margin-top: 14px;
    font-size: .8rem;
    color: rgba(255,255,255,.5);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.cert-search-hint i { color: rgba(255,255,255,.35); }

/* ── SECTION BELOW HERO ───────────────────────────────────────────────────── */
.cert-section {
    padding: 60px 0 80px;
}

/* ── NOT FOUND STATE ──────────────────────────────────────────────────────── */
.cert-not-found {
    display: none;
    text-align: center;
    padding: 64px 20px;
    animation: cert-fadein .45s ease both;
}

.cert-not-found__illustration {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, #fff1f0, #ffe4e4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 28px;
    position: relative;
}
.cert-not-found__illustration::after {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 2px dashed rgba(239,68,68,.25);
    animation: cert-ring-spin 12s linear infinite;
}
@keyframes cert-ring-spin { to { transform: rotate(360deg); } }

.cert-not-found__illustration i {
    font-size: 3rem;
    color: var(--ox-danger);
}

.cert-not-found__code {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff5f5;
    border: 1.5px solid #fecaca;
    color: #b91c1c;
    font-family: 'Courier New', monospace;
    font-size: .95rem;
    font-weight: 700;
    padding: 6px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
    letter-spacing: .04em;
}

.cert-not-found h3 {
    font-family: var(--ox-font-ar);
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--ox-gray-800);
    margin: 0 0 10px;
}
.cert-not-found p {
    color: var(--ox-gray-500);
    font-size: .92rem;
    max-width: 360px;
    margin: 0 auto 28px;
    line-height: 1.7;
}

.cert-not-found__tips {
    display: inline-flex;
    flex-direction: column;
    gap: 8px;
    text-align: start;
    background: #fff;
    border: 1px solid var(--ox-border);
    border-radius: 14px;
    padding: 18px 24px;
    margin-bottom: 28px;
    max-width: 360px;
}
.cert-not-found__tip {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: .84rem;
    color: var(--ox-gray-600);
}
.cert-not-found__tip i {
    color: var(--ox-warning);
    margin-top: 2px;
    flex-shrink: 0;
}

.cert-retry-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--ox-primary);
    color: #fff;
    border: none;
    border-radius: 999px;
    font-size: .9rem;
    font-weight: 700;
    padding: 11px 26px;
    cursor: pointer;
    transition: filter .2s, transform .15s;
}
.cert-retry-btn:hover  { filter: brightness(1.1); transform: translateY(-2px); }
.cert-retry-btn:active { transform: translateY(0); }

/* ── RESULT CARD ──────────────────────────────────────────────────────────── */
.cert-result {
    display: none;
    animation: cert-fadein .5s ease both;
}

@keyframes cert-fadein {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Student summary card */
.cert-student-card {
    background: #fff;
    border-radius: 20px;
    border: 1.5px solid var(--ox-border);
    box-shadow: var(--ox-shadow-sm);
    padding: 28px 28px 24px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.cert-student-card__avatar {
    width: 72px; height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--ox-primary-050);
    box-shadow: 0 0 0 4px rgba(15,76,129,.08);
    flex-shrink: 0;
}
.cert-student-card__avatar-fallback {
    width: 72px; height: 72px;
    border-radius: 50%;
    background: var(--ox-gradient-brand);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1.6rem; flex-shrink: 0;
    box-shadow: 0 0 0 4px rgba(15,76,129,.08);
}

.cert-student-card__info { flex: 1; min-width: 0; }
.cert-student-card__name {
    font-family: var(--ox-font-ar);
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--ox-primary-700);
    margin: 0 0 4px;
}
.cert-student-card__group {
    font-size: .85rem;
    color: var(--ox-gray-500);
    margin: 0 0 10px;
    display: flex; align-items: center; gap: 6px;
}
.cert-student-card__group i { color: var(--ox-secondary); }

.cert-stars { display: flex; gap: 4px; margin-bottom: 10px; }
.cert-stars i { color: var(--ox-accent); font-size: .95rem; }

.cert-badge-verified {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(34,197,94,.1);
    border: 1px solid rgba(34,197,94,.3);
    color: #15803d;
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 999px;
}
.cert-badge-verified i { font-size: .85rem; }

.cert-student-card__download {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--ox-gradient-brand);
    color: #fff;
    text-decoration: none;
    border-radius: 999px;
    font-size: .86rem;
    font-weight: 700;
    padding: 10px 22px;
    transition: filter .2s, transform .15s;
    flex-shrink: 0;
}
.cert-student-card__download:hover { filter: brightness(1.1); transform: translateY(-2px); color: #fff; }
.cert-student-card__download:active { transform: translateY(0); }

/* PDF frame wrapper */
.cert-pdf-wrap {
    background: #fff;
    border-radius: 20px;
    border: 1.5px solid var(--ox-border);
    overflow: hidden;
    box-shadow: var(--ox-shadow-sm);
}
.cert-pdf-wrap iframe {
    width: 100%;
    height: 1100px;
    display: block;
    border: none;
}

/* ── RESPONSIVE ───────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .cert-hero { padding: 60px 0 80px; }
    .cert-search-box { padding: 4px 4px 4px 16px; }
    .cert-search-btn { padding: 10px 18px; font-size: .82rem; }
    .cert-search-btn span { display: none; }
    .cert-pdf-wrap iframe { height: 600px; }
    .cert-student-card { gap: 14px; }
}
