/* ============================================================
   Rentool global styles — deep-space + violet glass aesthetic
   ============================================================ */

:root {
    --rt-indigo: #6366f1;
    --rt-violet: #8b5cf6;
    --rt-violet-light: #a78bfa;
    --rt-magenta: #c026d3;
    --rt-bg: #0a0a0f;
    --rt-surface: #12121c;
    --rt-surface-raised: #1a1a28;
    --rt-text: #f1f5f9;
    --rt-text-dim: #94a3b8;
    --rt-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #c026d3 100%);
    --rt-glow: 0 0 40px rgba(139, 92, 246, 0.25);
}

html {
    scroll-behavior: smooth;
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--rt-bg);
    color: var(--rt-text);
    font-family: 'Manrope', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--rt-bg); }
::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.3);
    border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(139, 92, 246, 0.5); }

::selection { background: rgba(139, 92, 246, 0.4); }

/* ---------- reusable brand pieces ---------- */

.rt-gradient-text {
    background: var(--rt-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.rt-glass {
    background: rgba(18, 18, 28, 0.6);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(139, 92, 246, 0.14);
}

.rt-card {
    background: linear-gradient(180deg, rgba(26, 26, 40, 0.85), rgba(18, 18, 28, 0.85));
    border: 1px solid rgba(139, 92, 246, 0.12);
    border-radius: 16px;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.rt-card-hover:hover {
    transform: translateY(-4px);
    border-color: rgba(139, 92, 246, 0.45);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 24px rgba(139, 92, 246, 0.18);
}

/* Floating gradient orbs (fixed, behind everything) */
.rt-orbs {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.rt-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.35;
    animation: rt-float 22s ease-in-out infinite;
}

.rt-orb-1 {
    width: 600px; height: 600px;
    background: radial-gradient(circle, #6366f1, transparent 70%);
    top: -220px; right: -120px;
}

.rt-orb-2 {
    width: 500px; height: 500px;
    background: radial-gradient(circle, #8b5cf6, transparent 70%);
    bottom: -180px; left: -120px;
    animation-duration: 18s;
    animation-delay: -6s;
}

.rt-orb-3 {
    width: 420px; height: 420px;
    background: radial-gradient(circle, #c026d3, transparent 70%);
    top: 40%; left: 55%;
    opacity: 0.12;
    animation-duration: 26s;
    animation-delay: -12s;
}

@keyframes rt-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -40px) scale(1.05); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(40px, 30px) scale(1.02); }
}

/* Entrance animation */
.rt-fade-up {
    animation: rt-fade-up 0.7s ease-out both;
}

@keyframes rt-fade-up {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Image shimmer while loading */
.rt-img-shimmer {
    background: linear-gradient(110deg, #14141f 30%, #1e1e2e 50%, #14141f 70%);
    background-size: 200% 100%;
    animation: rt-shimmer 1.6s linear infinite;
}

@keyframes rt-shimmer {
    to { background-position-x: -200%; }
}

/* FocusOnNavigate targets h1 — keep it for a11y but hide the outline box */
h1:focus, h1:focus-visible {
    outline: none;
}

/* Dialog surface (teleported to MudDialogProvider, so styled globally) */
.rt-getapp-dialog {
    background: linear-gradient(180deg, #1a1a28, #12121c) !important;
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 20px !important;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7), 0 0 40px rgba(139, 92, 246, 0.15) !important;
}

/* ---------- Blazor plumbing ---------- */

#blazor-error-ui {
    background: #1a1a28;
    color: var(--rt-text);
    border-top: 1px solid rgba(139, 92, 246, 0.3);
    bottom: 0;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.5);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 2000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: #2b0b1e;
    padding: 1rem;
    color: white;
    border-radius: 12px;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

/* ---------- Leaflet map (dark) ---------- */

.rt-map {
    width: 100%;
    height: 100%;
    background: #0e0e16;
    border-radius: 16px;
    z-index: 1;
}

.rt-dark-tiles {
    filter: invert(1) hue-rotate(200deg) brightness(0.7) contrast(1.05) saturate(0.25);
}

.leaflet-container {
    background: #0e0e16;
    font-family: 'Manrope', 'Inter', sans-serif;
}

.leaflet-control-attribution {
    background: rgba(10, 10, 15, 0.75) !important;
    color: #64748b !important;
    font-size: 10px;
}

.leaflet-control-attribution a { color: #8b5cf6 !important; }

.leaflet-control-zoom a {
    background: #1a1a28 !important;
    color: #e2e8f0 !important;
    border-color: rgba(139, 92, 246, 0.25) !important;
}

.leaflet-control-zoom a:hover { background: #262636 !important; }

.rt-pin-wrap { background: transparent; border: none; }

.rt-pin {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -100%);
    padding: 4px 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    font-weight: 700;
    font-size: 12px;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55), 0 0 12px rgba(139, 92, 246, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.25);
    cursor: pointer;
    transition: transform 0.15s ease;
}

.rt-pin:hover { transform: translate(-50%, -100%) scale(1.08); }

.leaflet-popup-content-wrapper {
    background: #1a1a28;
    color: #f1f5f9;
    border-radius: 14px;
    border: 1px solid rgba(139, 92, 246, 0.25);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    padding: 0;
}

.leaflet-popup-content { margin: 0; width: 210px !important; }
.leaflet-popup-tip { background: #1a1a28; }

.rt-popup { display: block; text-decoration: none; color: inherit; }
.rt-popup img { width: 100%; height: 110px; object-fit: cover; display: block; }

.rt-popup-noimg {
    width: 100%; height: 110px;
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem; background: #12121c;
}

.rt-popup-body { padding: 10px 12px 12px; }

.rt-popup-title {
    font-weight: 700; font-size: 0.85rem; line-height: 1.3;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.rt-popup-price { margin-top: 4px; color: #a78bfa; font-weight: 700; font-size: 0.8rem; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .rt-orb, .rt-fade-up, .rt-img-shimmer { animation: none; }
    html { scroll-behavior: auto; }
}
