/* ═══════════════════════════════════════════════════════════════
   CryptoVigilante — UI Improvements (v2)
   Load AFTER main.css and admin.css.
   Sharp, modern refinements site-wide.
   ═══════════════════════════════════════════════════════════════ */

/* ── 1. Typography refinements ──────────────────────────────── */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
    letter-spacing: -0.02em;
}

/* ── 2. Button improvements ─────────────────────────────────── */
.btn-primary,
.btn-secondary,
.btn-tertiary {
    letter-spacing: 0.01em;
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, box-shadow;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(0, 255, 157, 0.28);
}

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

.btn-secondary:hover {
    transform: translateY(-1px);
}

/* ── 3. Card improvements ───────────────────────────────────── */
.site-card {
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.2s ease;
}

.site-card:hover {
    transform: translateY(-3px);
}

/* ── 4. Form inputs ─────────────────────────────────────────── */
.form-input,
input[type="text"],
input[type="email"],
input[type="url"],
input[type="number"],
input[type="password"],
select,
textarea {
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 255, 157, 0.15);
}

/* ── 5. Navigation ──────────────────────────────────────────── */
.site-nav .nav-link {
    transition: color 0.15s ease, opacity 0.15s ease;
    position: relative;
}

.site-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: #00ff9d;
    transform: scaleX(0);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 1px;
}

.site-nav .nav-link:hover::after,
.site-nav .nav-link.active::after {
    transform: scaleX(1);
}

/* ── 6. Trust score badges ──────────────────────────────────── */
.trust-score {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.trust-score--safe    { background: rgba(16, 185, 129, 0.12); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.2); }
.trust-score--neutral { background: rgba(148, 163, 184, 0.1);  color: #94a3b8; border: 1px solid rgba(148, 163, 184, 0.15); }
.trust-score--flagged { background: rgba(245, 158, 11, 0.1);   color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.2); }
.trust-score--danger  { background: rgba(239, 68, 68, 0.1);    color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.2); }

/* ── 7. Section transitions ─────────────────────────────────── */
.fade-in-up {
    animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

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

/* ── 8. Scrollbar (Webkit) ──────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,0.03); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.22); }

/* ── 9. Selection colour ────────────────────────────────────── */
::selection {
    background: rgba(0, 255, 157, 0.25);
    color: #fff;
}

/* ── 10. Responsive table wrapper ───────────────────────────── */
.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.07);
}

.table-scroll table {
    min-width: 480px;
    border-collapse: collapse;
    width: 100%;
}

.table-scroll th,
.table-scroll td {
    padding: 10px 14px;
    font-size: 0.85rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    white-space: nowrap;
}

.table-scroll th {
    background: rgba(255,255,255,0.04);
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255,255,255,0.45);
}

/* ── 11. Page header improvements ──────────────────────────── */
.page-header {
    position: relative;
    overflow: hidden;
}

.page-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0,255,157,0.3), transparent);
}

/* ── 12. Hero section glow ──────────────────────────────────── */
.hero-section::before,
.cv-hero::before {
    content: '';
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 400px;
    background: radial-gradient(ellipse, rgba(0,255,157,0.06) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* ── 13. Rating heatmap (public review pages) ───────────────── */
.rating-bar-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rating-bar {
    flex: 1;
    height: 6px;
    background: rgba(255,255,255,0.08);
    border-radius: 3px;
    overflow: hidden;
}

.rating-bar__fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.rating-bar__val {
    font-size: 0.78rem;
    font-weight: 800;
    min-width: 28px;
    text-align: right;
}

/* ── 14. Breadcrumb ─────────────────────────────────────────── */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.35);
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.breadcrumb a {
    color: rgba(255,255,255,0.45);
    text-decoration: none;
    transition: color 0.15s;
}

.breadcrumb a:hover { color: #00ff9d; }

.breadcrumb__sep {
    opacity: 0.3;
    font-size: 0.68rem;
}

.breadcrumb__current {
    color: rgba(255,255,255,0.6);
}

/* ── 15. Flash/toast messages ───────────────────────────────── */
.flash-message,
.alert {
    border-radius: 10px;
    padding: 14px 18px;
    font-size: 0.88rem;
    font-weight: 500;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid transparent;
    animation: slideInFlash 0.25s ease both;
}

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

.flash-message.success,
.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.25);
    color: #10b981;
}

.flash-message.error,
.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.25);
    color: #ef4444;
}

.flash-message.info,
.alert-info {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.2);
    color: #818cf8;
}

/* ── 16. Feature badge chips ────────────────────────────────── */
.feature-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.65);
    white-space: nowrap;
}

.feature-chip--green {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.feature-chip--amber {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

/* ── 17. Sticky CTA bar (mobile) ────────────────────────────── */
.review-cta-bar {
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── 18. Image loading skeleton ─────────────────────────────── */
.img-skeleton {
    background: linear-gradient(90deg,
        rgba(255,255,255,0.04) 25%,
        rgba(255,255,255,0.08) 50%,
        rgba(255,255,255,0.04) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
    from { background-position: 200% 0; }
    to   { background-position: -200% 0; }
}

/* ── 19. Promo/bonus badge ──────────────────────────────────── */
.bonus-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: linear-gradient(135deg, rgba(0,255,157,0.12), rgba(0,255,157,0.06));
    border: 1px solid rgba(0,255,157,0.2);
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #00ff9d;
}

/* ── 20. Focus visible (keyboard nav) ───────────────────────── */
:focus-visible {
    outline: 2px solid rgba(0, 255, 157, 0.6);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ── 21. Mobile improvements ────────────────────────────────── */
@media (max-width: 768px) {
    .container { padding-left: 16px; padding-right: 16px; }

    h1 { letter-spacing: -0.03em; }

    .btn-primary,
    .btn-secondary {
        padding: 12px 20px;
        font-size: 0.9rem;
    }

    /* Stack grids on small screens */
    .form-grid-2,
    .form-grid-3 {
        grid-template-columns: 1fr !important;
    }
}

/* ── 22. Print styles ───────────────────────────────────────── */
@media print {
    .site-header,
    .site-nav,
    footer,
    .review-cta-bar,
    .rv-sidebar,
    .legal-sidebar,
    .av-sidebar {
        display: none !important;
    }

    body { background: #fff; color: #000; }
    a { color: #000; text-decoration: underline; }
}
