/* Custom styles for Idaho Septic Permit Search - Polished Edition */

/* ========== CSS Variables ========== */
:root {
    --poop-dark: #1a120b;
    --poop-medium: #2d1f14;
    --poop-light: #4a3728;
    --amber-glow: rgba(251, 191, 36, 0.15);
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.12);
    --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========== Hero Section ========== */
.hero-gradient {
    background:
        radial-gradient(ellipse at 20% 0%, rgba(180, 83, 9, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(146, 64, 14, 0.1) 0%, transparent 50%),
        linear-gradient(135deg, #1a120b 0%, #2d1f14 40%, #1a120b 100%);
    color: #ffffff;
    position: relative;
    overflow: hidden;
}

.hero-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.015'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.hero-title {
    background: linear-gradient(135deg, #fcd34d 0%, #ffffff 50%, #fcd34d 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shine 8s linear infinite;
}

@keyframes shine {
    to { background-position: 200% center; }
}

/* Animated poop mascot */
@keyframes poop-bounce {
    0%, 100% { transform: translateY(0) rotate(-3deg); }
    50% { transform: translateY(-12px) rotate(3deg); }
}

@keyframes stink-float {
    0%, 100% { opacity: 0.7; transform: translateY(0) scale(1); }
    50% { opacity: 0.3; transform: translateY(-10px) scale(1.15); }
}

@keyframes pulse-glow {
    0%, 100% { filter: drop-shadow(0 10px 25px rgba(180, 83, 9, 0.3)); }
    50% { filter: drop-shadow(0 15px 35px rgba(180, 83, 9, 0.5)); }
}

.poop-mascot {
    animation: poop-bounce 2.5s ease-in-out infinite, pulse-glow 3s ease-in-out infinite;
}

.stink-wave {
    animation: stink-float 2s ease-in-out infinite;
}

.stink-wave:nth-child(2) { animation-delay: 0.3s; }
.stink-wave:nth-child(3) { animation-delay: 0.6s; }

/* ========== Stat Cards ========== */
.hero-stat-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    transition: all 0.3s var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.hero-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s ease;
}

.hero-stat-card:hover::before {
    left: 100%;
}

.hero-stat-card:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.3);
}

.stat-number {
    font-variant-numeric: tabular-nums;
    transition: transform 0.3s var(--transition-smooth);
}

.hero-stat-card:hover .stat-number {
    transform: scale(1.05);
}

.stat-icon {
    transition: transform 0.3s var(--transition-smooth);
}

.hero-stat-card:hover .stat-icon {
    transform: scale(1.2) rotate(-5deg);
}

/* ========== Search Box ========== */
.hero-search-box {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.hero-search-input {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    transition: all 0.3s var(--transition-smooth);
}

.hero-search-input:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(251, 191, 36, 0.5);
    outline: none;
    box-shadow:
        0 0 0 3px rgba(251, 191, 36, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.hero-search-input::placeholder {
    color: rgba(254, 243, 199, 0.4);
}

.hero-search-btn {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    box-shadow:
        0 4px 15px rgba(217, 119, 6, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.3s var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.hero-search-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.4s ease;
}

.hero-search-btn:hover::before {
    left: 100%;
}

.hero-search-btn:hover {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    transform: translateY(-2px);
    box-shadow:
        0 8px 25px rgba(217, 119, 6, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.hero-search-btn:active {
    transform: translateY(0);
}

/* ========== Feature Cards ========== */
.feature-card {
    background: white;
    border: 1px solid rgba(180, 83, 9, 0.1);
    transition: all 0.3s var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #d97706, #f59e0b, #d97706);
    transform: scaleX(0);
    transition: transform 0.3s var(--transition-smooth);
}

.feature-card:hover::before {
    transform: scaleX(1);
}

.feature-card:hover {
    transform: translateY(-6px);
    box-shadow:
        0 20px 40px -15px rgba(180, 83, 9, 0.2),
        0 0 0 1px rgba(180, 83, 9, 0.1);
    border-color: rgba(180, 83, 9, 0.2);
}

.feature-icon {
    transition: all 0.3s var(--transition-smooth);
}

.feature-card:hover .feature-icon {
    transform: scale(1.15) rotate(-5deg);
}

/* Knowledge base card special styling */
.feature-card-kb {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-color: rgba(16, 185, 129, 0.2);
}

.feature-card-kb:hover {
    box-shadow:
        0 20px 40px -15px rgba(16, 185, 129, 0.25),
        0 0 0 1px rgba(16, 185, 129, 0.15);
}

.feature-card-kb::before {
    background: linear-gradient(90deg, #10b981, #34d399, #10b981);
}

/* ========== Map Section ========== */
#map {
    height: 600px;
    width: 100%;
    border-radius: 0.75rem;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

.map-controls-card {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

/* District Filter Buttons */
.district-btn {
    transition: all 0.2s var(--transition-smooth);
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.district-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.district-btn:hover::before {
    width: 200%;
    height: 200%;
}

.district-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.15);
}

.district-btn:active {
    transform: translateY(0);
}

.district-btn.active {
    ring: 2px;
    ring-offset: 2px;
    transform: translateY(-1px);
}

/* District-specific button colors */
.district-btn-all {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-color: #f59e0b;
    color: #92400e;
}

.district-btn-all:hover, .district-btn-all.active {
    background: linear-gradient(135deg, #fde68a 0%, #fcd34d 100%);
}

.district-btn-panhandle {
    border-color: #3b82f6;
}

.district-btn-panhandle:hover, .district-btn-panhandle.active {
    background: #eff6ff;
    border-color: #2563eb;
}

.district-btn-southwest {
    border-color: #22c55e;
}

.district-btn-southwest:hover, .district-btn-southwest.active {
    background: #f0fdf4;
    border-color: #16a34a;
}

.district-btn-central {
    border-color: #a855f7;
}

.district-btn-central:hover, .district-btn-central.active {
    background: #faf5ff;
    border-color: #9333ea;
}

.district-btn-southcentral {
    border-color: #f59e0b;
}

.district-btn-southcentral:hover, .district-btn-southcentral.active {
    background: #fffbeb;
    border-color: #d97706;
}

/* ========== Permit Table ========== */
.permit-table {
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.permit-table thead {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.permit-table th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    color: #64748b;
    border-bottom: 2px solid #e2e8f0;
}

.permit-table tbody tr {
    transition: all 0.15s var(--transition-smooth);
}

.permit-table tbody tr:hover {
    background: linear-gradient(90deg, #fffbeb 0%, #fef3c7 50%, #fffbeb 100%);
}

/* District Badge Pills */
.district-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    transition: all 0.2s var(--transition-smooth);
}

.district-badge:hover {
    transform: scale(1.05);
}

.district-badge-panhandle {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
    border: 1px solid #93c5fd;
}

.district-badge-southwest {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #166534;
    border: 1px solid #86efac;
}

.district-badge-central {
    background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
    color: #6b21a8;
    border: 1px solid #c4b5fd;
}

.district-badge-southcentral {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border: 1px solid #fcd34d;
}

/* View Document Button */
.view-doc-btn {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 1px solid #cbd5e1;
    color: #475569;
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.2s var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.view-doc-btn:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    border-color: #b45309;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px -2px rgba(217, 119, 6, 0.3);
}

/* ========== Leaflet Customizations ========== */
.leaflet-popup-content-wrapper {
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
    border: 1px solid #e2e8f0;
}

.leaflet-popup-content {
    max-width: 300px;
    margin: 0.75rem;
}

.leaflet-popup-content h3 {
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #1e293b;
    font-size: 0.95rem;
}

.leaflet-popup-tip {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Poop emoji markers */
.poop-marker {
    background: transparent !important;
    border: none !important;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    transition: transform 0.2s var(--transition-smooth);
}

.poop-marker:hover {
    transform: scale(1.2);
}

/* ========== Marker Cluster Styling ========== */
.marker-cluster {
    background-clip: padding-box;
    border-radius: 50%;
}

.marker-cluster div {
    width: 32px;
    height: 32px;
    margin-left: 4px;
    margin-top: 4px;
    text-align: center;
    border-radius: 50%;
    font-weight: 700;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.marker-cluster-small {
    background-color: rgba(59, 130, 246, 0.3);
}
.marker-cluster-small div {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.marker-cluster-medium {
    background-color: rgba(168, 85, 247, 0.3);
}
.marker-cluster-medium div {
    background: linear-gradient(135deg, #a855f7 0%, #9333ea 100%);
    color: white;
}

.marker-cluster-large {
    background-color: rgba(239, 68, 68, 0.3);
}
.marker-cluster-large div {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

/* ========== Footer ========== */
.footer-gradient {
    background: linear-gradient(to bottom, #1e293b 0%, #0f172a 100%);
}

.footer-quote {
    position: relative;
    padding-left: 1rem;
}

.footer-quote::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, #fbbf24, #f59e0b);
    border-radius: 2px;
}

/* ========== Utility Classes ========== */
.highlight {
    background: linear-gradient(135deg, #fef08a 0%, #fde047 100%);
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-weight: 500;
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Focus visible for accessibility */
:focus-visible {
    outline: 2px solid #f59e0b;
    outline-offset: 2px;
}

/* Loading spinner animation */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Pulse animation for loading states */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Counter animation */
@keyframes countUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.count-up {
    animation: countUp 0.5s var(--transition-smooth) forwards;
}

/* Map hidden state */
.map-hidden {
    display: none;
}

/* ========== CESSPOOL LASSO FEATURE STYLES ========== */
/* "Lasso the Turds" - Custom styling for Leaflet.draw controls */

/* Override Leaflet.draw toolbar to match poop theme */
.leaflet-draw-toolbar {
    background: linear-gradient(135deg, #2d1f14 0%, #1a120b 100%) !important;
    border: 2px solid #8B4513 !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
    overflow: hidden;
}

.leaflet-draw-toolbar a {
    background-color: transparent !important;
    border: none !important;
    border-bottom: 1px solid rgba(139, 69, 19, 0.3) !important;
    transition: all 0.2s ease !important;
}

.leaflet-draw-toolbar a:last-child {
    border-bottom: none !important;
}

.leaflet-draw-toolbar a:hover {
    background-color: rgba(210, 105, 30, 0.3) !important;
}

.leaflet-draw-toolbar a.leaflet-draw-toolbar-button-enabled {
    background-color: rgba(210, 105, 30, 0.5) !important;
}

/* Custom tooltip for draw actions */
.leaflet-draw-tooltip {
    background: linear-gradient(135deg, #2d1f14 0%, #1a120b 100%) !important;
    border: 2px solid #8B4513 !important;
    border-radius: 8px !important;
    color: #fcd34d !important;
    font-weight: 500 !important;
    padding: 8px 12px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

.leaflet-draw-tooltip:before {
    border-right-color: #8B4513 !important;
}

.leaflet-draw-tooltip-single {
    margin-top: -10px !important;
}

/* Vertex icon for polygon drawing */
.cesspool-vertex-icon {
    background: #D2691E !important;
    border: 2px solid #8B4513 !important;
    border-radius: 50% !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) !important;
}

/* Edit toolbar styling */
.leaflet-draw-actions {
    background: linear-gradient(135deg, #2d1f14 0%, #1a120b 100%) !important;
    border: 2px solid #8B4513 !important;
    border-radius: 6px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
    padding: 4px !important;
}

.leaflet-draw-actions li {
    background: transparent !important;
    border: none !important;
}

.leaflet-draw-actions a {
    background: rgba(210, 105, 30, 0.2) !important;
    color: #fcd34d !important;
    border-radius: 4px !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
}

.leaflet-draw-actions a:hover {
    background: rgba(210, 105, 30, 0.4) !important;
    color: #fff !important;
}

/* Cesspool active banner */
.cesspool-banner {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid #d97706;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.2);
    animation: cesspool-pulse 2s ease-in-out infinite;
}

@keyframes cesspool-pulse {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(217, 119, 6, 0.2);
    }
    50% {
        box-shadow: 0 4px 20px rgba(217, 119, 6, 0.4);
    }
}

.cesspool-clear-btn {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
    border: none;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
    transition: all 0.2s ease;
}

.cesspool-clear-btn:hover {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
}

/* Drawn shape styling */
.leaflet-interactive.cesspool-shape {
    stroke: #8B4513 !important;
    stroke-width: 3 !important;
    fill: #D2691E !important;
    fill-opacity: 0.2 !important;
}

/* Poop icon in draw toolbar - custom sprites would go here */
/* For now we use the default Leaflet.draw icons */

/* Draw mode cursor */
.leaflet-container.leaflet-draw-crosshair {
    cursor: crosshair !important;
}

/* Draw section header (if we add one) */
.cesspool-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #2d1f14 0%, #1a120b 100%);
    border-radius: 8px 8px 0 0;
    color: #fcd34d;
    font-weight: 600;
    font-size: 14px;
}

/* Mobile responsive adjustments for draw toolbar */
@media (max-width: 768px) {
    .leaflet-draw-toolbar {
        transform: scale(0.9);
        transform-origin: top left;
    }

    .cesspool-banner {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }

    .cesspool-banner > div:first-child {
        justify-content: center;
    }
}

/* ========== CESSPOOL NAMING DIALOG ========== */
.cesspool-naming-dialog {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: cesspool-dialog-fade-in 0.2s ease-out;
}

@keyframes cesspool-dialog-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.cesspool-dialog-content {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 3px solid #8B4513;
    border-radius: 16px;
    padding: 24px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    animation: cesspool-dialog-slide-up 0.3s ease-out;
}

@keyframes cesspool-dialog-slide-up {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.cesspool-dialog-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.cesspool-dialog-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #78350f;
    margin: 0;
}

.cesspool-dialog-subtitle {
    color: #92400e;
    font-size: 0.875rem;
    margin: 0 0 16px 0;
}

.cesspool-name-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #d97706;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    color: #78350f;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.cesspool-name-input:focus {
    outline: none;
    border-color: #8B4513;
    box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.2);
}

.cesspool-name-input::placeholder {
    color: #b45309;
    opacity: 0.6;
}

.cesspool-dialog-buttons {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    justify-content: flex-end;
}

.cesspool-btn-cancel {
    padding: 10px 20px;
    border: 2px solid #d97706;
    background: transparent;
    color: #92400e;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cesspool-btn-cancel:hover {
    background: rgba(217, 119, 6, 0.1);
}

.cesspool-btn-save {
    padding: 10px 20px;
    border: none;
    background: linear-gradient(135deg, #8B4513 0%, #654321 100%);
    color: #fcd34d;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(139, 69, 19, 0.3);
}

.cesspool-btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(139, 69, 19, 0.4);
}

/* ========== CESSPOOL MANAGER PANEL ========== */
.cesspool-manager {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 2px solid #d97706;
    border-radius: 12px;
    margin-bottom: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.15);
    transition: all 0.3s ease;
}

.cesspool-manager.hidden {
    display: none;
}

.cesspool-manager.collapsed .cesspool-list {
    display: none;
}

.cesspool-manager-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(135deg, #fde68a 0%, #fcd34d 100%);
    border-bottom: 2px solid #d97706;
    cursor: pointer;
}

.cesspool-manager-header:hover {
    background: linear-gradient(135deg, #fcd34d 0%, #fbbf24 100%);
}

.cesspool-count-badge {
    background: #8B4513;
    color: #fef3c7;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    min-width: 20px;
    text-align: center;
}

.cesspool-manager-close {
    background: transparent;
    border: none;
    color: #78350f;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.cesspool-manager-close:hover {
    background: rgba(139, 69, 19, 0.1);
}

.cesspool-manager-close i {
    transition: transform 0.2s ease;
}

.cesspool-list {
    max-height: 300px;
    overflow-y: auto;
}

.cesspool-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    color: #92400e;
    text-align: center;
    gap: 8px;
}

.cesspool-empty i {
    color: #d97706;
}

.cesspool-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(217, 119, 6, 0.2);
    transition: all 0.2s ease;
}

.cesspool-item:last-child {
    border-bottom: none;
}

.cesspool-item:hover {
    background: rgba(217, 119, 6, 0.1);
}

.cesspool-item.inactive {
    opacity: 0.6;
}

.cesspool-item-color {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 2px solid;
    flex-shrink: 0;
}

.cesspool-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cesspool-item-name {
    font-weight: 600;
    color: #78350f;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cesspool-item-type {
    font-size: 0.75rem;
    color: #92400e;
    text-transform: capitalize;
}

.cesspool-item-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.cesspool-toggle-btn,
.cesspool-zoom-btn,
.cesspool-delete-btn {
    padding: 6px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cesspool-toggle-btn {
    background: rgba(139, 69, 19, 0.1);
    color: #78350f;
}

.cesspool-toggle-btn.active {
    background: #8B4513;
    color: #fcd34d;
}

.cesspool-toggle-btn:hover {
    background: #8B4513;
    color: #fcd34d;
}

.cesspool-zoom-btn {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
}

.cesspool-zoom-btn:hover {
    background: #2563eb;
    color: white;
}

.cesspool-delete-btn {
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
}

.cesspool-delete-btn:hover {
    background: #dc2626;
    color: white;
}

/* Mobile responsive adjustments for cesspool manager */
@media (max-width: 768px) {
    .cesspool-dialog-content {
        padding: 20px;
        margin: 16px;
    }

    .cesspool-dialog-buttons {
        flex-direction: column;
    }

    .cesspool-btn-cancel,
    .cesspool-btn-save {
        width: 100%;
        justify-content: center;
    }

    .cesspool-item {
        flex-wrap: wrap;
    }

    .cesspool-item-info {
        width: 100%;
        order: 2;
        margin-top: 8px;
    }

    .cesspool-item-actions {
        margin-left: auto;
    }
}

/* ========== CESSPOOL DRAWER (Slide-out Panel) ========== */
.cesspool-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 320px;
    max-width: 90vw;
    height: 100vh;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-left: 3px solid #8B4513;
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    transform: translateX(100%);
    transition: transform 0.3s var(--transition-smooth);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cesspool-drawer.open {
    transform: translateX(0);
}

.cesspool-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, #8B4513 0%, #654321 100%);
    color: #fcd34d;
    flex-shrink: 0;
}

.cesspool-drawer-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.1rem;
}

.cesspool-drawer-close {
    background: rgba(252, 211, 77, 0.2);
    border: none;
    color: #fcd34d;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cesspool-drawer-close:hover {
    background: rgba(252, 211, 77, 0.4);
    transform: rotate(90deg);
}

.cesspool-drawer-actions {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 2px solid rgba(217, 119, 6, 0.3);
    flex-shrink: 0;
}

.cesspool-action-btn {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid #d97706;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.cesspool-action-btn.select-all {
    background: rgba(139, 69, 19, 0.1);
    color: #78350f;
}

.cesspool-action-btn.select-all:hover {
    background: #8B4513;
    color: #fcd34d;
    border-color: #8B4513;
}

.cesspool-action-btn.select-none {
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
    border-color: #dc2626;
}

.cesspool-action-btn.select-none:hover {
    background: #dc2626;
    color: white;
}

.cesspool-action-btn.submit-leads {
    background: rgba(245, 158, 11, 0.15);
    color: #b45309;
    border-color: #f59e0b;
}

.cesspool-action-btn.submit-leads:hover {
    background: #f59e0b;
    color: white;
}

.cesspool-action-btn.submit-leads:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.cesspool-drawer-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.cesspool-drawer-item {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(217, 119, 6, 0.15);
    transition: all 0.2s ease;
}

.cesspool-drawer-item:hover {
    background: rgba(217, 119, 6, 0.08);
}

.cesspool-drawer-item.inactive {
    opacity: 0.5;
}

.cesspool-drawer-item.editing {
    background: rgba(59, 130, 246, 0.1);
    border-left: 4px solid #2563eb;
}

.cesspool-drawer-item-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.cesspool-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border: 3px solid;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    flex-shrink: 0;
}

.cesspool-checkbox:checked {
    background: var(--cesspool-color);
}

.cesspool-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.cesspool-checkbox:hover {
    transform: scale(1.1);
}

.cesspool-drawer-item-name {
    font-weight: 600;
    color: #78350f;
    font-size: 0.95rem;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cesspool-drawer-item-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 34px;
    font-size: 0.8rem;
    color: #92400e;
}

.cesspool-shape-badge {
    background: rgba(139, 69, 19, 0.15);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    text-transform: capitalize;
    font-weight: 500;
}

.cesspool-turd-count {
    font-weight: 600;
    color: #78350f;
}

.cesspool-drawer-item-actions {
    display: flex;
    gap: 6px;
    margin-left: 34px;
    margin-top: 10px;
}

.cesspool-edit-btn,
.cesspool-zoom-btn-drawer,
.cesspool-delete-btn-drawer {
    padding: 6px 10px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.cesspool-edit-btn {
    background: rgba(59, 130, 246, 0.15);
    color: #2563eb;
}

.cesspool-edit-btn:hover {
    background: #2563eb;
    color: white;
}

.cesspool-edit-btn.editing {
    background: #2563eb;
    color: white;
}

.cesspool-zoom-btn-drawer {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
}

.cesspool-zoom-btn-drawer:hover {
    background: #059669;
    color: white;
}

.cesspool-delete-btn-drawer {
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
}

.cesspool-delete-btn-drawer:hover {
    background: #dc2626;
    color: white;
}

/* Edit mode save/cancel buttons */
.cesspool-edit-controls {
    display: flex;
    gap: 6px;
    margin-left: 34px;
    margin-top: 8px;
    padding: 8px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 8px;
    border: 1px dashed #2563eb;
}

.cesspool-save-btn,
.cesspool-cancel-btn {
    flex: 1;
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.cesspool-save-btn {
    background: #059669;
    color: white;
}

.cesspool-save-btn:hover {
    background: #047857;
}

.cesspool-cancel-btn {
    background: #6b7280;
    color: white;
}

.cesspool-cancel-btn:hover {
    background: #4b5563;
}

.cesspool-drawer-footer {
    padding: 12px 16px;
    background: linear-gradient(135deg, #fde68a 0%, #fcd34d 100%);
    border-top: 2px solid #d97706;
    flex-shrink: 0;
}

.cesspool-drawer-stats {
    font-size: 0.85rem;
    color: #78350f;
    font-weight: 500;
    text-align: center;
}

.cesspool-drawer-footer-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
    padding: 10px;
    background: rgba(139, 69, 19, 0.1);
    border: 2px dashed #8B4513;
    border-radius: 8px;
    color: #78350f;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.cesspool-drawer-footer-link:hover {
    background: #8B4513;
    color: #fcd34d;
    border-style: solid;
}

/* Drawer toggle button on map */
.cesspool-drawer-toggle {
    position: absolute;
    top: 80px;
    right: 10px;
    z-index: 1000;
    background: linear-gradient(135deg, #8B4513 0%, #654321 100%);
    border: 3px solid #fcd34d;
    border-radius: 12px;
    padding: 10px 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fcd34d;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

.cesspool-drawer-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.cesspool-drawer-toggle.hidden {
    display: none;
}

.cesspool-drawer-toggle-count {
    background: #dc2626;
    color: white;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

/* Empty state in drawer */
.cesspool-drawer-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: #92400e;
}

.cesspool-drawer-empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.cesspool-drawer-empty-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 8px;
}

.cesspool-drawer-empty-text {
    font-size: 0.85rem;
    opacity: 0.8;
}

/* Overlay when drawer is open (for mobile) */
.cesspool-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.cesspool-drawer-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

/* Mobile responsive drawer */
@media (max-width: 768px) {
    .cesspool-drawer {
        width: 100%;
        max-width: 100vw;
    }

    .cesspool-drawer-toggle {
        top: auto;
        bottom: 20px;
        right: 20px;
    }
}
