/* bmkg.css - Enhanced page-specific styles for BMKG dashboard */
/* Relies on variables/utilities from core.css */

body.bmkg-body { 
    font-family: 'Poppins', sans-serif; 
    background-color: #f8fafc;
    color: #333; 
    line-height: 1.6; 
    overflow-x: hidden; 
}

.bmkg-main {
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Hero Section */
.bmkg-hero {
    background: white;
    border-radius: 15px;
    padding: 35px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    text-align: center;
    position: relative;
    overflow: hidden;
    border-top: 4px solid #3498db;
}

.bmkg-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(52,152,219,0.03) 0%, transparent 70%);
    animation: pulse-bg 15s ease-in-out infinite;
}

@keyframes pulse-bg {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.3; }
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.hero-title i {
    color: #3498db;
    animation: rotate 3s linear infinite;
}

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

.hero-subtitle {
    font-size: 1.1rem;
    color: #7f8c8d;
    margin-bottom: 20px;
}

.last-update-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #3498db;
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(52,152,219,0.3);
}

.last-update-badge i {
    animation: spin 2s linear infinite;
}

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

/* Alert Banner */
.alert-banner {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border-left: 5px solid;
    animation: slideIn 0.5s ease;
}

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

.alert-banner.warning {
    border-left-color: #f39c12;
    background: #fff9f0;
}

.alert-banner.danger {
    border-left-color: #e74c3c;
    background: #fff0f0;
}

.alert-banner.info {
    border-left-color: #3498db;
    background: #f0f8ff;
}

.alert-banner > i {
    font-size: 2rem;
}

.alert-banner.warning > i { color: #f39c12; }
.alert-banner.danger > i { color: #e74c3c; }
.alert-banner.info > i { color: #3498db; }

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: #2c3e50;
}

/* Stats cards */
.stats-container { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); 
    gap: 20px; 
    margin-bottom: 30px; 
}

.stat-card { 
    background: white;
    border-radius: 15px; 
    padding: 25px; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    position: relative; 
    overflow: hidden; 
    border-top: 4px solid;
}

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

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card.primary { border-top-color: #3498db; }
.stat-card.lampung { border-top-color: #16a085; }
.stat-card.danger { border-top-color: #e74c3c; }
.stat-card.warning { border-top-color: #f39c12; }

.stat-icon {
    font-size: 2.5rem;
    opacity: 0.2;
    position: absolute;
    right: 20px;
    top: 20px;
}

.stat-value { 
    font-size: 2.5rem; 
    font-weight: 700; 
    font-family: 'Montserrat', sans-serif;
    color: #2c3e50;
}

.stat-label {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-top: 5px;
    font-weight: 500;
}

.stat-subtext {
    font-size: 0.75rem;
    color: #95a5a6;
    margin-top: 3px;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-bottom: 30px;
}

.card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.card-header {
    background: #2c3e50;
    color: white;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    margin: 0;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.badge-live {
    background: #e74c3c;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(231,76,60,0.7); }
    50% { box-shadow: 0 0 0 10px rgba(231,76,60,0); }
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    animation: pulse-dot 1.5s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

.card-body {
    padding: 25px;
}

/* Latest Quake Styling */
.quake-main-info {
    text-align: center;
    margin-bottom: 30px;
}

.magnitude-display {
    margin-bottom: 20px;
}

.magnitude-circle {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    margin: 0 auto 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    position: relative;
    animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

.magnitude-circle::before {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    padding: 5px;
    background: linear-gradient(135deg, currentColor, transparent);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}

.magnitude-circle.magnitude-7 {
    background: #c0392b;
    color: white;
}

.magnitude-circle.magnitude-6 {
    background: #e74c3c;
    color: white;
}

.magnitude-circle.magnitude-5 {
    background: #e67e22;
    color: white;
}

.magnitude-circle.magnitude-4 {
    background: #f39c12;
    color: white;
}

.magnitude-circle.magnitude-3 {
    background: #3498db;
    color: white;
}

.magnitude-circle.magnitude-2 {
    background: #2ecc71;
    color: white;
}

.magnitude-value {
    font-size: 3.5rem;
    font-weight: 800;
    font-family: 'Montserrat', sans-serif;
    line-height: 1;
}

.magnitude-unit {
    font-size: 1.2rem;
    font-weight: 600;
    opacity: 0.9;
}

.magnitude-description {
    font-size: 1.1rem;
    font-weight: 600;
}

.severity-extreme { color: #c0392b; }
.severity-major { color: #e74c3c; }
.severity-strong { color: #e67e22; }
.severity-moderate { color: #f39c12; }
.severity-light { color: #3498db; }
.severity-minor { color: #2ecc71; }

.quake-location-info {
    margin-top: 20px;
}

.location-primary {
    font-size: 1.4rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.location-primary i {
    color: #e74c3c;
}

.location-badges {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.location-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.lampung-badge {
    background: #16a085;
    color: white;
}

.nearby-badge {
    background: #3498db;
    color: white;
}

/* Quake Details Grid */
.quake-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 25px 0;
}

.detail-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid #3498db;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
}

.detail-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.detail-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #3498db;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.detail-content {
    flex: 1;
}

.detail-label {
    font-size: 0.75rem;
    color: #7f8c8d;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.detail-value {
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-top: 2px;
}

/* Potential Warning */
.potential-warning {
    background: #fff9f0;
    border-left: 4px solid #f39c12;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
    display: flex;
    gap: 15px;
    align-items: start;
}

.warning-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #f39c12;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.warning-content {
    flex: 1;
}

.warning-title {
    font-size: 1rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 5px;
}

.warning-text {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.6;
}

/* Shakemap */
.shakemap-container { 
    margin-top: 20px; 
    text-align: center; 
    position: relative; 
}

.shakemap { 
    max-width: 100%; 
    border-radius: 12px; 
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border: 3px solid #f8f9fa;
    transition: all 0.3s ease;
}

.shakemap:hover { 
    transform: scale(1.02); 
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.shakemap-update { 
    font-size: 0.85rem; 
    color: #7f8c8d;
    margin-top: 12px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 8px;
    font-style: italic;
}

/* Tables */
.earthquake-list { 
    width: 100%; 
    border-collapse: separate; 
    border-spacing: 0; 
}

.earthquake-list thead th { 
    background: #2c3e50;
    color: #fff; 
    padding: 15px; 
    font-size: 0.9rem; 
    position: sticky; 
    top: 0; 
    z-index: 10;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.earthquake-list th:first-child { border-top-left-radius: 8px; }
.earthquake-list th:last-child { border-top-right-radius: 8px; }

.earthquake-list td { 
    padding: 15px; 
    border-bottom: 1px solid #ecf0f1;
    font-size: 0.9rem; 
    vertical-align: middle;
    transition: background 0.3s ease;
}

.earthquake-list tr:last-child td { border-bottom: none; }
.earthquake-list tbody tr:hover { background-color: #f8f9fa; }

.magnitude-badge { 
    display: inline-block; 
    padding: 6px 14px; 
    border-radius: 20px; 
    font-weight: 600;
    font-size: 0.85rem; 
    color: #fff; 
    min-width: 75px; 
    text-align: center; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.magnitude-2 { background: #2ecc71; }
.magnitude-3 { background: #3498db; }
.magnitude-4 { background: #f1c40f; }
.magnitude-5 { background: #e67e22; }
.magnitude-6 { background: #e74c3c; }
.magnitude-7 { background: #c0392b; }

.lampung-highlight { 
    background: rgba(22,160,133,0.05);
    position: relative;
    font-weight: 500;
}

.lampung-highlight::before { 
    content: ""; 
    position: absolute; 
    left: 0; 
    top: 0; 
    height: 100%; 
    width: 4px; 
    background: #16a085;
}

.distance-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 8px;
    background: #16a085;
    color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Tabs & Filters */
.tab-container { 
    margin-bottom: 30px; 
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.tabs { 
    display: flex; 
    border-bottom: 2px solid #ecf0f1;
    flex-wrap: wrap; 
    gap: 0;
    background: #f8f9fa;
}

.tab { 
    padding: 18px 28px; 
    cursor: pointer; 
    border-bottom: 3px solid transparent; 
    transition: all 0.3s ease;
    font-size: 0.95rem; 
    position: relative; 
    font-weight: 500; 
    color: #7f8c8d;
    flex: 1;
    text-align: center;
}

.tab::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: #3498db;
    transition: width 0.3s ease;
}

.tab:hover { 
    color: #2c3e50; 
    background-color: #f8f9fa;
}

.tab.active { 
    color: #3498db;
    font-weight: 600; 
    background: white;
}

.tab.active::before {
    width: 100%;
}

.tab-content { 
    display: none; 
    animation: fadeIn 0.4s ease;
    padding: 20px;
}

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

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

.filter-container { 
    display: flex; 
    gap: 12px; 
    margin-bottom: 20px; 
    flex-wrap: wrap; 
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.filter-btn { 
    padding: 10px 20px; 
    border-radius: 25px; 
    font-size: 0.85rem; 
    background: white;
    border: 2px solid #ecf0f1;
    cursor: pointer; 
    transition: all 0.3s ease;
    display: flex; 
    align-items: center; 
    gap: 8px; 
    font-weight: 500;
    color: #7f8c8d;
}

.filter-btn:hover { 
    border-color: #3498db;
    color: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52,152,219,0.2);
}

.filter-btn.active { 
    background: #16a085;
    color: #fff;
    border-color: #16a085;
    box-shadow: 0 4px 15px rgba(22,160,133,0.3);
}

.filter-btn i { font-size: 0.9rem; }

/* States */
.loading {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
}

.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 15px;
    border: 4px solid #ecf0f1;
    border-top-color: #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.error-message { 
    background: #fff0f0;
    color: #e74c3c;
    padding: 20px; 
    border-radius: 12px; 
    text-align: center; 
    margin: 20px 0; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 12px; 
    border-left: 4px solid #e74c3c;
    font-weight: 500;
}

.no-data { 
    text-align: center; 
    padding: 40px; 
    color: #95a5a6;
    font-size: 1rem;
}

.no-data i {
    font-size: 3rem;
    display: block;
    margin-bottom: 15px;
    opacity: 0.3;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn-lampung {
    background: #16a085;
    color: white;
}

.btn-lampung:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(22,160,133,0.3);
    background: #1abc9c;
}

/* Responsive */
@media (max-width: 992px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) { 
    .stats-container { 
        grid-template-columns: 1fr 1fr; 
    }
    
    .hero-title {
        font-size: 1.8rem;
    }
    
    .magnitude-circle {
        width: 150px;
        height: 150px;
    }
    
    .magnitude-value {
        font-size: 2.8rem;
    }
    
    .quake-details-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) { 
    .stats-container { 
        grid-template-columns: 1fr; 
    }
    
    .stat-value { 
        font-size: 2rem; 
    }
    
    .hero-title {
        font-size: 1.5rem;
        flex-direction: column;
        gap: 10px;
    }
    
    .magnitude-circle {
        width: 130px;
        height: 130px;
    }
    
    .magnitude-value {
        font-size: 2.3rem;
    }
    
    .tab { 
        padding: 12px 16px; 
        font-size: 0.85rem; 
    }
    
    .earthquake-list td, 
    .earthquake-list th { 
        padding: 10px; 
        font-size: 0.8rem; 
    }
    
    .bmkg-main {
        padding: 15px;
    }
}