/* ===================================
   Seismic Network Bangladesh - Global Styles
   =================================== */

/* Performance & Image Optimization */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Accessibility: Skip to main content link - hidden until focused */
a.skip-to-main {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 100;
    border-radius: 0 0 4px 0;
    display: inline-block;
    font-weight: 500;
}

a.skip-to-main:focus {
    top: 0;
}

/* Lazy loading placeholder */
img[loading="lazy"] {
    background-color: #f0f0f0;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200"><rect fill="%23f0f0f0" width="200" height="200"/></svg>');
    background-size: cover;
}

/* Responsive images with aspect ratio */
.hero-section img,
.event-image,
.station-image,
.blog-image {
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* WebP support with fallback */
picture img {
    width: 100%;
    height: auto;
}

/* Color Palette */
:root {
    --primary-color: #0b5ed7;
    --primary-hover: #0a58ca;
    --dark-bg: #2c3e50;
    --light-bg: #f8f9fa;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --text-dark: #2c3e50;
    --text-muted: #6c757d;
    --text-light: #ecf0f1;
}

/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-bg);
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* ===================================
   Navigation Styles
   =================================== */

.navbar {
    background-color: var(--dark-bg) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar.navbar-dark {
    background-color: #2c3e50 !important;
}

.navbar-brand {
    font-weight: bold;
    color: #fff !important;
    font-size: 1.25rem;
}

.navbar-brand i {
    font-size: 1.5rem;
    vertical-align: middle;
}

.nav-link {
    color: var(--text-light) !important;
    padding: 0.625rem 1rem !important;
    transition: color 0.3s ease, background-color 0.3s ease;
    border-radius: 4px;
    margin: 0 2px;
}

.nav-link:hover {
    color: var(--primary-color) !important;
    background-color: rgba(52, 152, 219, 0.1);
}

.nav-link.active {
    color: var(--primary-color) !important;
}

/* Dropdown Styles with Hover */
.dropdown:hover .dropdown-menu {
    display: block;
    margin-top: 0;
}

.dropdown-menu {
    background-color: var(--dark-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    padding: 0.5rem 0;
    animation: fadeIn 0.2s ease;
}

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

.dropdown-item {
    color: var(--text-light);
    padding: 0.625rem 1.25rem;
    transition: background-color 0.2s ease, color 0.2s ease;
    min-height: 44px;
    display: flex;
    align-items: center;
}

.dropdown-item:hover {
    background-color: var(--primary-color);
    color: #fff;
}

.dropdown-divider {
    margin: 0.5rem 0;
    border-color: rgba(255, 255, 255, 0.1);
}

/* ===================================
   Button Styles
   =================================== */

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transition: all 0.3s ease;
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

.btn-success {
    background-color: var(--success-color);
    border-color: var(--success-color);
}

.btn-warning {
    background-color: var(--warning-color);
    border-color: var(--warning-color);
}

.btn-danger {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
}

/* ===================================
   Card Styles
   =================================== */

.card {
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 8px;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.card-header {
    background-color: var(--primary-color);
    color: #fff;
    font-weight: 600;
    border-bottom: none;
}

/* Event Cards */
.event-card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.event-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* Magnitude Badge */
.magnitude-badge {
    font-size: 1.2rem;
    font-weight: bold;
    padding: 0.5rem 1rem;
    border-radius: 8px;
}

.magnitude-low {
    background-color: var(--success-color);
    color: #0b1f13;
}

.magnitude-medium {
    background-color: var(--warning-color);
    color: #2b1a00;
}

.magnitude-high {
    background-color: var(--danger-color);
    color: white;
}

/* ===================================
   Hero Section
   =================================== */

.hero-section {
    background: linear-gradient(135deg, var(--dark-bg) 0%, #34495e 100%);
    color: white;
    padding: 4rem 0;
    margin-bottom: 3rem;
}

.hero-section h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-section p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero-cta-group {
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-cta-btn {
    font-size: clamp(0.9rem, 1.1vw, 1rem);
    padding: clamp(0.5rem, 1.5vw, 0.65rem) clamp(0.9rem, 2.2vw, 1.25rem);
}

/* ===================================
   Carousel Styles
   =================================== */
.carousel-item {
    height: 400px;
}

.carousel-item img {
    object-fit: cover;
    height: 100%;
    width: 100%;
}

.carousel-caption {
    background-color: rgba(44, 62, 80, 0.8);
    padding: 1.5rem;
    border-radius: 8px;
}

.carousel-shell {
    position: relative;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 1rem 2.5rem rgba(15, 23, 42, 0.14);
    border: 1px solid rgba(44, 62, 80, 0.08);
    background: linear-gradient(180deg, #f8fbff 0%, #eef3f9 100%);
}

.carousel-shell .carousel-item {
    height: 420px;
    background: linear-gradient(135deg, #243447 0%, #2e4053 100%);
}

.carousel-item-frame {
    position: relative;
    height: 100%;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-item-frame img {
    max-height: 100%;
    max-width: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 0.5rem 1rem rgba(0, 0, 0, 0.18));
}

/* Caption stays at bottom */
.carousel-shell .carousel-caption {
    left: 50%;
    right: auto;
    bottom: 1.25rem;
    transform: translateX(-50%);
    width: min(92%, 560px);
    background: rgba(17, 24, 39, 0.72);
    backdrop-filter: blur(8px);
    padding: 0.9rem 1.1rem;
    z-index: 5;
}

.carousel-shell .carousel-caption p {
    margin: 0;
    font-weight: 500;
}

.carousel-shell .carousel-control-prev,
.carousel-shell .carousel-control-next {
    width: 4.5rem;
}

/* Move indicators to top */
.carousel-shell .carousel-indicators {
    top: 1rem;
    bottom: auto;
    margin-bottom: 0;
    z-index: 6;
}

.carousel-shell .carousel-indicators [data-bs-target] {
    width: 1.5rem;
    height: 1.5rem;
    margin: 0 0.4rem;
    border-radius: 999px;
}


.post-title-link {
    color: inherit;
    text-decoration: none;
}

.post-title-link:hover,
.post-title-link:focus,
.post-title-link:active {
    color: var(--primary-color);
    text-decoration: none;
}

.event-location-link {
    color: inherit;
    text-decoration: none;
}

.event-location-link:hover,
.event-location-link:focus,
.event-location-link:active {
    color: inherit;
    text-decoration: none;
}

/* ===================================
   Section Styles
   =================================== */

.section-title {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-dark);
    position: relative;
    padding-bottom: 0.5rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background-color: var(--primary-color);
}

.section-subtitle {
    color: #596068;
    margin-bottom: 2rem;
}

/* ===================================
   Post/Article Cards
   =================================== */

.post-card {
    margin-bottom: 2rem;
}

.post-card .card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
}

.post-card .card-text {
    color: var(--text-muted);
    line-height: 1.6;
}

.post-meta {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.post-meta i {
    margin-right: 0.25rem;
}

/* ===================================
   Pagination Styles
   =================================== */

.pagination {
    margin-top: 2rem;
}

.page-link {
    color: var(--primary-color);
    border-color: #dee2e6;
    transition: all 0.3s ease;
}

.page-link:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* ===================================
   Footer Styles
   =================================== */

.footer {
    background-color: var(--dark-bg);
    color: var(--text-light);
    margin-top: auto;
}

.footer h2, .footer h5, .footer h6 {
    color: #fff;
    margin-bottom: 1rem;
}

.footer-link {
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.3s ease;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}

.footer-link:hover {
    color: var(--primary-color);
    padding-left: 5px;
}

.footer .list-unstyled li {
    margin-bottom: 0.5rem;
}

/* ===================================
   Map Container
   =================================== */

.map-container {
    height: 400px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

/* ===================================
   Badge Styles
   =================================== */

.badge-notification {
    background-color: var(--danger-color);
    color: white;
    border-radius: 10px;
    padding: 2px 8px;
    font-size: 0.75rem;
    margin-left: 5px;
}

.status-badge {
    font-size: 0.85rem;
    padding: 0.25rem 0.5rem;
}

/* ===================================
   Utility Classes
   =================================== */

.text-primary-custom {
    color: var(--primary-color) !important;
}

.bg-primary-custom {
    background-color: var(--primary-color) !important;
}

.border-primary-custom {
    border-color: var(--primary-color) !important;
}

/* ===================================
   Responsive Styles
   =================================== */

@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .hero-section p {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .carousel-item {
        height: 250px;
    }
    
    .navbar-brand {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .hero-cta-btn {
        font-size: 0.85rem;
        padding: 0.45rem 0.75rem;
    }
}

/* ===================================
   Loading Animation
   =================================== */

.spinner-border-custom {
    color: var(--primary-color);
}

/* ===================================
   Form Styles
   =================================== */

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

/* ===================================
   Alert Styles
   =================================== */

.alert {
    border-radius: 8px;
    border: none;
}

.alert-success {
    background-color: rgba(39, 174, 96, 0.1);
    color: var(--success-color);
}

.alert-danger {
    background-color: rgba(231, 76, 60, 0.1);
    color: var(--danger-color);
}

.alert-warning {
    background-color: rgba(243, 156, 18, 0.1);
    color: var(--warning-color);
}

.alert-info {
    background-color: rgba(52, 152, 219, 0.1);
    color: var(--primary-color);
}
