/* Traffic Plus — Trendy UI: animations, mesh backgrounds, hover effects */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

:root {
    --tp-font: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
    --tp-glass: rgba(255, 255, 255, 0.72);
    --tp-glass-border: rgba(255, 255, 255, 0.45);
    --tp-glow: 0 0 40px rgba(198, 38, 38, 0.18);
    --tp-glow-strong: 0 12px 40px rgba(198, 38, 38, 0.35);
    --tp-mesh-1: #fff5f5;
    --tp-mesh-2: #ffe8e8;
    --tp-mesh-3: #f8f5f5;
}

body {
    font-family: var(--tp-font);
}

.public-site {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.public-site .homepage,
.public-site main {
    flex: 1;
}

/* ─── Animated mesh background ─── */
.mesh-page {
    position: relative;
    min-height: 100vh;
    overflow-x: hidden;
}

.mesh-page::before,
.mesh-page::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.55;
    z-index: -1;
    pointer-events: none;
    animation: meshFloat 18s ease-in-out infinite;
}

.mesh-page::before {
    width: 520px;
    height: 520px;
    background: radial-gradient(circle, rgba(255, 107, 107, 0.2) 0%, transparent 70%);
    top: -120px;
    right: -80px;
}

.mesh-page::after {
    width: 480px;
    height: 480px;
    background: radial-gradient(circle, rgba(255, 107, 107, 0.18) 0%, transparent 70%);
    bottom: -100px;
    left: -60px;
    animation-delay: -9s;
}

.dashboard-site.mesh-page::before {
    width: 400px;
    height: 400px;
    top: 10%;
    right: 5%;
    opacity: 0.35;
}

.dashboard-site.mesh-page::after {
    width: 360px;
    height: 360px;
    bottom: 15%;
    left: 30%;
    opacity: 0.3;
}

@keyframes meshFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -25px) scale(1.05); }
    66% { transform: translate(-20px, 20px) scale(0.95); }
}

/* Dot grid overlay */
.bg-grid {
    position: relative;
}

.bg-grid::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(198, 38, 38, 0.07) 1px, transparent 1px);
    background-size: 24px 24px;
    pointer-events: none;
    z-index: 0;
}

.bg-grid > .container,
.bg-grid > .container-fluid {
    position: relative;
    z-index: 1;
}

/* ─── Glass navbar ─── */
.navbar.tp-navbar {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-bottom: 1px solid rgba(198, 38, 38, 0.12) !important;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.3s ease, background 0.3s ease;
}

.navbar.tp-navbar.scrolled {
    box-shadow: 0 8px 32px rgba(198, 38, 38, 0.1);
    background: rgba(255, 255, 255, 0.95) !important;
}

/* ─── Cards: glass + gradient border hover ─── */
.tp-card {
    background: var(--tp-glass);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 16px;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.35s ease,
                border-color 0.35s ease;
    position: relative;
    overflow: hidden;
}

.tp-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, transparent 40%, rgba(198, 38, 38, 0.4) 50%, transparent 60%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.tp-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--tp-glow-strong);
    border-color: rgba(198, 38, 38, 0.2);
}

.tp-card:hover::before {
    opacity: 1;
}

.hover-lift {
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s ease;
}

.hover-lift:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
}

.hover-glow:hover {
    box-shadow: var(--tp-glow-strong);
}

/* Business cards — shine sweep */
.business-card {
    overflow: hidden;
}

.business-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    transition: left 0.6s ease;
    pointer-events: none;
    z-index: 2;
}

.business-card:hover::after {
    left: 120%;
}

.business-card:hover {
    transform: translateY(-10px) scale(1.01);
}

.business-logo {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.business-card:hover .business-logo {
    transform: scale(1.1) rotate(-5deg);
    box-shadow: 0 8px 24px rgba(198, 38, 38, 0.35);
}

/* ─── Buttons ─── */
.btn-tp {
    position: relative;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.btn-tp::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.5s ease, height 0.5s ease;
}

.btn-tp:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(198, 38, 38, 0.35);
}

.btn-tp:hover::after {
    width: 280px;
    height: 280px;
}

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

/* ─── Scroll reveal ─── */
.reveal {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal-left.revealed {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal-right.revealed {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.reveal-scale.revealed {
    opacity: 1;
    transform: scale(1);
}

.stagger-reveal > * {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.stagger-reveal.revealed > *:nth-child(1) { transition-delay: 0.05s; }
.stagger-reveal.revealed > *:nth-child(2) { transition-delay: 0.1s; }
.stagger-reveal.revealed > *:nth-child(3) { transition-delay: 0.15s; }
.stagger-reveal.revealed > *:nth-child(4) { transition-delay: 0.2s; }
.stagger-reveal.revealed > *:nth-child(5) { transition-delay: 0.25s; }
.stagger-reveal.revealed > *:nth-child(6) { transition-delay: 0.3s; }
.stagger-reveal.revealed > *:nth-child(n+7) { transition-delay: 0.35s; }

.stagger-reveal.revealed > * {
    opacity: 1;
    transform: translateY(0);
}

/* ─── Hero enhancements ─── */
.hero-mesh {
    position: relative;
    overflow: hidden;
}

.hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    animation: orbPulse 6s ease-in-out infinite;
    pointer-events: none;
}

.hero-orb-1 {
    width: 280px;
    height: 280px;
    background: rgba(255, 255, 255, 0.15);
    top: 20%;
    right: 10%;
}

.hero-orb-2 {
    width: 200px;
    height: 200px;
    background: rgba(255, 107, 107, 0.2);
    bottom: 10%;
    left: 15%;
    animation-delay: -3s;
}

@keyframes orbPulse {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.15); opacity: 0.9; }
}

.highlight {
    background-size: 200% auto;
    animation: gradientShift 4s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% center; }
    50% { background-position: 100% center; }
}

/* ─── Step / feature cards ─── */
.step-card,
.feature-card {
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.35s ease,
                border-color 0.35s ease;
}

.step-card:hover,
.feature-card:hover {
    transform: translateY(-8px) rotate(-0.5deg);
    box-shadow: 0 20px 48px rgba(198, 38, 38, 0.15);
    border-color: rgba(198, 38, 38, 0.25) !important;
}

.step-icon,
.feature-icon-wrap {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.step-card:hover .step-icon,
.feature-card:hover .feature-icon-wrap {
    transform: scale(1.12) rotate(5deg);
}

/* ─── Dashboard ─── */
.dashboard-container .sidebar {
    background: rgba(255, 255, 255, 0.92) !important;
    backdrop-filter: blur(12px);
}

.dashboard-container .sidebar-link {
    border-radius: 10px;
    margin: 4px 12px;
    overflow: hidden;
}

.dashboard-container .sidebar-link::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.dashboard-container .sidebar-link:hover::after {
    transform: translateX(100%);
}

.dashboard-content .card,
.dashboard-content .nav-top {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.dashboard-content .stats-card:hover,
.dashboard-content .card.hover-lift:hover {
    transform: translateY(-6px);
    box-shadow: var(--tp-glow);
}

.stats-card .fs-1,
.stats-card i {
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.stats-card:hover i {
    transform: scale(1.15);
}

/* ─── Ad show page ─── */
.ad-show-hero .hero-orb {
    filter: blur(50px);
}

.ad-section-card,
.ad-info-card {
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.ad-section-card:hover,
.ad-info-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.1);
}

.ad-section-card .section-icon {
    transition: transform 0.4s ease, background 0.3s ease;
}

.ad-section-card:hover .section-icon {
    transform: rotate(8deg) scale(1.08);
    background: rgba(198, 38, 38, 0.18);
}

/* ─── Search boxes ─── */
.search-box,
.filter-box {
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.search-box:focus-within,
.filter-box:focus-within {
    transform: translateY(-3px);
    box-shadow: var(--tp-glow);
}

/* ─── Footer ─── */
.site-footer {
    background: linear-gradient(180deg, transparent, rgba(198, 38, 38, 0.04));
    position: relative;
}

.site-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    animation: footerLine 3s ease-in-out infinite;
}

@keyframes footerLine {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.footer-link {
    transition: color 0.2s ease, transform 0.2s ease;
    display: inline-block;
}

.footer-link:hover {
    transform: translateY(-2px);
}

/* ─── Login auth panel ─── */
.auth-container .form {
    backdrop-filter: blur(8px);
}

.auth-container.sign-in .form.sign-in,
.auth-container.sign-up .form.sign-up {
    animation: formPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

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

/* ─── Table rows ─── */
.table-hover tbody tr {
    transition: background 0.2s ease, transform 0.2s ease;
}

.table-hover tbody tr:hover {
    background: rgba(198, 38, 38, 0.04) !important;
}

/* ─── Credits page ─── */
.credits-page .credits-display {
    animation: creditsGlow 4s ease-in-out infinite;
}

@keyframes creditsGlow {
    0%, 100% { box-shadow: 0 12px 32px rgba(198, 38, 38, 0.25); }
    50% { box-shadow: 0 16px 48px rgba(198, 38, 38, 0.4); }
}

.credits-page .stat-card {
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s ease;
}

.credits-page .stat-card:hover {
    transform: translateY(-6px) scale(1.02);
}

/* ─── Reduced motion ─── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .reveal, .reveal-left, .reveal-right, .reveal-scale,
    .stagger-reveal > * {
        opacity: 1;
        transform: none;
    }
}
