/* ==============================================================================
   vergleich.fliesentisch-verein.de — Next-Gen AI-Era Design System
   ============================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600;700;800&display=swap');

/* ── Custom Properties ─────────────────────────────────────────────────── */
:root {
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --surface-0: #050a14;
    --surface-1: rgba(10, 18, 36, 0.90);
    --surface-2: rgba(15, 25, 50, 0.85);
    --border-subtle: rgba(56, 76, 120, 0.35);
    --glow-blue: rgba(59, 130, 246, 0.5);
    --glow-emerald: rgba(52, 211, 153, 0.5);
    --glow-violet: rgba(139, 92, 246, 0.4);
}

/* ── @property for Animated Gradients ──────────────────────────────────── */
@property --gradient-angle {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}

@property --aurora-pos {
    syntax: "<percentage>";
    initial-value: 0%;
    inherits: false;
}

/* ── Base ───────────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }

body {
    font-family: var(--font-sans);
    letter-spacing: -0.011em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: var(--surface-0);
    overflow-x: hidden;
}

.font-mono, .tabular-nums, .price-num {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
}

/* ── Living Aurora Background ──────────────────────────────────────────── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(ellipse 80% 50% at 20% -10%, rgba(59, 130, 246, 0.15) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 80% 10%, rgba(139, 92, 246, 0.12) 0%, transparent 55%),
        radial-gradient(ellipse 70% 50% at 50% 90%, rgba(16, 185, 129, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse 40% 30% at 10% 60%, rgba(244, 63, 94, 0.06) 0%, transparent 50%);
    animation: aurora-drift 12s ease-in-out infinite alternate;
}

@keyframes aurora-drift {
    0%   { opacity: 0.85; transform: scale(1) translateY(0); }
    100% { opacity: 1; transform: scale(1.05) translateY(-20px); }
}

/* ── Noise Texture Overlay ─────────────────────────────────────────────── */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    opacity: 0.025;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    pointer-events: none;
}

/* ── Glassmorphism Cards ───────────────────────────────────────────────── */
.glass-card {
    background: var(--surface-1);
    backdrop-filter: blur(24px) saturate(1.5);
    -webkit-backdrop-filter: blur(24px) saturate(1.5);
    border: 1px solid var(--border-subtle);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.03) inset,
        0 16px 48px -12px rgba(0, 0, 0, 0.5);
}

/* ── Animated Gradient Text ────────────────────────────────────────────── */
.gradient-text {
    background: linear-gradient(135deg, #ffffff 0%, #60a5fa 35%, #a78bfa 55%, #34d399 80%, #ffffff 100%);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient-shift 6s ease-in-out infinite;
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}

/* ── Animated Border Search Box ────────────────────────────────────────── */
@keyframes rotate-gradient {
    to { --gradient-angle: 360deg; }
}

.search-glow-wrap {
    position: relative;
    border-radius: 1.25rem;
    padding: 2px;
    background: conic-gradient(
        from var(--gradient-angle),
        rgba(59, 130, 246, 0.6),
        rgba(139, 92, 246, 0.4),
        rgba(52, 211, 153, 0.4),
        rgba(59, 130, 246, 0.6)
    );
    animation: rotate-gradient 4s linear infinite;
}

.search-glow-wrap::before {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 1.5rem;
    background: conic-gradient(
        from var(--gradient-angle),
        rgba(59, 130, 246, 0.25),
        rgba(139, 92, 246, 0.15),
        rgba(52, 211, 153, 0.15),
        rgba(59, 130, 246, 0.25)
    );
    filter: blur(16px);
    animation: rotate-gradient 4s linear infinite;
    z-index: -1;
    opacity: 0.7;
}

.search-inner {
    background: rgba(8, 15, 30, 0.95);
    border-radius: calc(1.25rem - 2px);
}

/* ── Winner Cell Glow ──────────────────────────────────────────────────── */
.cell-winner {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(52, 211, 153, 0.12));
    border-radius: 14px;
    border: 1px solid rgba(52, 211, 153, 0.25);
    position: relative;
    transition: all 0.25s var(--ease-out-expo);
}

.cell-winner::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 15px;
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.15), transparent 50%);
    filter: blur(8px);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s var(--ease-out-expo);
}

tr:hover .cell-winner::after {
    opacity: 1;
}

/* ── Best Price Pill ───────────────────────────────────────────────────── */
.best-price-pill {
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.12), rgba(16, 185, 129, 0.2));
    border: 1px solid rgba(52, 211, 153, 0.35);
    border-radius: 10px;
    box-shadow: 0 0 16px rgba(52, 211, 153, 0.12);
    transition: all 0.2s var(--ease-out-expo);
}

tr:hover .best-price-pill {
    box-shadow: 0 0 24px rgba(52, 211, 153, 0.2);
    border-color: rgba(52, 211, 153, 0.5);
}

/* ── Modern iOS Toggle ─────────────────────────────────────────────────── */
.switch-input {
    appearance: none;
    width: 2.75rem;
    height: 1.5rem;
    background: #1a2540;
    border-radius: 9999px;
    border: 1px solid #2a3a5c;
    position: relative;
    cursor: pointer;
    outline: none;
    transition: all 0.3s var(--ease-out-expo);
}

.switch-input::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 1.15rem;
    height: 1.15rem;
    background: linear-gradient(135deg, #e2e8f0, #fff);
    border-radius: 9999px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s var(--ease-spring);
}

.switch-input:checked {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    border-color: rgba(99, 102, 241, 0.6);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.35);
}

.switch-input:checked::after {
    transform: translateX(1.25rem);
}

.switch-input:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* ── Floating Dropdown ─────────────────────────────────────────────────── */
.custom-dropdown-menu {
    transition: opacity 0.18s var(--ease-out-expo), transform 0.18s var(--ease-out-expo), visibility 0.18s;
    transform-origin: bottom right;
}

.custom-dropdown-menu.open {
    opacity: 1 !important;
    transform: scale(1) translateY(0) !important;
    pointer-events: auto !important;
    visibility: visible !important;
}

.custom-dropdown-menu.closed {
    opacity: 0 !important;
    transform: scale(0.95) translateY(4px) !important;
    pointer-events: none !important;
    visibility: hidden !important;
}

.chevron-icon {
    transition: transform 0.25s var(--ease-out-expo);
}

.dropdown-trigger[aria-expanded="true"] .chevron-icon {
    transform: rotate(180deg);
}

/* ── TLD Quick-Chips ───────────────────────────────────────────────────── */
.tld-chip {
    transition: all 0.2s var(--ease-out-expo);
    position: relative;
    overflow: hidden;
}

.tld-chip::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(139, 92, 246, 0.3));
    opacity: 0;
    transition: opacity 0.2s;
    border-radius: inherit;
}

.tld-chip:hover::before {
    opacity: 1;
}

.tld-chip:hover {
    transform: translateY(-2px);
    border-color: rgba(99, 102, 241, 0.6) !important;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.2);
}

.tld-chip:active {
    transform: scale(0.95);
}

/* ── Action Buttons ────────────────────────────────────────────────────── */
.action-btn {
    transition: all 0.2s var(--ease-out-expo);
}

.action-btn.active-action {
    background: linear-gradient(135deg, #2563eb, #4f46e5) !important;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1) inset !important;
}

.action-btn:active {
    transform: scale(0.96);
}

/* ── Table Rows ────────────────────────────────────────────────────────── */
tr.domain-row {
    transition: all 0.2s var(--ease-out-expo);
}

tr.domain-row:hover {
    background: rgba(30, 45, 80, 0.35) !important;
}

/* ── Smooth Scrollbar ──────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(100, 120, 160, 0.3); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(100, 120, 160, 0.5); }

/* ── Toast Notifications ───────────────────────────────────────────────── */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    animation: toast-in 0.3s var(--ease-spring) forwards;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(12px) scale(0.92); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Number Inputs Without Spinners ───────────────────────────────────── */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type="number"] {
    -moz-appearance: textfield;
}

/* ── Fintech Margin Formula Dock ───────────────────────────────────────── */
.margin-capsule {
    background: rgba(10, 17, 36, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.09);
    box-shadow: 0 12px 32px -4px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(20px);
}

.margin-input-group {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.2s var(--ease-out-expo);
}

.margin-input-group:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
}

.margin-input-group:focus-within {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(129, 140, 248, 0.6);
    box-shadow: 0 0 16px rgba(99, 102, 241, 0.3);
}

.margin-stepper-btn {
    transition: all 0.15s ease;
    opacity: 0.5;
}

.margin-input-group:hover .margin-stepper-btn,
.margin-stepper-btn:hover {
    opacity: 1;
}

.margin-stepper-btn:hover {
    transform: scale(1.15);
}

.margin-stepper-btn:active {
    transform: scale(0.9);
}

.margin-preset-btn {
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.2s var(--ease-out-expo);
}

.margin-preset-btn:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    transform: translateY(-1px);
}

.margin-preset-btn.active-preset {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.35), rgba(139, 92, 246, 0.35)) !important;
    border-color: rgba(129, 140, 248, 0.6) !important;
    color: #e0e7ff !important;
    box-shadow: 0 0 14px rgba(99, 102, 241, 0.3);
}

/* ── Headi Love Ambient Background Tickers ─────────────────────────────── */
.headi-ticker-track {
    position: fixed;
    left: -5%;
    width: 110vw;
    display: flex;
    overflow: hidden;
    user-select: none;
    pointer-events: none;
    z-index: 0;
    white-space: nowrap;
    opacity: 0.16;
    filter: drop-shadow(0 0 16px rgba(244, 63, 94, 0.4));
    transition: opacity 0.5s ease;
}

.headi-ticker-track.track-1 {
    top: 14%;
    transform: rotate(-3.5deg) scale(1.05);
}

.headi-ticker-track.track-2 {
    bottom: 10%;
    transform: rotate(2.5deg) scale(1.05);
    opacity: 0.13;
}

.headi-ticker-content {
    display: flex;
    align-items: center;
    gap: 3rem;
    padding-right: 3rem;
    flex-shrink: 0;
    animation: headi-slide 32s linear infinite;
    font-family: var(--font-sans);
    font-size: clamp(2rem, 3.8vw, 3.5rem);
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: linear-gradient(90deg, #ff2a85 0%, #ec4899 25%, #a855f7 50%, #f43f5e 75%, #ff2a85 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.headi-ticker-content.reverse {
    animation: headi-slide-rev 36s linear infinite;
    background: linear-gradient(90deg, #ec4899 0%, #f43f5e 25%, #a855f7 50%, #e11d48 75%, #ec4899 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.heart-emoji {
    -webkit-text-fill-color: initial;
    display: inline-block;
    filter: drop-shadow(0 0 8px rgba(244, 63, 94, 0.8));
    animation: heart-pulse-anim 2.5s ease-in-out infinite;
}

@keyframes headi-slide {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

@keyframes headi-slide-rev {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(0); }
}

@keyframes heart-pulse-anim {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.22) rotate(4deg); }
}

/* ── Floating Glowing Ambient Hearts ──────────────────────────────────── */
.floating-heart {
    position: fixed;
    bottom: -40px;
    pointer-events: none;
    z-index: 0;
    user-select: none;
    opacity: 0;
    animation: float-heart-up 8s cubic-bezier(0.25, 1, 0.5, 1) forwards;
    filter: drop-shadow(0 0 12px rgba(244, 63, 94, 0.7));
}

@keyframes float-heart-up {
    0% {
        opacity: 0;
        transform: translateY(0) scale(0.6) rotate(0deg);
    }
    15% {
        opacity: 0.75;
    }
    80% {
        opacity: 0.6;
    }
    100% {
        opacity: 0;
        transform: translateY(-105vh) scale(1.25) rotate(35deg);
    }
}

/* ── Search Headi Love Enhancements ───────────────────────────────────── */
.search-love-badge {
    animation: float-badge 3.5s ease-in-out infinite;
    background: linear-gradient(135deg, rgba(244, 63, 94, 0.18), rgba(168, 85, 247, 0.18));
    border: 1px solid rgba(244, 63, 94, 0.4);
    box-shadow: 0 0 20px rgba(244, 63, 94, 0.25);
    transition: all 0.3s var(--ease-out-expo);
}

.search-love-badge:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 0 32px rgba(244, 63, 94, 0.55);
    border-color: rgba(244, 63, 94, 0.7);
    color: #ffffff;
}

@keyframes float-badge {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-5px); }
}

.search-love-strip {
    backdrop-filter: blur(16px);
    box-shadow: 0 4px 20px rgba(244, 63, 94, 0.15);
}

.search-love-strip-inner {
    display: flex;
    animation: search-strip-scroll 18s linear infinite;
    width: max-content;
}

@keyframes search-strip-scroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.search-keystroke-heart {
    position: fixed;
    pointer-events: none;
    z-index: 1000;
    user-select: none;
    animation: pop-heart 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    filter: drop-shadow(0 0 10px rgba(244, 63, 94, 0.85));
}

@keyframes pop-heart {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(0.5) rotate(0deg);
    }
    50% {
        opacity: 1;
        transform: translate(var(--pop-x, 0px), var(--pop-y, -35px)) scale(1.4) rotate(var(--pop-rot, 15deg));
    }
    100% {
        opacity: 0;
        transform: translate(var(--pop-x, 0px), var(--pop-y, -70px)) scale(1.8) rotate(var(--pop-rot, 30deg));
    }
}

.headi-chip {
    background: linear-gradient(135deg, rgba(244, 63, 94, 0.25), rgba(168, 85, 247, 0.25)) !important;
    border: 1px solid rgba(244, 63, 94, 0.5) !important;
    box-shadow: 0 0 16px rgba(244, 63, 94, 0.3);
    animation: pulse-headi-chip 2s ease-in-out infinite;
}

@keyframes pulse-headi-chip {
    0%, 100% { box-shadow: 0 0 12px rgba(244, 63, 94, 0.25); transform: scale(1); }
    50%      { box-shadow: 0 0 24px rgba(244, 63, 94, 0.6); transform: scale(1.05); }
}

.search-glow-wrap.overdrive {
    animation: rotate-gradient 0.8s linear infinite !important;
    box-shadow: 0 0 50px rgba(244, 63, 94, 0.75), 0 0 80px rgba(168, 85, 247, 0.45);
}

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