/* Atlas Prime COA Viewer — Frontend Styles */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Sans:wght@300;400;500&display=swap');

/* ---- Base wrap ---- */
.ap-coa-wrap {
    font-family: 'DM Sans', -apple-system, sans-serif;
    border-radius: 4px;
    overflow: hidden;
    margin: 0 auto;
}

/* ---- Dark theme ---- */
.ap-coa-dark {
    background: #0e0e0e;
    border: 1px solid rgba(255,255,255,0.07);
    box-shadow: 0 16px 48px rgba(0,0,0,0.5);
}
.ap-coa-light {
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.1);
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

/* ---- Header ---- */
.ap-coa-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    flex-wrap: wrap;
    gap: 12px;
}
.ap-coa-dark .ap-coa-header  { background: #0a0a0a; border-color: rgba(255,255,255,0.07); }
.ap-coa-light .ap-coa-header { background: #f5f5f5; border-color: rgba(0,0,0,0.08); }

.ap-coa-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ap-coa-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #c9a84c;
    box-shadow: 0 0 10px rgba(201,168,76,0.4);
    flex-shrink: 0;
    animation: ap-coa-pulse 1.8s ease-in-out infinite;
}
@keyframes ap-coa-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.3; }
}

.ap-coa-product {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 20px;
    letter-spacing: 0.1em;
    margin: 0 0 3px;
    line-height: 1;
}
.ap-coa-dark  .ap-coa-product { color: #f0ede8; }
.ap-coa-light .ap-coa-product { color: #1a1a1a; }

.ap-coa-batch {
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.ap-coa-dark  .ap-coa-batch { color: rgba(240,237,232,0.45); }
.ap-coa-light .ap-coa-batch { color: rgba(0,0,0,0.45); }

/* ---- Badges ---- */
.ap-coa-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.ap-coa-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 3px;
    font-size: 10px;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    font-weight: 500;
}
.ap-coa-badge-verified {
    background: rgba(34,197,94,0.1);
    border: 1px solid rgba(34,197,94,0.25);
    color: #86efac;
}
.ap-coa-badge-ruo {
    background: rgba(201,168,76,0.1);
    border: 1px solid rgba(201,168,76,0.25);
    color: #e8c97a;
}

/* ---- Viewer ---- */
.ap-coa-viewer-wrap {
    position: relative;
    width: 100%;
    background: #000;
}

.ap-coa-iframe {
    width: 100%;
    border: none;
    display: none; /* JS shows correct one */
}

/* ---- Fallback ---- */
.ap-coa-mobile-fallback {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
    min-height: 300px;
}
.ap-coa-dark  .ap-coa-mobile-fallback { background: #111; }
.ap-coa-light .ap-coa-mobile-fallback { background: #f9f9f9; }

.ap-coa-fallback-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.4;
}
.ap-coa-mobile-fallback p {
    font-size: 14px;
    margin-bottom: 20px;
}
.ap-coa-dark  .ap-coa-mobile-fallback p { color: rgba(240,237,232,0.6); }
.ap-coa-light .ap-coa-mobile-fallback p { color: rgba(0,0,0,0.6); }

.ap-coa-fallback-btn {
    display: inline-block;
    padding: 10px 24px;
    background: linear-gradient(135deg, #b8963a, #c9a84c);
    color: #0a0a0a;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-radius: 3px;
    text-decoration: none;
    transition: filter 0.2s;
}
.ap-coa-fallback-btn:hover { filter: brightness(1.1); color: #0a0a0a; }

/* ---- Actions (download button) ---- */
.ap-coa-actions {
    padding: 14px 24px;
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    justify-content: flex-end;
}
.ap-coa-dark  .ap-coa-actions { background: #0a0a0a; border-color: rgba(255,255,255,0.06); }
.ap-coa-light .ap-coa-actions { background: #f5f5f5; border-color: rgba(0,0,0,0.06); }

.ap-coa-download-btn {
    display: inline-flex;
    align-items: center;
    padding: 7px 18px;
    background: transparent;
    border: 1px solid rgba(201,168,76,0.35);
    border-radius: 3px;
    color: #c9a84c;
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s;
}
.ap-coa-download-btn:hover {
    background: rgba(201,168,76,0.1);
    border-color: rgba(201,168,76,0.6);
    color: #e8c97a;
}

/* ---- Freedom Diagnostics verification ---- */
.ap-coa-verify {
    padding: 20px 24px;
    border-top: 1px solid rgba(255,255,255,0.07);
}
.ap-coa-dark  .ap-coa-verify { background: #0f0f0f; border-color: rgba(255,255,255,0.07); }
.ap-coa-light .ap-coa-verify { background: #f9f9f9; border-color: rgba(0,0,0,0.07); }

.ap-coa-verify-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.ap-coa-verify-icon {
    font-size: 20px;
    opacity: 0.6;
    flex-shrink: 0;
}
.ap-coa-verify-label {
    font-size: 11px;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    font-weight: 500;
    margin: 0 0 3px;
}
.ap-coa-dark  .ap-coa-verify-label { color: #c9a84c; }
.ap-coa-light .ap-coa-verify-label { color: #8a6a1e; }

.ap-coa-verify-desc {
    font-size: 12.5px;
    margin: 0;
}
.ap-coa-dark  .ap-coa-verify-desc { color: rgba(240,237,232,0.5); }
.ap-coa-light .ap-coa-verify-desc { color: rgba(0,0,0,0.5); }

.ap-coa-verify-steps {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ap-coa-verify-step {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}
.ap-coa-dark  .ap-coa-verify-step { color: rgba(240,237,232,0.7); }
.ap-coa-light .ap-coa-verify-step { color: rgba(0,0,0,0.7); }

.ap-coa-step-num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 500;
    flex-shrink: 0;
    background: rgba(201,168,76,0.12);
    border: 1px solid rgba(201,168,76,0.3);
    color: #c9a84c;
}

.ap-coa-freedom-link {
    color: #c9a84c;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s;
}
.ap-coa-freedom-link:hover { color: #e8c97a; text-decoration: underline; }

.ap-coa-code-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 3px;
    flex-wrap: wrap;
}
.ap-coa-dark  .ap-coa-code-box { background: #171717; border: 1px solid rgba(255,255,255,0.07); }
.ap-coa-light .ap-coa-code-box { background: #efefef; border: 1px solid rgba(0,0,0,0.1); }

.ap-coa-code-box code {
    font-family: monospace;
    font-size: 16px;
    letter-spacing: 0.1em;
    font-weight: 600;
    flex: 1;
    background: none;
    border: none;
    padding: 0;
}
.ap-coa-dark  .ap-coa-code-box code { color: #e8c97a; }
.ap-coa-light .ap-coa-code-box code { color: #7a5c10; }

.ap-coa-copy-btn {
    padding: 6px 14px;
    border-radius: 3px;
    font-family: 'DM Sans', sans-serif;
    font-size: 11px;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    background: rgba(201,168,76,0.12);
    border: 1px solid rgba(201,168,76,0.3);
    color: #c9a84c;
}
.ap-coa-copy-btn:hover {
    background: rgba(201,168,76,0.25);
    border-color: rgba(201,168,76,0.5);
    color: #e8c97a;
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
    .ap-coa-header { padding: 14px 16px; }
    .ap-coa-body   { padding: 16px; }
    .ap-coa-verify { padding: 16px; }
    .ap-coa-product { font-size: 17px; }
    .ap-coa-actions { justify-content: center; }
    .ap-coa-code-box { flex-direction: column; align-items: flex-start; gap: 8px; }
    .ap-coa-copy-btn { width: 100%; text-align: center; }
}
