/* ============================================
   MADx Hub — Source Finder Styles
   v5.0 - Unified black/red/white theme
   ============================================ */

/* ========== MODAL ========== */

#source-finder-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    justify-content: flex-end;
    align-items: flex-start;
    pointer-events: none;
}

.sf-modal {
    background: #0a0a1a;
    border: 1px solid #333;
    border-top: 2px solid #e63946;
    color: #e0e0e0;
    width: 380px;
    max-height: 90vh;
    margin: 16px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    pointer-events: all;
    transition: all 0.3s ease;
}

/* Minimized state — not used anymore, kept for safety */
.sf-minimized .sf-form-body {
    display: none;
}

/* ========== FLOATING ARMED BAR (on map, outside modal) ========== */

.sf-armed-bar {
    display: none;
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1500;
    background: rgba(10, 10, 26, 0.95);
    color: #e63946;
    padding: 10px 20px;
    border-radius: 10px;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 0.95em;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    border: 2px solid #e63946;
}

.sf-armed-bar button {
    background: #222;
    border: 1px solid #333;
    color: #fff;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 0.85em;
    cursor: pointer;
    margin-left: 8px;
    transition: all 0.15s;
}

.sf-armed-bar button:hover {
    border-color: #e63946;
    background: #333;
}

.sf-armed-dot {
    width: 12px;
    height: 12px;
    background: #e63946;
    border-radius: 50%;
    animation: sf-armed-blink 1s infinite;
    flex-shrink: 0;
}

@keyframes sf-armed-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ========== HEADER ========== */

.sf-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #222;
}

.sf-header h2 {
    margin: 0;
    font-size: 1.1em;
    color: #fff;
}

.sf-close-btn {
    background: none;
    border: none;
    color: #666;
    font-size: 24px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.15s;
}

.sf-close-btn:hover {
    color: #e63946;
}

/* ========== FORM BODY ========== */

.sf-form-body {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
    transition: all 0.3s ease;
}

.sf-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sf-label {
    font-size: 0.8em;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sf-select,
.sf-input,
.sf-textarea {
    background: #111;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 10px 12px;
    color: #e0e0e0;
    font-size: 0.95em;
    outline: none;
    transition: border-color 0.2s;
}

.sf-select:focus,
.sf-input:focus,
.sf-textarea:focus {
    border-color: #e63946;
}

.sf-textarea {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.sf-shout-wrapper {
    position: relative;
}

.sf-shout-count {
    position: absolute;
    bottom: 8px;
    right: 10px;
    font-size: 0.75em;
    color: #666;
}

/* ========== ARM BUTTON ========== */

.sf-arm-btn {
    background: #e63946;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 14px;
    font-size: 1em;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.2s;
    margin: 4px 20px 16px 20px;
}

.sf-arm-btn:hover {
    background: #d32f3f;
    transform: scale(1.02);
}

/* ========== CONFIRMATION POPUP ========== */

.sf-confirm-popup .leaflet-popup-content-wrapper {
    background: #0a0a1a;
    color: #e0e0e0;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.sf-confirm-popup .leaflet-popup-tip {
    background: #0a0a1a;
}

/* ========== MAP PIN PULSE ========== */

.source-finder-pulse {
    animation: sf-pulse-ring 2s ease-out infinite;
}

@keyframes sf-pulse-ring {
    0% { stroke-opacity: 0.8; }
    50% { stroke-opacity: 0.2; }
    100% { stroke-opacity: 0.8; }
}

/* ========== DRAWER BUTTON BADGE ========== */

.sf-badge {
    display: none;
    background: #e63946;
    color: #fff;
    font-size: 0.7em;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 6px;
    vertical-align: middle;
}

/* ========== RESPONSIVE ========== */

@media (max-width: 768px) {
    .sf-modal {
        width: calc(100% - 32px);
        max-height: 80vh;
    }
}