/* Scoped styles for the certificate verification section on the main page.
   Extracted from certificate/css/main.css and scoped under .cert-verify
   to avoid conflicts with the main site's global styles. */

.cert-verify {
    --primary: #0E2247;
    --primary-light: #1A3668;
    --primary-dark: #07132B;
    --gold: #D4AF37;
    --gold-light: #F3E5AB;
    --gold-dark: #AA7C11;
    --white: #FFFFFF;
    --gray-100: #F8F9FA;
    --gray-200: #E9ECEF;
    --gray-400: #CED4DA;
    --gray-700: #495057;
    --gray-800: #343A40;
    --text-dark: #1E293B;
    --text-light: #F8FAFC;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 20px rgba(14, 34, 71, 0.08);
    --shadow-lg: 0 10px 30px rgba(14, 34, 71, 0.15);
    font-family: 'Be Vietnam Pro', sans-serif;
}

/* Hero Section */
.cert-verify .hero-section {
    position: relative;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-light) 100%);
    padding: 6rem 2rem;
    color: var(--white);
    text-align: center;
    overflow: hidden;
}

/* Decorative background shapes */
.cert-verify .hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -20%;
    width: 80%;
    height: 150%;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.08) 0%, transparent 60%);
    pointer-events: none;
}

.cert-verify .hero-section::after {
    content: '';
    position: absolute;
    bottom: -50%;
    right: -20%;
    width: 80%;
    height: 150%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.03) 0%, transparent 60%);
    pointer-events: none;
}

.cert-verify .hero-content {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.cert-verify .hero-subtitle {
    color: var(--gold);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 3px;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    animation: fadeInDown 0.8s ease;
}

.cert-verify .hero-title {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    letter-spacing: -0.5px;
    animation: fadeIn 1s ease;
}

.cert-verify .hero-desc {
    font-size: 1.1rem;
    color: var(--gray-400);
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    animation: fadeInUp 1.2s ease;
}

/* Search Box Container */
.cert-verify .search-container {
    max-width: 650px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 8px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    transition: var(--transition);
    animation: scaleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s backwards;
}

.cert-verify .search-container:focus-within {
    border-color: var(--gold);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
    transform: translateY(-2px);
}

.cert-verify .search-input-wrapper {
    position: relative;
    flex-grow: 1;
    display: flex;
    align-items: center;
    padding-left: 1.5rem;
}

.cert-verify .search-icon {
    color: var(--gold);
    font-size: 1.2rem;
    margin-right: 10px;
}

.cert-verify .search-input {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: var(--white);
    font-size: 1.1rem;
    font-family: inherit;
    padding: 12px 0;
}

.cert-verify .search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.cert-verify .search-btn {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    color: var(--primary-dark);
    border: none;
    outline: none;
    padding: 12px 30px;
    border-radius: 40px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 10px rgba(212, 175, 55, 0.2);
}

.cert-verify .search-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 15px rgba(212, 175, 55, 0.4);
    background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 100%);
}

.cert-verify .search-btn:active {
    transform: scale(0.98);
}

/* Feedback messages */
.cert-verify .feedback-msg {
    margin-top: 1.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    min-height: 24px;
    transition: var(--transition);
}

.cert-verify .feedback-msg.error {
    color: #FF6B6B;
}

.cert-verify .feedback-msg.success {
    color: #4DABF7;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .cert-verify .hero-title {
        font-size: 2rem;
    }

    .cert-verify .search-container {
        flex-direction: column;
        border-radius: 20px;
        padding: 10px;
        gap: 10px;
    }

    .cert-verify .search-input-wrapper {
        padding-left: 0.5rem;
        width: 100%;
    }

    .cert-verify .search-btn {
        width: 100%;
        border-radius: 12px;
    }
}

/* ── CERTIFICATE RESULT POPUP ── */
.cert-result-popup {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cert-result-popup.show {
    opacity: 1;
}

.cert-result-card {
    background: var(--white, #fff);
    border-radius: 16px;
    max-width: 480px;
    width: 100%;
    padding: 2.5rem 2rem 2rem;
    position: relative;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-top: 4px solid #22c55e;
}

.cert-result-popup.show .cert-result-card {
    transform: scale(1) translateY(0);
}

.cert-result-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--gray-100, #f1f5f9);
    color: var(--gray-700, #495057);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.cert-result-close:hover {
    background: var(--gray-200, #e9ecef);
}

.cert-result-icon {
    margin-bottom: 0.5rem;
}

.cert-result-logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 4px 15px rgba(14, 34, 71, 0.15);
}

.cert-result-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary, #0E2247);
    margin: 0 0 0.75rem;
}

.cert-result-code {
    font-family: 'Courier New', monospace;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--gold, #D4AF37);
    background: var(--cream, #fef9e7);
    padding: 8px 20px;
    border-radius: 8px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 1.25rem;
    letter-spacing: 1px;
}

.cert-result-medal {
    width: 24px;
    height: 24px;
}

.cert-result-link-label {
    font-size: 0.85rem;
    color: var(--gray-700, #495057);
    margin: 0 0 0.35rem;
}

.cert-result-url {
    font-size: 0.8rem;
    color: var(--gray-400, #ced4da);
    word-break: break-all;
    margin-bottom: 1.5rem;
    line-height: 1.4;
}

.cert-result-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.cert-result-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
}

.cert-result-btn-copy {
    background: var(--gray-100, #f1f5f9);
    color: var(--gray-800, #343a40);
    border: 1px solid var(--gray-200, #e9ecef);
}

.cert-result-btn-copy:hover {
    background: var(--gray-200, #e9ecef);
}

.cert-result-btn-open {
    background: linear-gradient(135deg, var(--primary, #0E2247) 0%, var(--primary-light, #1A3668) 100%);
    color: var(--white, #fff);
    box-shadow: 0 4px 12px rgba(14, 34, 71, 0.2);
}

.cert-result-btn-open:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(14, 34, 71, 0.3);
}

/* Responsive popup */
@media (max-width: 540px) {
    .cert-result-card {
        padding: 2rem 1.25rem 1.5rem;
    }

    .cert-result-code {
        font-size: 1.1rem;
    }

    .cert-result-actions {
        flex-direction: column;
    }

    .cert-result-btn {
        justify-content: center;
    }
}
