* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #dc3545;
    --bg-dark: #0d0d0d;
    --bg-card: #1a1a1a;
    --bg-input: #262626;
    --text: #f5f5f5;
    --text-muted: #888;
    --border: #333;
    --success: #28a745;
    --warning: #ffc107;
    --info: #17a2b8;
    --purple: #9c27b0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}

/* Splash Screen */
.splash {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, var(--primary) 0%, #8b0000 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s;
}

.splash.hidden {
    opacity: 0;
    pointer-events: none;
}

.splash-content {
    text-align: center;
    color: white;
}

.splash-content i {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.splash-content h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

/* App Container */
.app-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.app-header {
    background: var(--bg-card);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
    font-size: 1.1rem;
}

.header-left i {
    color: var(--primary);
    font-size: 1.4rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-badge {
    background: rgba(40, 167, 69, 0.2);
    color: var(--success);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-badge i {
    font-size: 0.5rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.3rem;
    position: relative;
    cursor: pointer;
}

.notif-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--primary);
    color: white;
    font-size: 0.65rem;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
}

/* Urgent Alerts */
.urgent-alerts {
    background: var(--primary);
    overflow: hidden;
}

.urgent-alert {
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

.urgent-alert i {
    font-size: 1.2rem;
}

.urgent-alert span {
    flex: 1;
    font-size: 0.9rem;
}

/* Tabs */
.tabs {
    display: none;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

.tab {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 12px;
    font-size: 0.85rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Tab Content */
.tab-content {
    flex: 1;
    overflow-y: auto;
    display: none;
    padding-bottom: 70px;
}

.tab-content.active {
    display: block;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

.filter-bar select {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
}

/* Feed List */
.feed-list {
    padding: 12px;
}

.feed-item {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 12px;
    border-left: 4px solid var(--primary);
}

.feed-item.tiroteio { border-left-color: #dc3545; }
.feed-item.operacao { border-left-color: #007bff; }
.feed-item.assalto { border-left-color: #ffc107; }
.feed-item.leiseca { border-left-color: #9c27b0; }

.feed-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.feed-tipo {
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(220, 53, 69, 0.2);
    color: var(--primary);
}

.feed-item.operacao .feed-tipo { background: rgba(0, 123, 255, 0.2); color: #007bff; }
.feed-item.assalto .feed-tipo { background: rgba(255, 193, 7, 0.2); color: #ffc107; }
.feed-item.leiseca .feed-tipo { background: rgba(156, 39, 176, 0.2); color: #9c27b0; }

.feed-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.feed-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.feed-location {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
}

.feed-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.feed-confirmations {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.feed-actions {
    display: flex;
    gap: 10px;
}

.feed-actions button {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
}

.feed-actions button.active {
    color: var(--primary);
}

/* Map */
#map {
    height: 100%;
    width: 100%;
}

.map-controls {
    position: absolute;
    bottom: 90px;
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
}

.map-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-card);
    border: none;
    color: var(--text);
    font-size: 1.2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    cursor: pointer;
}

/* Lei Seca */
.leiseca-header {
    text-align: center;
    padding: 30px 20px;
    background: linear-gradient(135deg, var(--purple) 0%, #6a1b9a 100%);
}

.leiseca-header i {
    font-size: 3rem;
    margin-bottom: 10px;
}

.leiseca-header h2 {
    margin-bottom: 5px;
}

.leiseca-header p {
    opacity: 0.8;
    font-size: 0.9rem;
}

.leiseca-list {
    padding: 16px;
}

.leiseca-item {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.leiseca-icon {
    width: 44px;
    height: 44px;
    background: rgba(156, 39, 176, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--purple);
    font-size: 1.2rem;
}

.leiseca-content {
    flex: 1;
}

.leiseca-local {
    font-weight: 600;
    margin-bottom: 3px;
}

.leiseca-time {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.leiseca-info {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
}

/* Alertas Config */
.alertas-config {
    padding: 20px;
    background: var(--bg-card);
    margin: 16px;
    border-radius: 12px;
}

.alertas-config h3 {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.config-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.config-item label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.config-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
}

.alertas-historico {
    padding: 0 16px 16px;
}

.alertas-historico h3 {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Bottom Nav */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
    z-index: 100;
}

.nav-item {
    background: none;
    border: none;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    font-size: 0.7rem;
    cursor: pointer;
    padding: 5px 15px;
}

.nav-item i {
    font-size: 1.3rem;
}

.nav-item.active {
    color: var(--primary);
}

.report-btn {
    color: var(--primary) !important;
}

.report-btn i {
    font-size: 2.5rem !important;
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    display: none;
    align-items: flex-end;
    z-index: 200;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    width: 100%;
    border-radius: 20px 20px 0 0;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-close {
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-body {
    padding: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 12px;
    border-radius: 8px;
    font-size: 1rem;
}

.form-group textarea {
    min-height: 80px;
    resize: none;
}

.tipo-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.tipo-btn {
    background: var(--bg-input);
    border: 2px solid var(--border);
    color: var(--text);
    padding: 15px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: all 0.2s;
}

.tipo-btn.active {
    border-color: var(--primary);
    background: rgba(220, 53, 69, 0.1);
}

.tipo-btn .emoji {
    font-size: 1.5rem;
}

.btn-location {
    width: 100%;
    background: var(--bg-input);
    border: 1px dashed var(--border);
    color: var(--text-muted);
    padding: 10px;
    border-radius: 8px;
    margin-top: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-block {
    width: 100%;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    color: var(--text);
    padding: 12px 24px;
    border-radius: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 300;
}

.toast.show {
    opacity: 1;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}


/* ===== MARCADORES PISCANTES ===== */
.marker-blink {
    animation: blink 1s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { 
        opacity: 1;
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }
    50% { 
        opacity: 0.6;
        transform: scale(1.2);
        box-shadow: 0 0 15px 5px rgba(220, 53, 69, 0.5);
    }
}

.marker-blink-blue {
    animation: blinkBlue 1s ease-in-out infinite;
}

@keyframes blinkBlue {
    0%, 100% { 
        opacity: 1;
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.7);
    }
    50% { 
        opacity: 0.6;
        transform: scale(1.2);
        box-shadow: 0 0 15px 5px rgba(0, 123, 255, 0.5);
    }
}

.marker-blink-yellow {
    animation: blinkYellow 1s ease-in-out infinite;
}

@keyframes blinkYellow {
    0%, 100% { 
        opacity: 1;
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.7);
    }
    50% { 
        opacity: 0.6;
        transform: scale(1.2);
        box-shadow: 0 0 15px 5px rgba(255, 193, 7, 0.5);
    }
}

.marker-blink-purple {
    animation: blinkPurple 1s ease-in-out infinite;
}

@keyframes blinkPurple {
    0%, 100% { 
        opacity: 1;
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(156, 39, 176, 0.7);
    }
    50% { 
        opacity: 0.6;
        transform: scale(1.2);
        box-shadow: 0 0 15px 5px rgba(156, 39, 176, 0.5);
    }
}


/* ===== ABA MOTORISTA ===== */
.motorista-header {
    text-align: center;
    padding: 25px 20px;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

.motorista-header i {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.motorista-header h2 {
    margin-bottom: 5px;
    font-size: 1.3rem;
}

.motorista-header p {
    opacity: 0.8;
    font-size: 0.9rem;
}

.motorista-location {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

.location-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.location-info i {
    color: var(--primary);
}

.btn-location-small {
    background: var(--primary);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.servico-filtros {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    overflow-x: auto;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

.servico-filtro {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-muted);
    font-size: 0.8rem;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
}

.servico-filtro.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.servico-filtro span {
    font-size: 1rem;
}

.servicos-list {
    padding: 12px 16px;
}

.servico-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 12px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.servico-card-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.servico-icon {
    width: 48px;
    height: 48px;
    background: rgba(59, 130, 246, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.servico-info {
    flex: 1;
    min-width: 0;
}

.servico-nome {
    font-weight: 600;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.servico-nome .verificado {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 10px;
}

.servico-tipo {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.servico-endereco {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.servico-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 0.8rem;
}

.servico-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #fbbf24;
}

.servico-distancia {
    color: var(--primary);
    font-weight: 600;
}

.servico-horario {
    color: var(--text-muted);
}

.servico-actions {
    display: flex;
    gap: 8px;
}

.servico-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
}

.servico-btn.btn-navegar {
    background: var(--bg-input);
    color: var(--text);
}

.servico-btn.btn-ligar {
    background: var(--bg-input);
    color: var(--text);
}

.servico-btn.btn-whatsapp {
    background: #25d366;
    color: white;
}

/* ===== SISTEMA DE LIKES ===== */
.feed-actions button {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border-radius: 8px;
    transition: all 0.2s;
}

.feed-actions button.liked {
    background: rgba(220, 53, 69, 0.2);
    color: var(--primary);
}

.feed-actions button.liked i {
    color: var(--primary);
}

.like-count {
    font-size: 0.8rem;
    font-weight: 500;
}

/* ===== EMPTY STATE ===== */
.empty-servicos {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-servicos i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}


/* ===== PWA INSTALL BANNER ===== */
.install-banner {
    position: fixed;
    bottom: 80px;
    left: 16px;
    right: 16px;
    background: linear-gradient(135deg, var(--primary) 0%, #b91c1c 100%);
    border-radius: 16px;
    padding: 0;
    z-index: 150;
    box-shadow: 0 8px 32px rgba(220, 53, 69, 0.4);
    transform: translateY(150%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.install-banner.show {
    transform: translateY(0);
    opacity: 1;
}

.install-banner-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
}

.install-banner-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.install-banner-icon i {
    font-size: 1.5rem;
    color: white;
}

.install-banner-text {
    flex: 1;
    min-width: 0;
}

.install-banner-text strong {
    display: block;
    color: white;
    font-size: 1rem;
    margin-bottom: 2px;
}

.install-banner-text small {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8rem;
}

.install-banner-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.install-btn-primary {
    background: white;
    color: var(--primary);
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.install-btn-primary:active {
    transform: scale(0.95);
}

.install-btn-dismiss {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
}

/* ===== LOCATION LOADING STATE ===== */
.location-info.loading {
    color: var(--primary);
}

.location-info.loading::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}
