/* ===== Certificate Verification Page ===== */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    color: var(--dark-text);
    background-color: #F3F8F5;
    line-height: 1.6;
}

main {
    opacity: 0;
    animation: fadeIn 0.5s ease forwards;
}

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

h1, h2, h3, h4 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== Hero Section ===== */
.cert-hero {
    padding-top: 140px;
    padding-bottom: 60px;
    background: linear-gradient(135deg, #1a4731 0%, #2C7A4B 50%, #1e5e3a 100%);
    color: var(--white);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cert-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.cert-hero h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 12px;
    position: relative;
}

.cert-hero p {
    font-size: 1.15rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.hero-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.85;
    display: block;
    position: relative;
}

/* ===== Search Section ===== */
.cert-search-section {
    padding: 50px 0 40px;
    background-color: #F3F8F5;
}

.search-card {
    max-width: 720px;
    margin: 0 auto;
    background: var(--white);
    border-radius: 16px;
    padding: 32px 36px;
    box-shadow: 0 8px 30px rgba(44, 122, 75, 0.08);
    border: 1px solid rgba(44, 122, 75, 0.08);
}

.search-card-title {
    font-size: 1.1rem;
    color: var(--earth-green);
    margin-bottom: 6px;
}

.search-card-sub {
    font-size: 0.9rem;
    color: var(--light-text);
    margin-bottom: 20px;
}

.search-form {
    display: flex;
    gap: 14px;
    align-items: stretch;
}

.search-input-wrap {
    flex: 1;
    position: relative;
}

.search-input-wrap .icon-search {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #9CA3AF;
    font-size: 15px;
    pointer-events: none;
    transition: color 0.3s;
}

#certInput {
    width: 100%;
    background: #F9FAFB;
    border: 2px solid #E5E7EB;
    border-radius: 12px;
    padding: 14px 18px 14px 44px;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    color: var(--dark-text);
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

#certInput::placeholder {
    color: #9CA3AF;
}

#certInput:hover {
    border-color: #D1D5DB;
}

#certInput:focus {
    border-color: var(--earth-green);
    box-shadow: 0 0 0 4px rgba(44, 122, 75, 0.12);
    background: var(--white);
}

#certInput:focus ~ .icon-search {
    color: var(--earth-green);
}

#certInput.shake {
    animation: shakeInput 0.5s ease;
}

@keyframes shakeInput {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-5px); }
    80% { transform: translateX(5px); }
}

.verify-btn {
    background-color: var(--earth-green);
    color: var(--white);
    border: none;
    border-radius: 12px;
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 14px rgba(44, 122, 75, 0.25);
    display: flex;
    align-items: center;
    gap: 8px;
}

.verify-btn:hover {
    background-color: #1f5a38;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(44, 122, 75, 0.35);
}

.verify-btn.loading {
    pointer-events: none;
    opacity: 0.85;
}

.verify-btn .btn-text {
    display: flex;
    align-items: center;
    gap: 8px;
    transition: opacity 0.3s;
}

.verify-btn.loading .btn-text { opacity: 0; }

.verify-btn .spinner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.verify-btn.loading .spinner { opacity: 1; }

.spinner-circle {
    width: 22px;
    height: 22px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

/* ===== Sample IDs hint ===== */
.sample-ids {
    text-align: center;
    margin-top: 16px;
    font-size: 0.82rem;
    color: var(--light-text);
}

.sample-ids code {
    background: #EEF5F0;
    color: var(--earth-green);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    margin: 0 2px;
    cursor: pointer;
    transition: background 0.2s;
}

.sample-ids code:hover {
    background: #D4EDDA;
}

/* ===== Result Section ===== */
.cert-result-section {
    padding: 0 0 60px;
    background-color: #F3F8F5;
}

.result-area {
    max-width: 1000px;
    margin: 0 auto;
}

/* ===== Certificate Result Card ===== */
.cert-result-card {
    background: var(--white);
    border-radius: 20px;
    box-shadow: 0 12px 40px rgba(44, 122, 75, 0.1);
    border: 1px solid rgba(44, 122, 75, 0.06);
    overflow: hidden;
    animation: cardReveal 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: transform 0.3s, box-shadow 0.3s;
}

.cert-result-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 50px rgba(44, 122, 75, 0.14);
}

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

/* Card Header / Verified Banner */
.card-verified-banner {
    background: linear-gradient(135deg, #2C7A4B, #38A169);
    padding: 18px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--white);
}

.banner-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.banner-left img {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: 2px solid rgba(255,255,255,0.3);
}

.banner-org-name {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
}

.banner-org-sub {
    font-size: 0.78rem;
    opacity: 0.85;
}

.verified-badge {
    display: flex;
    align-items: center;
    gap: 7px;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.35);
    border-radius: 30px;
    padding: 7px 18px;
    font-weight: 600;
    font-size: 0.85rem;
    backdrop-filter: blur(8px);
}

.verified-badge i {
    font-size: 14px;
}

/* Card Body */
.card-body-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

/* Certificate Image Side */
.cert-image-side {
    padding: 28px;
    background: #FAFCFB;
    border-right: 1px solid #E8F0EB;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.cert-image-label {
    font-size: 0.75rem;
    color: var(--light-text);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
    margin-bottom: 14px;
}

.cert-image-wrap {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 24px rgba(0,0,0,0.1);
    border: 1px solid #E5E7EB;
    position: relative;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.cert-image-wrap:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 32px rgba(0,0,0,0.15);
}

.cert-image-wrap img {
    width: 100%;
    height: auto;
    display: block;
}

.cert-image-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    gap: 8px;
}

.cert-image-wrap:hover .cert-image-overlay {
    opacity: 1;
}

.cert-download-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    color: var(--earth-green);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    padding: 8px 18px;
    border: 2px solid var(--earth-green);
    border-radius: 10px;
    transition: all 0.3s;
}

.cert-download-link:hover {
    background: var(--earth-green);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(44,122,75,0.25);
}

/* Details Side */
.cert-details-side {
    padding: 28px 32px;
}

.details-heading {
    font-size: 1.1rem;
    color: var(--earth-green);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #E8F0EB;
    display: flex;
    align-items: center;
    gap: 8px;
}

.details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px 28px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-label {
    font-size: 0.72rem;
    color: var(--light-text);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.detail-label i {
    font-size: 11px;
    color: var(--earth-green);
}

.detail-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--dark-text);
}

/* Status badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ECFDF5;
    border: 1px solid #A7F3D0;
    color: #059669;
    border-radius: 20px;
    padding: 3px 12px;
    font-size: 0.82rem;
    font-weight: 600;
    width: fit-content;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #059669;
    animation: dotBlink 1.5s ease-in-out infinite;
}

@keyframes dotBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Skills */
.skills-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    grid-column: 1 / -1;
}

.skill-tag {
    background: #EEF5F0;
    color: var(--earth-green);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    border: 1px solid #D4EDDA;
    transition: all 0.2s;
}

.skill-tag:hover {
    background: #D4EDDA;
    transform: scale(1.05);
}

/* ===== Error Card ===== */
.error-card {
    max-width: 560px;
    margin: 0 auto;
    background: var(--white);
    border: 1px solid #FECACA;
    border-radius: 20px;
    padding: 48px 40px;
    text-align: center;
    animation: cardReveal 0.5s cubic-bezier(0.16,1,0.3,1) forwards;
    box-shadow: 0 8px 30px rgba(239, 68, 68, 0.06);
}

.error-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #FEF2F2;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 28px;
    color: #EF4444;
    border: 2px solid #FECACA;
}

.error-card h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #DC2626;
    margin-bottom: 8px;
}

.error-card p {
    color: var(--light-text);
    font-size: 0.95rem;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .cert-hero { padding-top: 120px; padding-bottom: 40px; }
    .cert-hero h1 { font-size: 1.8rem; }
    .cert-hero p { font-size: 1rem; }
    .search-card { padding: 24px 20px; }
    .search-form { flex-direction: column; }
    .verify-btn { width: 100%; justify-content: center; padding: 14px; }

    .card-body-content {
        grid-template-columns: 1fr;
    }

    .cert-image-side {
        border-right: none;
        border-bottom: 1px solid #E8F0EB;
        padding: 20px;
    }

    .cert-details-side { padding: 20px; }
    .details-grid { grid-template-columns: 1fr; gap: 14px; }

    .card-verified-banner {
        flex-direction: column;
        gap: 12px;
        text-align: center;
        padding: 16px 20px;
    }
}

@media (max-width: 480px) {
    .cert-hero h1 { font-size: 1.5rem; }
    .hero-icon { font-size: 2.2rem; }
    .search-card { margin: 0 8px; }
    .cert-result-card { margin: 0 8px; border-radius: 16px; }
}
