/* ═══════════════════════════════════════════════════════
   ZERO-PATTERN — style.css
   All visual styles for the civic issue reporting UI.
   No icon libraries. No component frameworks. Pure CSS.
   ═══════════════════════════════════════════════════════ */

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

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #06060a;
    cursor: none;
    user-select: none;
    font-family: 'Space Grotesk', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

::-webkit-scrollbar { display: none; }
* { scrollbar-width: none; }


/* ═══════════════════════════════════════════
   CUSTOM CURSOR
   ═══════════════════════════════════════════ */
#cursor {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: width 0.25s ease, height 0.25s ease, background 0.25s ease;
    mix-blend-mode: difference;
}

#cursor.hovering {
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.1);
    border: 1.5px solid rgba(255, 255, 255, 0.5);
}


/* ═══════════════════════════════════════════
   BACKGROUND SHADER CANVAS
   ═══════════════════════════════════════════ */
#bg-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    display: block;
    width: 100%;
    height: 100%;
}


/* ═══════════════════════════════════════════
   CENTRAL PORTAL
   ═══════════════════════════════════════════ */
.portal-wrapper {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    pointer-events: none;
}

.portal {
    position: relative;
    width: 180px;
    height: 180px;
}

.portal-sphere {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    position: relative;
    z-index: 2;
    background: radial-gradient(
        circle at 36% 32%,
        #1c1c22 0%,
        #0d0d10 30%,
        #060608 55%,
        #000000 100%
    );
    box-shadow:
        0 0 60px rgba(0, 160, 210, 0.06),
        0 0 120px rgba(0, 120, 180, 0.03),
        inset -10px -10px 25px rgba(0, 0, 0, 0.95),
        inset 5px 5px 18px rgba(255, 255, 255, 0.025);
    animation: sphere-breathe 5s ease-in-out infinite;
    transition: box-shadow 0.6s ease;
}

.portal-highlight {
    position: absolute;
    top: 24%;
    left: 32%;
    width: 16px;
    height: 12px;
    background: radial-gradient(ellipse, rgba(255, 255, 255, 0.22), transparent 70%);
    border-radius: 50%;
    filter: blur(2px);
    z-index: 3;
    pointer-events: none;
    animation: sphere-breathe 5s ease-in-out infinite;
}

@keyframes sphere-breathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.035); }
}


/* ── Water Ripple Rings ── */
.ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.ring-1 {
    width: 230px;
    height: 230px;
    border: 1.5px solid rgba(0, 190, 230, 0.3);
    box-shadow:
        0 0 18px rgba(0, 190, 230, 0.1),
        inset 0 0 18px rgba(0, 190, 230, 0.04);
    animation: ring-pulse-1 4s ease-in-out infinite;
}

.ring-2 {
    width: 300px;
    height: 300px;
    border: 1px solid rgba(0, 170, 220, 0.15);
    box-shadow:
        0 0 25px rgba(0, 170, 220, 0.06),
        inset 0 0 20px rgba(0, 170, 220, 0.02);
    animation: ring-pulse-2 5s ease-in-out infinite;
}

.ring-3 {
    width: 380px;
    height: 380px;
    border: 0.5px solid rgba(0, 150, 210, 0.07);
    box-shadow: 0 0 30px rgba(0, 150, 210, 0.03);
    animation: ring-pulse-3 6s ease-in-out infinite;
}

@keyframes ring-pulse-1 {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    50% { transform: translate(-50%, -50%) scale(1.06); opacity: 0.6; }
}
@keyframes ring-pulse-2 {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.8; }
    50% { transform: translate(-50%, -50%) scale(1.08); opacity: 0.4; }
}
@keyframes ring-pulse-3 {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.6; }
    50% { transform: translate(-50%, -50%) scale(1.1); opacity: 0.25; }
}


/* ═══════════════════════════════════════════
   ISSUE ORBS
   ═══════════════════════════════════════════ */
#orb-canvas {
    position: fixed;
    inset: 0;
    z-index: 20;
    pointer-events: none;
}

.orb {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    z-index: 20;
    pointer-events: auto;
    touch-action: none;
    transition: transform 0.45s cubic-bezier(0.23, 1, 0.32, 1),
                filter 0.45s ease;
}

.orb:active { cursor: grabbing; }

.orb-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    position: relative;
    transition: filter 0.3s ease, box-shadow 0.3s ease;
}

/* Specular highlight on each orb */
.orb-inner::after {
    content: '';
    position: absolute;
    top: 18%;
    left: 25%;
    width: 28%;
    height: 20%;
    background: radial-gradient(ellipse, rgba(255, 255, 255, 0.3), transparent 70%);
    border-radius: 50%;
    filter: blur(3px);
    pointer-events: none;
}

.orb-label {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    white-space: nowrap;
    pointer-events: none;
}

.orb:hover .orb-label {
    opacity: 1;
    transform: translateX(-50%) translateY(4px);
}

.orb:hover {
    transform: scale(1.2) !important;
    z-index: 50 !important;
}

.orb:hover .orb-inner {
    filter: brightness(1.15) saturate(1.1);
}

/* Floating animation */
.floating { animation: orb-drift 18s ease-in-out infinite; }
.floating:nth-child(2) { animation-duration: 21s; animation-delay: -5s; }
.floating:nth-child(3) { animation-duration: 23s; animation-delay: -9s; }
.floating:nth-child(4) { animation-duration: 19s; animation-delay: -14s; }

@keyframes orb-drift {
    0%   { transform: translate(0, 0); }
    20%  { transform: translate(18px, -30px); }
    40%  { transform: translate(-12px, 10px); }
    60%  { transform: translate(22px, 18px); }
    80%  { transform: translate(-8px, -20px); }
    100% { transform: translate(0, 0); }
}


/* ── Power: Golden / Amber ── */
.orb-power .orb-inner {
    background: radial-gradient(circle at 36% 32%, #ffe082, #ffb300 45%, #e65100 100%);
    box-shadow:
        0 0 35px rgba(255, 179, 0, 0.45),
        0 0 80px rgba(255, 152, 0, 0.2),
        0 0 120px rgba(230, 81, 0, 0.08),
        inset -5px -5px 12px rgba(0, 0, 0, 0.25),
        inset 3px 3px 10px rgba(255, 255, 255, 0.15);
}
.orb-power .orb-label { color: #ffe082; }

/* ── Water: Vivid Cyan / Blue ── */
.orb-water .orb-inner {
    background: radial-gradient(circle at 36% 32%, #80deea, #00acc1 45%, #006064 100%);
    box-shadow:
        0 0 35px rgba(0, 172, 193, 0.5),
        0 0 80px rgba(0, 188, 212, 0.25),
        0 0 120px rgba(0, 96, 100, 0.1),
        inset -5px -5px 12px rgba(0, 0, 0, 0.25),
        inset 3px 3px 10px rgba(255, 255, 255, 0.12);
}
.orb-water .orb-label { color: #80deea; }

/* ── Road: Earthy Brown / Sienna ── */
.orb-road .orb-inner {
    background: radial-gradient(circle at 36% 32%, #bcaaa4, #795548 45%, #3e2723 100%);
    box-shadow:
        0 0 35px rgba(121, 85, 72, 0.4),
        0 0 80px rgba(62, 39, 35, 0.18),
        0 0 120px rgba(121, 85, 72, 0.06),
        inset -5px -5px 12px rgba(0, 0, 0, 0.35),
        inset 3px 3px 10px rgba(255, 255, 255, 0.08);
}
.orb-road .orb-label { color: #bcaaa4; }

/* ── Health: Crimson / Red ── */
.orb-health .orb-inner {
    background: radial-gradient(circle at 36% 32%, #ef9a9a, #d32f2f 45%, #7f0000 100%);
    box-shadow:
        0 0 35px rgba(211, 47, 47, 0.5),
        0 0 80px rgba(239, 83, 80, 0.22),
        0 0 120px rgba(127, 0, 0, 0.08),
        inset -5px -5px 12px rgba(0, 0, 0, 0.3),
        inset 3px 3px 10px rgba(255, 255, 255, 0.1);
}
.orb-health .orb-label { color: #ef9a9a; }


/* ═══════════════════════════════════════════
   SENT OVERLAY
   ═══════════════════════════════════════════ */
#sent-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

#sent-text {
    font-size: 68px;
    font-weight: 700;
    color: white;
    letter-spacing: 0.3em;
}

.sent-ripple {
    animation: ripple-text 2.4s ease-out forwards;
}

@keyframes ripple-text {
    0%   { letter-spacing: -0.3em; opacity: 0; transform: scale(0.5); filter: blur(18px); }
    18%  { letter-spacing: 0.5em;  opacity: 1; transform: scale(1);   filter: blur(0); }
    72%  { letter-spacing: 0.6em;  opacity: 1; transform: scale(1.04); filter: blur(0); }
    100% { letter-spacing: 1.5em;  opacity: 0; transform: scale(1.3);  filter: blur(28px); }
}


/* ═══════════════════════════════════════════
   AMBIENT PARTICLES
   ═══════════════════════════════════════════ */
.particle {
    position: fixed;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
    animation: particle-rise linear infinite;
}

@keyframes particle-rise {
    0%   { transform: translateY(0) scale(0); opacity: 0; }
    8%   { opacity: 1; transform: translateY(-8vh) scale(1); }
    88%  { opacity: 0.6; }
    100% { transform: translateY(-105vh) scale(0.5); opacity: 0; }
}


/* ═══════════════════════════════════════════
   RECORDING STATE
   ═══════════════════════════════════════════ */
.rec-indicator {
    position: absolute;
    top: 6%;
    right: 6%;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ef5350;
    z-index: 5;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.portal.recording .rec-indicator {
    opacity: 1;
    animation: rec-blink 0.9s ease-in-out infinite;
}

.portal.recording .portal-sphere {
    animation: recording-breathe 1.2s ease-in-out infinite;
}

.portal.recording .ring {
    animation-duration: 1.5s !important;
}

@keyframes rec-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.2; }
}

@keyframes recording-breathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.07); }
}


/* ═══════════════════════════════════════════
   PORTAL ABSORBED FLASH
   ═══════════════════════════════════════════ */
.portal-flash {
    animation: flash-burst 0.6s ease-out forwards;
}

@keyframes flash-burst {
    0%   { transform: scale(1); }
    30%  { transform: scale(1.12); }
    100% { transform: scale(1); }
}


/* ═══════════════════════════════════════════
   RECORDING VISUALIZER OVERLAY
   ═══════════════════════════════════════════ */
.rec-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 420px;
    height: 420px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 12;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rec-overlay.active {
    opacity: 1;
}

#rec-visualizer {
    width: 420px;
    height: 420px;
    position: absolute;
    top: 0;
    left: 0;
}

.rec-timer {
    position: absolute;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 28px;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.55);
    letter-spacing: 0.08em;
    opacity: 0;
    transition: opacity 0.3s ease;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.rec-overlay.active .rec-timer {
    opacity: 1;
}
