/* ═══════════════════════════════════════════════════════════════════
   SnipLink — Premium Purple & White Design System
   ═══════════════════════════════════════════════════════════════════ */

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

/* ─── CSS Variables ───────────────────────────────────────────────── */
:root {
    --bg-body:        #F8F7FC;
    --bg-white:       #FFFFFF;
    --bg-light:       #F3F0FF;
    --bg-purple-soft: #EDE9FE;
    --bg-purple-muted:#DDD6FE;

    --purple-50:  #FAF5FF;
    --purple-100: #F3E8FF;
    --purple-200: #E9D5FF;
    --purple-300: #D8B4FE;
    --purple-400: #C084FC;
    --purple-500: #A855F7;
    --purple-600: #9333EA;
    --purple-700: #7C3AED;
    --purple-800: #6C2BD9;
    --purple-900: #581C87;

    --text-dark:      #1A1235;
    --text-body:      #4A4458;
    --text-muted:     #8E8BA0;
    --text-light:     #B4B0C7;

    --border:         #E8E4F0;
    --border-focus:   var(--purple-400);

    --accent-green:   #10B981;
    --accent-red:     #EF4444;
    --accent-yellow:  #F59E0B;
    --accent-blue:    #3B82F6;

    --gradient:       linear-gradient(135deg, var(--purple-600) 0%, var(--purple-500) 50%, #C084FC 100%);
    --gradient-light: linear-gradient(135deg, var(--purple-100) 0%, #FDF2F8 100%);
    --gradient-hero:  linear-gradient(135deg, #1A1235 0%, #2D1B69 40%, #4C1D95 70%, #6D28D9 100%);

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

    --shadow-xs:  0 1px 2px rgba(109, 40, 217, 0.04);
    --shadow-sm:  0 2px 8px rgba(109, 40, 217, 0.06);
    --shadow-md:  0 4px 16px rgba(109, 40, 217, 0.08);
    --shadow-lg:  0 8px 32px rgba(109, 40, 217, 0.10);
    --shadow-xl:  0 16px 48px rgba(109, 40, 217, 0.14);
    --shadow-glow: 0 0 40px rgba(168, 85, 247, 0.15);

    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-med:  0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-body);
    color: var(--text-body);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

a { color: var(--purple-600); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--purple-800); }

/* ─── Decorative Background ──────────────────────────────────────── */
.hero-bg {
    position: relative;
    background: var(--gradient-hero);
    overflow: hidden;
}

.hero-bg::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(168,85,247,0.25) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hero-bg::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(192,132,252,0.2) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

/* ─── Grid Pattern Overlay ───────────────────────────────────────── */
.grid-pattern {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
}

/* ─── Layout ──────────────────────────────────────────────────────── */
.page-wrapper {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.container--narrow { max-width: 720px; }

/* ─── Navbar ──────────────────────────────────────────────────────── */
.navbar {
    position: relative;
    z-index: 100;
    padding: 1.25rem 0;
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar__brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 1.35rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
}

.navbar__brand-icon {
    width: 40px; height: 40px;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.navbar__brand-icon svg {
    width: 22px; height: 22px;
    color: #fff;
}

.navbar__links {
    display: flex;
    align-items: center;
    gap: 2rem;
    list-style: none;
}

.navbar__links a {
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.navbar__links a:hover { color: #fff; }

.navbar__links .btn--white {
    padding: 0.55rem 1.25rem;
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--radius-md);
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all var(--transition-fast);
}

.navbar__links .btn--white:hover {
    background: rgba(255,255,255,0.22);
}

/* ─── Hero Section ────────────────────────────────────────────────── */
.hero {
    position: relative;
    z-index: 1;
    padding: 4rem 0 8rem;
    text-align: center;
    color: #fff;
}

.hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem 0.4rem 0.5rem;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
    margin-bottom: 2rem;
    animation: fadeInUp 0.6s ease-out;
}

.hero__badge-dot {
    width: 8px; height: 8px;
    background: var(--accent-green);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

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

.hero__title {
    font-size: clamp(2.5rem, 5.5vw, 3.8rem);
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -2px;
    margin-bottom: 1.25rem;
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

.hero__title-accent {
    background: linear-gradient(135deg, #E9D5FF, #F5D0FE, #FDE68A);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero__subtitle {
    font-size: 1.15rem;
    color: rgba(255,255,255,0.65);
    max-width: 480px;
    margin: 0 auto 3rem;
    line-height: 1.7;
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

/* ─── Shorten Card (floats over hero) ─────────────────────────────── */
.shorten-section {
    position: relative;
    z-index: 2;
    margin-top: -4rem;
    padding-bottom: 3rem;
}

.shorten-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-2xl);
    padding: 2.5rem;
    box-shadow: var(--shadow-xl);
    animation: fadeInUp 0.6s ease-out 0.3s both;
}

.shorten-card__form {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.input-group {
    flex: 1;
    position: relative;
}

.input-group__icon {
    position: absolute;
    left: 1.1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    pointer-events: none;
    transition: color var(--transition-fast);
}

.input-group__icon svg { width: 20px; height: 20px; }

.input {
    width: 100%;
    padding: 1rem 1rem 1rem 3.2rem;
    background: var(--bg-body);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--text-dark);
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: all var(--transition-fast);
}

.input::placeholder { color: var(--text-light); }

.input:focus {
    border-color: var(--purple-400);
    background: var(--bg-white);
    box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.1);
}

.input:focus ~ .input-group__icon,
.input:focus + .input-group__icon {
    color: var(--purple-500);
}

.input--sm {
    padding: 1rem 1rem;
    max-width: 220px;
}

.input--no-icon {
    padding-left: 1rem;
}

/* ─── Buttons ─────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 1.75rem;
    border: none;
    border-radius: var(--radius-lg);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn:active { transform: scale(0.97); }

.btn svg { width: 18px; height: 18px; }

.btn--primary {
    background: var(--gradient);
    color: #fff;
    box-shadow: 0 4px 16px rgba(147, 51, 234, 0.35);
}

.btn--primary:hover {
    box-shadow: 0 8px 28px rgba(147, 51, 234, 0.45);
    transform: translateY(-2px);
}

.btn--secondary {
    background: var(--bg-light);
    color: var(--purple-700);
    border: 1px solid var(--purple-200);
}

.btn--secondary:hover {
    background: var(--purple-100);
}

.btn--ghost {
    background: transparent;
    color: var(--text-body);
    border: 1px solid var(--border);
}

.btn--ghost:hover { background: var(--bg-body); }

.btn--danger {
    background: #FEF2F2;
    color: var(--accent-red);
    border: 1px solid #FECACA;
}

.btn--danger:hover { background: #FEE2E2; }

.btn--success {
    background: #ECFDF5;
    color: var(--accent-green);
    border: 1px solid #A7F3D0;
}

.btn--success:hover { background: #D1FAE5; }

.btn--sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    border-radius: var(--radius-md);
}

.btn--icon {
    padding: 0.55rem;
    min-width: 36px;
    min-height: 36px;
    border-radius: var(--radius-md);
}

.btn--icon svg { width: 16px; height: 16px; }

/* ─── Advanced Options ────────────────────────────────────────────── */
.advanced-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    padding: 0.4rem 0;
}

.advanced-toggle svg { width: 16px; height: 16px; }
.advanced-toggle:hover { color: var(--purple-600); }

.advanced-options {
    display: none;
    gap: 0.75rem;
    margin: 0.75rem 0;
    animation: fadeInUp 0.3s ease-out;
}

.advanced-options.active { display: flex; }

/* ─── Result Card ─────────────────────────────────────────────────── */
.result-card {
    display: none;
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #ECFDF5, #F0FDF4);
    border: 1px solid #A7F3D0;
    border-radius: var(--radius-xl);
    animation: fadeInUp 0.4s ease-out;
}

.result-card.active { display: block; }

.result-card__label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent-green);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

.result-card__label svg { width: 16px; height: 16px; }

.result-card__url-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.result-card__url {
    flex: 1;
    padding: 0.8rem 1rem;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    border: 1px solid #D1FAE5;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--purple-700);
    word-break: break-all;
}

.result-card__qr {
    margin-top: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.result-card__qr canvas { border-radius: var(--radius-sm); }

.result-card__qr-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ─── Stats Strip ─────────────────────────────────────────────────── */
.stats-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    padding: 3rem 0 4rem;
}

.stat-item {
    text-align: center;
    padding: 2rem 1.5rem;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    transition: all var(--transition-med);
}

.stat-item:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--purple-200);
}

.stat-item__icon {
    width: 52px; height: 52px;
    background: var(--gradient-light);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.stat-item__icon svg {
    width: 24px; height: 24px;
    color: var(--purple-600);
}

.stat-item__number {
    font-size: 2.4rem;
    font-weight: 900;
    color: var(--text-dark);
    letter-spacing: -1px;
}

.stat-item__label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    font-weight: 500;
}

/* ─── Features Grid ──────────────────────────────────────────────── */
.features {
    padding: 2rem 0 6rem;
}

.features__header {
    text-align: center;
    margin-bottom: 3.5rem;
}

.features__subtitle {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--purple-600);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 0.75rem;
}

.features__title {
    font-size: 2rem;
    font-weight: 900;
    color: var(--text-dark);
    letter-spacing: -0.5px;
}

.features__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    padding: 2rem;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    transition: all var(--transition-med);
}

.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--purple-200);
}

.feature-card__icon {
    width: 52px; height: 52px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.feature-card__icon svg { width: 24px; height: 24px; }

.feature-card__icon--purple { background: var(--purple-100); color: var(--purple-600); }
.feature-card__icon--green  { background: #D1FAE5; color: var(--accent-green); }
.feature-card__icon--blue   { background: #DBEAFE; color: var(--accent-blue); }
.feature-card__icon--yellow { background: #FEF3C7; color: var(--accent-yellow); }

.feature-card__title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.feature-card__desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ─── Footer ──────────────────────────────────────────────────────── */
.footer {
    margin-top: auto;
    padding: 2.5rem 0;
    background: var(--bg-white);
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.footer a { font-weight: 600; }

/* ─── Toast ───────────────────────────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 0.85rem 1.5rem;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--text-dark);
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    transform: translateY(100px);
    opacity: 0;
    transition: all var(--transition-med);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toast.active { transform: translateY(0); opacity: 1; }

.toast--error {
    border-color: #FECACA;
    color: var(--accent-red);
}

/* ─── Spinner ─────────────────────────────────────────────────────── */
.spinner {
    width: 20px; height: 20px;
    border: 2.5px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

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

/* ─── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .hero { padding: 3rem 0 6rem; }
    .shorten-card { padding: 1.5rem; border-radius: var(--radius-xl); }
    .shorten-card__form { flex-direction: column; }
    .input--sm { max-width: 100%; }
    .advanced-options { flex-direction: column; }
    .result-card__url-row { flex-direction: column; }
    .stats-strip { grid-template-columns: 1fr 1fr; gap: 1rem; }
    .navbar__links { gap: 1rem; }
}

@media (max-width: 480px) {
    .hero__title { font-size: 2rem; }
    .stats-strip { grid-template-columns: 1fr; }
    .features__grid { grid-template-columns: 1fr; }
}
