/* ═══════════════════════════════════════════════════
   BN IntelHub — Certificate Verification Portal
   Premium Dark Theme with Glassmorphism
   ═══════════════════════════════════════════════════ */

/* ─── CSS Variables / Design Tokens ─────────────── */
:root {
    --bg-primary: #0a0a1a;
    --bg-secondary: #0f0f2a;
    --bg-card: rgba(15, 15, 42, 0.7);
    --bg-card-solid: #12122e;

    --text-primary: #f0f0ff;
    --text-secondary: #a0a0cc;
    --text-muted: #6b6b99;

    --accent-indigo: #6366f1;
    --accent-violet: #8b5cf6;
    --accent-purple: #a78bfa;
    --accent-cyan: #22d3ee;

    --success-green: #22c55e;
    --success-glow: rgba(34, 197, 94, 0.15);
    --success-border: rgba(34, 197, 94, 0.3);

    --error-red: #ef4444;
    --error-glow: rgba(239, 68, 68, 0.15);
    --error-border: rgba(239, 68, 68, 0.3);

    --border-subtle: rgba(99, 102, 241, 0.15);
    --border-medium: rgba(99, 102, 241, 0.25);

    --glass-bg: rgba(15, 15, 42, 0.6);
    --glass-border: rgba(139, 92, 246, 0.2);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;

    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Outfit', 'Inter', sans-serif;

    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ─── Reset & Base ──────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-primary);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

/* ─── Animated Background ───────────────────────── */
.bg-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.bg-particles::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(ellipse 600px 600px at 20% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 70%),
        radial-gradient(ellipse 500px 500px at 80% 80%, rgba(139, 92, 246, 0.06) 0%, transparent 70%),
        radial-gradient(ellipse 400px 400px at 50% 50%, rgba(34, 211, 238, 0.04) 0%, transparent 70%);
    animation: bgFloat 20s ease-in-out infinite;
}

@keyframes bgFloat {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(2%, 1%) rotate(1deg); }
    50% { transform: translate(-1%, 2%) rotate(-1deg); }
    75% { transform: translate(1%, -1%) rotate(0.5deg); }
}

.bg-particles::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
    top: 10%;
    right: -5%;
    animation: orbFloat 15s ease-in-out infinite;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-30px, 40px) scale(1.1); }
}

/* ─── Header ────────────────────────────────────── */
.header {
    position: relative;
    z-index: 10;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-subtle);
    backdrop-filter: blur(20px);
    background: rgba(10, 10, 26, 0.8);
}

.header-content {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    flex-shrink: 0;
    filter: drop-shadow(0 2px 8px rgba(99, 102, 241, 0.3));
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.logo-tagline {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.header-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 100px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid var(--border-subtle);
    color: var(--accent-purple);
    font-size: 0.75rem;
    font-weight: 500;
}

/* ─── Main ──────────────────────────────────────── */
.main {
    position: relative;
    z-index: 5;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

/* ─── Search Section ────────────────────────────── */
.search-section {
    width: 100%;
    max-width: 520px;
    animation: fadeSlideUp 0.6s var(--transition-smooth) both;
}

.search-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-2xl);
    padding: 48px 36px;
    backdrop-filter: blur(24px);
    box-shadow: var(--glass-shadow);
    text-align: center;
}

.search-icon-wrapper {
    margin-bottom: 24px;
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.85; }
}

.search-title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.search-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 32px;
    line-height: 1.5;
}

.search-input-wrapper {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.search-input {
    flex: 1;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--border-medium);
    background: rgba(10, 10, 26, 0.6);
    color: var(--text-primary);
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
    outline: none;
    transition: var(--transition-fast);
}

.search-input::placeholder {
    color: var(--text-muted);
    font-family: var(--font-primary);
    letter-spacing: 0;
}

.search-input:focus {
    border-color: var(--accent-indigo);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.search-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 24px;
    border-radius: var(--radius-md);
    border: none;
    background: linear-gradient(135deg, var(--accent-indigo), var(--accent-violet));
    color: white;
    font-family: var(--font-primary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    white-space: nowrap;
}

.search-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}

.search-btn:active {
    transform: translateY(0);
}

.search-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ─── Loading Section ───────────────────────────── */
.loading-section {
    text-align: center;
}

.loading-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-2xl);
    padding: 60px 40px;
    backdrop-filter: blur(24px);
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-subtle);
    border-top-color: var(--accent-indigo);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 0.8s linear infinite;
}

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

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

/* ─── Result Sections ───────────────────────────── */
.result-section {
    width: 100%;
    max-width: 800px;
    animation: fadeSlideUp 0.5s ease both;
}

.result-card {
    background: var(--glass-bg);
    border-radius: var(--radius-2xl);
    backdrop-filter: blur(24px);
    box-shadow: var(--glass-shadow);
    overflow: hidden;
}

.result-card.verified {
    border: 1px solid var(--success-border);
}

.result-card.invalid {
    border: 1px solid var(--error-border);
}

/* ─── Status Badge ──────────────────────────────── */
.status-badge {
    text-align: center;
    padding: 32px 30px 24px;
}

.verified-badge {
    background: linear-gradient(180deg, var(--success-glow) 0%, transparent 100%);
}

.invalid-badge {
    background: linear-gradient(180deg, var(--error-glow) 0%, transparent 100%);
}

/* Animated checkmark */
.checkmark-circle, .x-circle {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
}

.checkmark-svg, .x-circle svg {
    width: 64px;
    height: 64px;
}

.checkmark-circle-bg {
    stroke: var(--success-green);
    stroke-width: 2;
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    animation: strokeDraw 0.6s ease forwards;
}

.checkmark-check {
    stroke: var(--success-green);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: strokeDraw 0.4s 0.4s ease forwards;
}

.x-circle-bg {
    stroke: var(--error-red);
    stroke-width: 2;
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    animation: strokeDraw 0.6s ease forwards;
}

.x-line {
    stroke: var(--error-red);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 28;
    stroke-dashoffset: 28;
    animation: strokeDraw 0.3s 0.5s ease forwards;
}

@keyframes strokeDraw {
    to { stroke-dashoffset: 0; }
}

.status-text {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}

.verified-badge .status-text {
    color: var(--success-green);
}

.invalid-badge .status-text {
    color: var(--error-red);
}

.status-subtext {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* ─── Certificate Info Bar ──────────────────────── */
.cert-info-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    background: rgba(99, 102, 241, 0.06);
    border-top: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
}

.cert-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.cert-info-item strong {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    color: var(--accent-purple);
    letter-spacing: 0.03em;
}

.cert-info-item svg {
    color: var(--accent-purple);
    flex-shrink: 0;
}

/* ─── PDF Viewer ────────────────────────────────── */
.pdf-viewer-wrapper {
    padding: 20px;
    background: #0d0d20;
}

.pdf-viewer {
    width: 100%;
    height: 600px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: #fff;
}

/* ─── Card Footer ───────────────────────────────── */
.card-footer {
    padding: 20px 28px 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    border-top: 1px solid var(--border-subtle);
}

.footer-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 24px;
    border-radius: var(--radius-md);
    border: none;
    background: linear-gradient(135deg, var(--accent-indigo), var(--accent-violet));
    color: white;
    font-family: var(--font-primary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    text-decoration: none;
}

.download-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
    color: white;
}

.download-btn:active {
    transform: translateY(0);
}

.issued-by {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.issued-by strong {
    color: var(--text-secondary);
}

.verify-another-btn {
    padding: 10px 24px;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--border-medium);
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-primary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.verify-another-btn:hover {
    border-color: var(--accent-indigo);
    color: var(--accent-purple);
    background: rgba(99, 102, 241, 0.08);
}

/* ─── Invalid Section ───────────────────────────── */
.invalid-details {
    padding: 0 28px 16px;
}

.invalid-id {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: var(--error-glow);
    border: 1px solid var(--error-border);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.invalid-id code {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    color: var(--error-red);
    font-weight: 600;
    letter-spacing: 0.03em;
}

.invalid-tips {
    list-style: none;
    padding: 0;
}

.invalid-tips li {
    position: relative;
    padding: 8px 0 8px 24px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.5;
}

.invalid-tips li::before {
    content: '•';
    position: absolute;
    left: 8px;
    color: var(--text-muted);
}

/* ─── Footer ────────────────────────────────────── */
.footer {
    position: relative;
    z-index: 5;
    text-align: center;
    padding: 20px;
    border-top: 1px solid var(--border-subtle);
}

.footer-content p {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.footer-address {
    margin-top: 4px;
    font-size: 0.7rem !important;
}

/* ─── Utility Classes ───────────────────────────── */
.hidden {
    display: none !important;
}

/* ─── Animations ────────────────────────────────── */
@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* ─── Responsive ────────────────────────────────── */
@media (max-width: 600px) {
    .header-content {
        gap: 8px;
    }

    .header-badge span {
        display: none;
    }

    .header-badge {
        padding: 8px;
    }

    .search-card {
        padding: 36px 24px;
    }

    .search-title {
        font-size: 1.4rem;
    }

    .search-input-wrapper {
        flex-direction: column;
    }

    .search-btn {
        justify-content: center;
    }

    .pdf-viewer-wrapper {
        padding: 12px;
    }

    .pdf-viewer {
        height: 450px;
    }

    .status-text {
        font-size: 1.2rem;
    }

    .invalid-id {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }

    .card-footer {
        padding: 16px 20px 24px;
    }

    .footer-actions {
        flex-direction: column;
        width: 100%;
    }

    .download-btn, .verify-another-btn {
        width: 100%;
        justify-content: center;
        text-align: center;
    }
}

@media (max-width: 380px) {
    .search-card {
        padding: 28px 16px;
    }

    .logo-name {
        font-size: 0.95rem;
    }

    .pdf-viewer {
        height: 350px;
    }
}
