/* ============================================
   URL Webwala — go.urlwebwala.com
   Brand Theme: Navy + Red (logo colors)
   ============================================ */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --brand-navy: #0a1f33;
    --brand-navy-light: #132d4a;
    --brand-red: #e30613;
    --brand-red-dark: #b8050f;
    --brand-red-glow: rgba(227, 6, 19, 0.35);
    --brand-navy-glow: rgba(19, 45, 74, 0.6);
    --bg-dark: #060d18;
    --card-bg: rgba(10, 31, 51, 0.55);
    --card-border: rgba(255, 255, 255, 0.1);
    --card-blur: 24px;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.62);
    --text-muted: rgba(255, 255, 255, 0.38);
    --accent-red: #e30613;
    --accent-navy: #1e4976;
    --gradient-main: linear-gradient(135deg, #e30613 0%, #c41e3a 50%, #9b1b30 100%);
    --gradient-tagline: linear-gradient(90deg, #ffffff 0%, #ffb3b8 50%, #e30613 100%);
    --gradient-glow:
        radial-gradient(ellipse at 15% 10%, rgba(30, 73, 118, 0.45) 0%, transparent 55%),
        radial-gradient(ellipse at 85% 90%, rgba(227, 6, 19, 0.28) 0%, transparent 55%),
        radial-gradient(ellipse at 50% 50%, rgba(10, 31, 51, 0.5) 0%, transparent 70%);
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 12px;
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255,255,255,0.06) inset;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #020408;
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background — animated starfield */
.bg-stars {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background: radial-gradient(ellipse at 50% 0%, #0a1628 0%, #020408 45%, #000000 100%);
}

.bg-glow {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 15%, rgba(30, 73, 118, 0.12) 0%, transparent 45%),
        radial-gradient(ellipse at 80% 85%, rgba(227, 6, 19, 0.07) 0%, transparent 40%);
    pointer-events: none;
    z-index: 0;
}

/* Layout */
.page {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 32px 20px;
    flex-wrap: wrap;
}

/* Cards */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(var(--card-blur));
    -webkit-backdrop-filter: blur(var(--card-blur));
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

.card-main {
    width: 100%;
    max-width: 420px;
    padding: 28px 28px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.card-stats {
    width: 100%;
    max-width: 320px;
    padding: 24px;
    align-self: center;
}

/* Top Actions */
.card-top-actions {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 20px;
    gap: 10px;
}

.pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 100px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.pill-btn svg {
    width: 14px;
    height: 14px;
}

.pill-btn:hover {
    background: rgba(30, 73, 118, 0.35);
    color: var(--text-primary);
    border-color: rgba(227, 6, 19, 0.35);
}

/* Brand */
.brand {
    text-align: center;
    margin-bottom: 24px;
}

.logo {
    position: relative;
    width: min(100%, 280px);
    margin: 0 auto 20px;
    padding: 16px 22px;
    border-radius: 18px;
    background: linear-gradient(160deg, #ffffff 0%, #f0f3f7 100%);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.2),
        0 12px 40px rgba(227, 6, 19, 0.22),
        0 4px 16px rgba(6, 13, 24, 0.5);
}

.logo::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--brand-red) 0%, var(--brand-navy-light) 100%);
    z-index: -1;
    opacity: 0.85;
}

.logo img {
    width: 100%;
    height: auto;
    max-height: 72px;
    object-fit: contain;
    display: block;
}

.brand h1 {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}

.brand-accent {
    color: var(--brand-red);
}

.tagline {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--brand-red);
    margin-bottom: 8px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
    max-width: 300px;
    margin: 0 auto;
}

/* CTA Buttons */
.cta-buttons {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.cta-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.cta-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity var(--transition);
}

.cta-primary {
    background: var(--gradient-main);
    color: white;
    box-shadow: 0 4px 20px var(--brand-red-glow);
}

.cta-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(227, 6, 19, 0.55);
}

.cta-secondary {
    background: rgba(19, 45, 74, 0.5);
    border: 1px solid rgba(30, 73, 118, 0.45);
    color: var(--text-primary);
}

.cta-secondary:hover {
    background: rgba(30, 73, 118, 0.35);
    border-color: rgba(227, 6, 19, 0.35);
    transform: translateY(-2px);
}

.cta-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.15);
}

.cta-secondary .cta-icon {
    background: rgba(255,255,255,0.08);
}

.cta-icon svg {
    width: 20px;
    height: 20px;
}

.cta-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: left;
}

.cta-text strong {
    font-size: 0.9rem;
    font-weight: 600;
}

.cta-text small {
    font-size: 0.72rem;
    opacity: 0.75;
    font-weight: 400;
}

.cta-arrow {
    width: 18px;
    height: 18px;
    opacity: 0.6;
    flex-shrink: 0;
}

/* Social */
.social-section {
    width: 100%;
    margin-bottom: 20px;
}

.social-label {
    text-align: center;
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 14px;
}

.social-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.social-btn svg {
    width: 20px;
    height: 20px;
}

.social-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: var(--hover-color, rgba(255,255,255,0.3));
    color: var(--hover-color, white);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

/* Footer */
.card-footer {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-align: center;
    padding-top: 8px;
}

/* Stats Card */
.stats-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.stats-header h2 {
    font-size: 1rem;
    font-weight: 700;
}

.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.68rem;
    font-weight: 500;
    color: #4ade80;
    background: rgba(74, 222, 128, 0.1);
    padding: 4px 10px;
    border-radius: 100px;
    border: 1px solid rgba(74, 222, 128, 0.2);
}

.live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4ade80;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

.stats-list {
    display: flex;
    flex-direction: column;
}

.stat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    gap: 12px;
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.stat-label svg {
    width: 16px;
    height: 16px;
    opacity: 0.6;
    flex-shrink: 0;
}

.stat-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
}

.stat-location {
    font-size: 0.78rem;
    font-weight: 600;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: right;
}

/* Chart */
.chart-wrap {
    margin: 8px 0 12px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.chart-wrap canvas {
    width: 100% !important;
    height: 80px !important;
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal[hidden] {
    display: none;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(8px);
}

.modal-content {
    position: relative;
    background: rgba(10, 31, 51, 0.97);
    border: 1px solid rgba(30, 73, 118, 0.4);
    border-radius: var(--radius-lg);
    padding: 32px;
    text-align: center;
    max-width: 340px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.modal-content h3 {
    font-size: 1.1rem;
    margin-bottom: 6px;
}

.modal-content > p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    transition: color var(--transition);
}

.modal-close:hover {
    color: white;
}

.qr-code {
    background: white;
    border-radius: var(--radius-sm);
    padding: 16px;
    display: inline-block;
    margin-bottom: 12px;
}

.qr-code img {
    display: block;
    width: 200px;
    height: 200px;
}

.qr-url {
    font-size: 0.75rem;
    color: var(--accent-red);
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    .page {
        flex-direction: column;
        padding: 20px 16px;
    }

    .card-main,
    .card-stats {
        max-width: 100%;
    }

    .card-stats {
        order: 2;
    }
}

@media (max-width: 380px) {
    .social-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }

    .cta-text strong {
        font-size: 0.82rem;
    }
}

/* Animations */
.card-main, .card-stats {
    animation: fadeUp 0.6s ease both;
}

.card-stats {
    animation-delay: 0.15s;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .bg-stars {
        animation: none !important;
    }
}
