/* Migra Aviso - Premium Styles */
:root {
    --bg-color: #0b1121; /* Very dark blue, HighTech feel */
    --surface-color: #1e293b;
    --primary-color: #3b82f6; /* Modern Blue */
    --primary-hover: #2563eb;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-red: #ef4444; /* Critical */
    --accent-yellow: #eab308; /* Warning */
    --accent-blue: #0ea5e9; /* Info */
    --border-color: #334155;
    --whatsapp-color: #25D366;
    --accent-purple: #a855f7; /* Sponsored */
}

* {
    box-sizing: border-box;
}

body, html {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Preloader */
#preloader {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: var(--bg-color);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease;
}
.loader-bar {
    width: 200px;
    height: 4px;
    background: var(--surface-color);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 20px;
}
.loader-progress {
    width: 0%;
    height: 100%;
    background: var(--primary-color);
    box-shadow: 0 0 10px var(--primary-color);
    animation: loading 1.5s ease-in-out forwards;
}

@keyframes loading {
    0% { width: 0%; }
    100% { width: 100%; }
}

/* Header */
header {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-actions i {
    cursor: pointer;
    transition: transform 0.2s, color 0.2s;
    font-size: 1.2rem;
}

.header-actions i:hover {
    color: var(--primary-color) !important;
    transform: scale(1.1);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}
.logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
}
.logo-text {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

/* Filter Section */
.filter-section {
    max-width: 600px;
    margin: 1.5rem auto;
    padding: 0 1rem;
    display: flex;
    gap: 10px;
    align-items: center;
}
.filter-select {
    flex: 1;
    background: var(--surface-color);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    border-radius: 2rem;
    font-size: 1rem;
    appearance: none;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
}
.filter-select:focus { border-color: var(--primary-color); }

/* Feed */
.feed-container {
    max-width: 600px;
    margin: 0 auto 5rem auto;
    padding: 0 1rem;
    width: 100%;
}

.alert-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
}
.alert-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.3);
}

.new-alert-anim {
    animation: slideInDown 0.5s ease-out forwards;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.alert-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}
.alert-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.badge-critical { background: rgba(239, 68, 68, 0.2); color: var(--accent-red); }
.badge-warning { background: rgba(234, 179, 8, 0.2); color: var(--accent-yellow); }
.badge-info { background: rgba(14, 165, 233, 0.2); color: var(--accent-blue); }
.badge-paid { background: rgba(168, 85, 247, 0.2); color: var(--accent-purple); }

.alert-state {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
}
.alert-time {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.alert-content {
    font-size: 1.1rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    word-break: break-word;
}

.alert-actions {
    display: flex;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    gap: 15px;
}
.action-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
    transition: color 0.2s;
    padding: 5px 10px;
    border-radius: 20px;
}
.action-btn:hover { background: rgba(255,255,255,0.05); color: var(--primary-color); }
.action-btn.liked { color: #f43f5e; }
.action-btn.liked i { font-weight: 900; }

/* Ad Sponsored Card */
.alert-card.is-paid {
    border: 2px solid rgba(168, 85, 247, 0.3);
    background: linear-gradient(180deg, rgba(30, 41, 59, 1) 0%, rgba(168, 85, 247, 0.05) 100%);
    position: relative;
    overflow: hidden;
}
.alert-card.is-paid::before {
    content: 'SPONSORED';
    position: absolute;
    top: 10px;
    right: -30px;
    background: var(--accent-purple);
    color: white;
    font-size: 0.6rem;
    font-weight: 800;
    padding: 2px 35px;
    transform: rotate(45deg);
    z-index: 10;
}

/* Floating WhatsApp */
.fab-whatsapp {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--whatsapp-color);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    box-shadow: 0 10px 15px -3px rgba(37, 211, 102, 0.4);
    z-index: 100;
    transition: transform 0.2s;
    text-decoration: none;
}
.fab-whatsapp:hover { transform: scale(1.1); }

/* Modal Onboarding */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(11, 17, 33, 0.9);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}
.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}
.modal-content {
    background: var(--surface-color);
    padding: 2.5rem;
    border-radius: 1.5rem;
    width: 90%;
    max-width: 400px;
    text-align: center;
    border: 1px solid var(--border-color);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: translateY(20px);
    transition: transform 0.3s;
}
.modal-overlay.active .modal-content {
    transform: translateY(0);
}
.modal-content h2 { margin-top: 0; font-size: 1.5rem; }
.modal-content p { color: var(--text-secondary); margin-bottom: 1.5rem; }
.modal-content select {
    width: 100%;
    padding: 1rem;
    border-radius: 1rem;
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 1.5rem;
}
.modal-btn {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 1rem;
    background: var(--primary-color);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.modal-btn:hover { background: var(--primary-hover); }

/* New Alert Metadata Layout */
.alert-city {
    font-size: 0.85rem;
    color: var(--primary-color);
    font-weight: 700;
}

.alert-metadata-rows {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px dashed var(--border-color);
}

.meta-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: rgba(255,255,255,0.03);
    padding: 4px 10px;
    border-radius: 6px;
}

.meta-row i {
    color: var(--primary-color);
    font-size: 0.75rem;
}

.alert-media {
    margin: 1rem 0;
    border-radius: 0.75rem;
    overflow: hidden;
    background: #000;
}

.alert-media img, .alert-media video {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
    max-height: 500px;
    object-fit: contain;
}

.media-link {
    display: block;
    padding: 1.5rem;
    text-align: center;
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.media-link:hover {
    background: rgba(59, 130, 246, 0.2);
}

/* Utility */
.empty-state {
    text-align: center;
    color: var(--text-secondary);
    padding: 3rem 1rem;
}
