:root {
    --primary: #025a4b;
    --primary-dark: #01483c;
    --primary-light: #e8f3f0;
    --accent: #fecc4e;
    --body-bg: #f5edcf;
    --white: #ffffff;
    --text-dark: #1f2937;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --success: #198754;
    --shadow-sm: 0 4px 15px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.10);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.14);
}

/* =========================
   GLOBAL
========================= */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--body-bg);
    color: var(--text-dark);
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    flex-direction: column;
}

/* =========================
   NAVBAR
========================= */

.navbar {
    background: var(--primary);
    min-height: 70px;
    padding: 12px 15px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.12);
    position: relative;
    z-index: 10;
}

.navbar-brand {
    color: var(--white) !important;
    font-weight: 700;
    font-size: 1.35rem;
    line-height: 1.4;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.navbar-brand i {
    color: var(--accent);
    font-size: 1.25rem;
}

/* =========================
   MAIN CONTAINER
========================= */

.container {
    width: 100%;
}

body > .container {
    flex: 1;
}

.search-container {
    background: var(--white);
    border-radius: 22px;
    padding: 40px;
    margin-top: 35px;
    margin-bottom: 35px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

/* =========================
   SEARCH HEADER
========================= */

.search-header {
    text-align: center;
    margin-bottom: 35px;
}

.search-header h1 {
    color: var(--text-dark);
    font-size: clamp(1.7rem, 3vw, 2.35rem);
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.25;
}

.search-header h1 i {
    color: var(--primary);
}

.search-header p {
    color: var(--text-muted);
    font-size: 1rem;
    margin: 0 auto;
    max-width: 650px;
    line-height: 1.6;
}

/* =========================
   SEARCH FORM
========================= */

.search-form {
    background: #f8fafb;
    border: 1px solid #edf0f1;
    padding: 25px;
    border-radius: 18px;
    margin-bottom: 30px;
}

.search-input-group {
    display: flex;
    align-items: stretch;
    gap: 12px;
}

.search-input {
    flex: 1;
    width: 100%;
    min-width: 0;
    height: 56px;
    padding: 0 22px;
    border: 2px solid var(--border);
    border-radius: 50px;
    background: var(--white);
    color: var(--text-dark);
    font-size: 1rem;
    transition: all 0.25s ease;
}

.search-input::placeholder {
    color: #9ca3af;
}

.search-input:hover {
    border-color: #cbd5d1;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(2, 90, 75, 0.10);
}

.search-btn {
    flex-shrink: 0;
    height: 56px;
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 0 32px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.search-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(2, 90, 75, 0.25);
}

.search-btn:active {
    transform: translateY(0);
}

.search-btn i {
    font-size: 0.95rem;
}

/* =========================
   SEARCH RESULT MESSAGE
========================= */

.alert {
    border-radius: 12px;
    border: none;
    padding: 14px 18px;
    font-size: 0.95rem;
}

.alert-info {
    background: var(--primary-light);
    color: var(--primary-dark);
}

/* =========================
   RESULT CARD
========================= */

.result-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 25px;
    margin-bottom: 18px;
    box-shadow: var(--shadow-sm);
    transition: all 0.25s ease;
}

.result-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: rgba(2, 90, 75, 0.20);
}

.participant-info {
    padding-right: 15px;
}

.participant-name {
    color: var(--text-dark);
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 14px;
    word-break: break-word;
}

.participant-name i {
    color: var(--primary) !important;
}

.participant-detail {
    color: var(--text-muted);
    margin-bottom: 7px;
    font-size: 0.95rem;
    line-height: 1.5;
    word-break: break-word;
}

.participant-detail i {
    width: 24px;
    color: var(--primary);
    text-align: center;
    margin-right: 5px;
}

.participant-detail strong {
    color: var(--text-dark);
}

/* =========================
   CERTIFICATE BADGE
========================= */

.certificate-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #e9f7ef;
    color: var(--success);
    border: 1px solid #c9ead7;
    padding: 7px 13px;
    border-radius: 30px;
    font-size: 0.82rem;
    font-weight: 600;
    margin-top: 8px;
}

.certificate-badge i {
    font-size: 0.8rem;
}

/* =========================
   DOWNLOAD BUTTON
========================= */

.download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    background: var(--primary);
    color: var(--white) !important;
    border: none;
    padding: 12px 24px;
    min-height: 48px;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.25s ease;
    box-shadow: 0 4px 12px rgba(2, 90, 75, 0.15);
}

.download-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(2, 90, 75, 0.25);
    color: var(--white) !important;
}

.download-btn:active {
    transform: translateY(0);
}

.result-card .text-center .small {
    color: #9ca3af !important;
}

/* =========================
   NO RESULTS
========================= */

.no-results {
    text-align: center;
    padding: 55px 25px;
    background: #f8fafb;
    border: 1px solid #edf0f1;
    border-radius: 18px;
}

.no-results i {
    font-size: 3.5rem;
    color: #c7ced0;
    margin-bottom: 20px;
}

.no-results h3 {
    color: var(--text-dark);
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.no-results p {
    font-size: 0.95rem;
}

/* =========================
   INITIAL SEARCH STATE
========================= */

#resultsContainer > .text-center {
    padding: 45px 20px !important;
}

#resultsContainer > .text-center i {
    color: #b9c2c4 !important;
    font-size: 2.8rem !important;
}

#resultsContainer > .text-center h4 {
    color: var(--text-muted) !important;
    font-size: 1.15rem;
}

/* =========================
   LOADING
========================= */

.loading-spinner {
    display: none;
    text-align: center;
    padding: 45px 20px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e5ebe9;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

.loading-spinner p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* =========================
   FOOTER
========================= */

footer {
    color: #66716f !important;
    font-size: 0.85rem;
    padding: 20px 15px !important;
}

footer p {
    margin: 0;
}

/* =========================
   TABLET
========================= */

@media (max-width: 991.98px) {

    .search-container {
        padding: 30px;
        margin-top: 25px;
        margin-bottom: 25px;
    }

    .search-header {
        margin-bottom: 28px;
    }

    .result-card {
        padding: 22px;
    }

    .participant-name {
        font-size: 1.25rem;
    }
}

/* =========================
   MOBILE
========================= */

@media (max-width: 767.98px) {

    .navbar {
        min-height: 62px;
        padding: 10px 12px;
    }

    .navbar-brand {
        font-size: 1.05rem;
        line-height: 1.35;
        width: 100%;
        text-align: center;
    }

    .navbar-brand i {
        font-size: 1rem;
        margin-right: 6px !important;
    }

    .search-container {
        border-radius: 16px;
        padding: 20px 15px;
        margin-top: 18px;
        margin-bottom: 18px;
    }

    .search-header {
        margin-bottom: 24px;
    }

    .search-header h1 {
        font-size: 1.55rem;
        margin-bottom: 8px;
    }

    .search-header h1 i {
        margin-right: 6px !important;
    }

    .search-header p {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    .search-form {
        padding: 16px;
        border-radius: 14px;
        margin-bottom: 22px;
    }

    /*
       Mobile:
       Input and button become full-width.
    */
    .search-input-group {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .search-input {
        height: 52px;
        font-size: 0.95rem;
        padding: 0 18px;
        border-radius: 14px;
    }

    .search-btn {
        width: 100%;
        height: 52px;
        border-radius: 14px;
        padding: 0 20px;
        font-size: 0.95rem;
    }

    .result-card {
        padding: 18px;
        border-radius: 15px;
        margin-bottom: 15px;
    }

    .participant-info {
        padding-right: 0;
        margin-bottom: 18px;
    }

    .participant-name {
        font-size: 1.15rem;
        margin-bottom: 12px;
    }

    .participant-detail {
        font-size: 0.9rem;
        margin-bottom: 8px;
    }

    .participant-detail i {
        width: 21px;
    }

    .certificate-badge {
        font-size: 0.78rem;
        padding: 6px 11px;
    }

    /*
       Download section moves below participant details.
    */
    .result-card .col-md-4 {
        border-top: 1px solid #edf0f1;
        padding-top: 17px;
    }

    .download-btn {
        width: 100%;
        min-height: 48px;
        font-size: 0.9rem;
    }

    .result-card .text-center .small {
        font-size: 0.75rem;
        margin-bottom: 0;
    }

    .alert {
        font-size: 0.88rem;
        padding: 12px 14px;
    }

    .no-results {
        padding: 40px 18px;
    }

    .no-results i {
        font-size: 3rem;
    }

    footer {
        font-size: 0.78rem;
        padding: 15px 10px !important;
    }
}

/* =========================
   SMALL MOBILE
========================= */

@media (max-width: 400px) {

    .navbar-brand {
        font-size: 0.92rem;
    }

    .search-container {
        padding: 16px 12px;
    }

    .search-header h1 {
        font-size: 1.35rem;
    }

    .search-header p {
        font-size: 0.84rem;
    }

    .search-form {
        padding: 12px;
    }

    .search-input {
        font-size: 0.88rem;
    }

    .result-card {
        padding: 15px;
    }

    .participant-name {
        font-size: 1.05rem;
    }

    .participant-detail {
        font-size: 0.84rem;
    }
}

/* =========================
   ACCESSIBILITY
========================= */

button:focus-visible,
a:focus-visible,
input:focus-visible {
    outline: 3px solid rgba(2, 90, 75, 0.25);
    outline-offset: 2px;
}

/* =========================
   REDUCED MOTION
========================= */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}