/**
 * Mobile Landscape Styles
 * Optimized for viewing Turkey's wide geography in horizontal orientation
 * Uses flexible breakpoint to catch landscape phones with high pixel density
 */

@media (max-width: 1024px) and (orientation: landscape), (max-height: 600px) and (orientation: landscape) {
    /* Ensure no gaps at top */
    body, html {
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden;
    }

    .app-container {
        top: 0 !important;
        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    /* Side Sheet Panels - Narrower for mobile */
    .left-panel,
    .right-panel {
        position: fixed;
        top: 0;
        bottom: 0;
        width: 240px; /* Further reduced for mobile */
        height: 100vh;
        background: var(--panel-bg);
        backdrop-filter: blur(20px);
        z-index: 2000;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        overflow-x: hidden;
        /* Enable momentum scrolling on iOS */
        -webkit-overflow-scrolling: touch;
    }

    /* Close button for mobile panels */
    .panel-close-btn {
        position: absolute;
        top: 8px;
        right: 8px;
        width: 32px;
        height: 32px;
        border-radius: 8px;
        background: rgba(0, 0, 0, 0.3);
        border: 1px solid var(--glass-border);
        color: var(--text-primary);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 10;
        transition: all 0.2s ease;
    }

    .panel-close-btn:active {
        background: rgba(0, 0, 0, 0.5);
        transform: scale(0.95);
    }

    .panel-close-btn i {
        font-size: 18px;
    }

    /* Left Panel - Slide from left */
    .left-panel {
        left: 0;
        border-right: 1px solid var(--glass-border);
        transform: translateX(-100%);
    }

    .left-panel.open {
        transform: translateX(0);
    }

    /* Right Panel - Slide from right */
    .right-panel {
        right: 0;
        border-left: 1px solid var(--glass-border);
        transform: translateX(100%);
    }

    .right-panel.open {
        transform: translateX(0);
    }

    /* Panel toggles hidden in landscape (use swipe gestures instead) */
    .panel-toggle {
        display: none;
    }

    /* Map Container - Full width */
    .map-container {
        flex: 1;
        width: 100vw;
        height: 100vh;
        position: relative;
    }

    /* Backdrop when panels are open */
    .panel-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1999;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    .panel-backdrop.visible {
        opacity: 1;
        pointer-events: auto;
    }

    /* Top Controls - Optimized for landscape */
    .top-controls {
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        transform: none !important;
        display: flex;
        justify-content: center;
        gap: 6px;
        padding: 6px;
        margin: 0;
        background: var(--panel-bg);
        backdrop-filter: blur(20px);
        border-radius: 0;
        border-top: none;
        border-left: none;
        border-right: none;
        border-bottom: 1px solid var(--glass-border);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        position: fixed !important;
        width: 100%;
        max-width: 100vw;
        box-sizing: border-box;
        z-index: 1500;
    }

    .control-btn {
        min-width: 44px;
        min-height: 44px;
        padding: 10px 14px;
        font-size: 14px;
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
    }

    .control-btn i {
        font-size: 18px;
    }

    /* Hide text labels, show only icons */
    .control-btn span:not(.live-dot) {
        display: none;
    }

    .control-btn .live-dot {
        display: inline-block;
    }

    /* Theme Toggle */
    .theme-toggle {
        scale: 0.9;
    }

    /* Legend Box - Bottom left corner */
    .legend-box {
        position: fixed;
        left: 12px;
        bottom: 12px;
        max-width: 260px;
        background: var(--panel-bg);
        backdrop-filter: blur(20px);
        border-radius: 12px;
        border: 1px solid var(--glass-border);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        z-index: 1500;
    }

    /* Legend when opened as modal on mobile */
    .legend-box.mobile-visible {
        max-width: 85vw;
        max-height: 70vh;
        left: 50%;
        top: 50%;
        bottom: auto;
        transform: translate(-50%, -50%);
    }

    .legend-header {
        padding: 10px 12px;
        font-size: 12px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        cursor: pointer;
        border-bottom: 1px solid var(--glass-border);
        background: rgba(0, 0, 0, 0.2);
    }

    .legend-content {
        padding: 10px;
        max-height: 180px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .legend-grid {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .legend-section {
        font-size: 10px;
    }

    .legend-subtitle {
        font-size: 9px;
        margin-bottom: 5px;
        font-weight: 600;
        opacity: 0.9;
    }

    .depth-scale,
    .magnitude-scale,
    .fault-scale {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 5px;
    }

    .depth-item,
    .magnitude-item,
    .fault-item {
        font-size: 9px;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 3px;
    }

    /* Mobile visible legend - extra compact */
    .legend-box.mobile-visible .legend-content {
        max-height: 60vh;
        padding: 12px;
    }

    .legend-box.mobile-visible .legend-grid {
        gap: 12px;
    }

    /* Live Status Indicator - position above Leaflet attribution */
    .live-status-indicator {
        bottom: 22px !important; /* Just above Leaflet attribution with minimal gap */
        right: 8px !important;
        padding: 4px 8px !important;
        font-size: 9px !important;
        border-radius: 6px !important;
        max-width: 180px !important; /* Similar width to Leaflet attribution */
        white-space: nowrap !important;
        overflow: hidden !important;
    }

    /* Leaflet attribution control */
    .leaflet-control-attribution {
        margin-bottom: 0 !important;
        margin-right: 0 !important;
        font-size: 9px !important;
    }

    .live-status-indicator .status-sources {
        display: none !important; /* Hide sources to save space */
    }

    .live-status-indicator .status-text {
        font-size: 9px !important;
    }

    .live-status-indicator .status-dot {
        width: 5px !important;
        height: 5px !important;
    }

    /* Left Panel Content Optimization */
    .left-panel .panel-header {
        display: none; /* Hide header in landscape to save space */
    }

    /* Logo - Much smaller for mobile */
    .left-panel > div:first-of-type {
        padding: 4px 8px !important;
        border-bottom: 1px solid var(--glass-border);
    }

    .left-panel img#sismikLogo {
        max-width: 180px;
        height: auto;
        max-height: 36px;
        object-fit: contain;
    }

    /* Search Section */
    .search-section {
        padding: 6px 8px;
    }

    .search-input {
        padding: 6px 8px;
        font-size: 11px;
        min-height: 32px;
    }

    .search-clear {
        right: 6px !important;
        padding: 3px !important;
    }

    /* Filter Section */
    .filter-section {
        padding: 6px 8px;
        overflow-y: auto;
        overflow-x: hidden;
        max-height: calc(100vh - 140px);
        box-sizing: border-box;
    }

    .filter-section * {
        box-sizing: border-box;
        max-width: 100%;
    }

    .filter-group {
        margin-bottom: 10px;
        overflow: hidden;
    }

    .filter-label {
        font-size: 10px;
        margin-bottom: 4px;
        font-weight: 600;
    }

    /* Custom date range container */
    #customDateRange {
        padding: 8px !important;
        margin-bottom: 8px;
    }

    #customDateRange > div {
        gap: 6px !important;
        margin-bottom: 8px !important;
    }

    #customDateRange label {
        font-size: 9px !important;
        margin-bottom: 3px !important;
    }

    /* Date inputs */
    .date-input {
        padding: 5px 6px;
        font-size: 10px;
        min-height: 28px;
        border-radius: 6px;
    }

    /* Apply button */
    #applyDateRange {
        padding: 6px 10px !important;
        font-size: 10px !important;
        margin-bottom: 8px !important;
    }

    /* Historical presets label */
    .historical-presets label {
        font-size: 9px !important;
        margin-bottom: 3px !important;
    }

    /* Historical presets grid */
    .historical-presets > div {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 4px !important;
    }

    /* Preset buttons */
    .preset-btn {
        padding: 4px 6px;
        font-size: 9px;
        min-height: 26px;
        border-radius: 5px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Range sliders */
    .range-slider {
        margin-top: 4px;
    }

    .range-value {
        font-size: 9px;
        margin-top: 3px;
    }

    .range-input {
        height: 4px;
    }

    /* Source filter chips */
    .source-chip {
        padding: 5px 8px;
        font-size: 10px;
        min-height: 28px;
        border-radius: 6px;
    }

    /* Source filter section container */
    .source-chips {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
    }

    /* Layer section heading */
    .filter-section h3 {
        font-size: 10px !important;
        margin-top: 12px !important;
        margin-bottom: 6px !important;
    }

    /* Layer chips container */
    .layer-chips {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
    }

    /* Layer chips */
    .layer-chip {
        padding: 6px 10px;
        font-size: 10px;
        min-height: 30px;
        border-radius: 6px;
        flex: 0 1 auto;
    }

    /* Animation toggle */
    .animation-toggle {
        margin-top: 6px !important;
    }

    .toggle-label {
        font-size: 10px;
    }

    .toggle-slider {
        width: 44px;
        height: 24px;
    }

    .toggle-slider::after {
        width: 20px;
        height: 20px;
    }

    /* Stats Section - Single row of 4 boxes */
    .stats-section {
        padding: 4px;
        border-top: 1px solid var(--glass-border);
    }

    .stats-grid {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 3px;
    }

    .stat-card {
        padding: 3px 4px;
        border-radius: 4px;
        min-width: 0; /* Allow shrinking */
        overflow: hidden;
    }

    .stat-value {
        font-size: 11px;
        font-weight: 700;
        margin-bottom: 1px;
        line-height: 1.1;
        white-space: nowrap;
    }

    .stat-label {
        font-size: 7px;
        opacity: 0.8;
        line-height: 1.1;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Right Panel - Earthquake List - Ultra Compact */
    .right-panel .panel-header {
        padding: 6px 40px 6px 8px; /* Add right padding for close button */
        border-bottom: 1px solid var(--glass-border);
        position: relative;
    }

    .brand-title {
        font-size: 12px;
        font-weight: 700;
        line-height: 1.2;
    }

    .brand-subtitle {
        font-size: 9px;
        opacity: 0.7;
        margin-top: 1px;
        line-height: 1.1;
    }

    /* Earthquake List - Fit more items */
    .earthquake-list {
        padding: 2px;
        overflow-y: auto;
        max-height: calc(100vh - 24px);
    }

    /* Redesigned card layout - two-line design with CSS Grid */
    .earthquake-item {
        padding: 6px 8px !important;
        margin-bottom: 2px !important;
        border-radius: 8px !important;
        min-height: 48px !important;
        cursor: pointer;
        transition: all 0.2s ease;
        display: grid !important;
        grid-template-columns: 38px auto auto !important;
        grid-template-rows: auto auto !important;
        gap: 2px 6px !important;
        position: relative;
        align-items: start !important;
    }

    .earthquake-item:hover {
        transform: none !important;
    }

    /* Magnitude badge - left side, spans both rows */
    .earthquake-magnitude {
        font-size: 13px !important;
        min-width: 38px !important;
        min-height: 38px !important;
        width: 38px !important;
        height: 38px !important;
        line-height: 38px !important;
        font-weight: 700 !important;
        padding: 0 !important;
        border-radius: 6px !important;
        text-align: center;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        grid-row: 1 / 3 !important;
        grid-column: 1 !important;
        align-self: center !important;
    }

    /* Location - first row, spans columns 2 and 3 */
    .earthquake-location {
        font-size: 11px !important;
        line-height: 1.3 !important;
        font-weight: 600 !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        color: rgba(255, 255, 255, 0.95);
        grid-row: 1 !important;
        grid-column: 2 / 4 !important;
    }

    /* Header - make children direct grid items */
    .earthquake-item .earthquake-header {
        display: contents !important;
    }

    /* Details (source badge) - second row, second column */
    .earthquake-details {
        grid-row: 2 !important;
        grid-column: 2 !important;
        margin: 0 !important;
        padding: 0 !important;
        height: auto !important;
        align-self: center !important;
    }

    /* Time - second row, third column */
    .earthquake-time {
        font-size: 9px !important;
        opacity: 0.6;
        line-height: 1.2 !important;
        font-weight: 400 !important;
        margin: 0 !important;
        padding: 0 !important;
        white-space: nowrap !important;
        grid-row: 2 !important;
        grid-column: 3 !important;
        align-self: center !important;
        text-align: right !important;
        justify-self: end !important;
    }

    .right-panel .earthquake-details,
    #rightPanel .earthquake-details,
    .earthquake-list .earthquake-details,
    .earthquake-list .earthquake-item .earthquake-details {
        display: inline-block !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Hide depth info completely */
    .earthquake-details .detail-item:has(.la-arrows-alt-v),
    .earthquake-details .detail-item:has(i),
    .detail-item:has(.la-arrows-alt-v),
    .detail-item:has(i) {
        display: none !important;
        height: 0 !important;
        visibility: hidden !important;
    }

    /* Detail items with source badges - inline */
    .earthquake-details .detail-item {
        margin: 0 !important;
        padding: 0 !important;
        display: inline-block !important;
    }

    /* Source badge - on second line after time */
    .earthquake-item .source-badge,
    .right-panel .source-badge,
    #rightPanel .source-badge {
        font-size: 8px !important;
        padding: 2px 4px !important;
        border-radius: 3px !important;
        min-height: auto !important;
        line-height: 1.2 !important;
        font-weight: 600 !important;
        display: inline-block !important;
        vertical-align: baseline !important;
    }

    /* Floating Action Buttons for Panel Access */
    .mobile-fab-left,
    .mobile-fab-right {
        position: fixed;
        top: 50%;
        transform: translateY(-50%);
        width: 48px;
        height: 64px;
        background: var(--primary);
        color: #ffffff;
        border: none;
        border-radius: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 1800;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .mobile-fab-left {
        left: 0;
        border-radius: 0 12px 12px 0;
    }

    .mobile-fab-right {
        right: 0;
        border-radius: 12px 0 0 12px;
    }

    .mobile-fab-left i,
    .mobile-fab-right i {
        font-size: 24px;
    }

    .mobile-fab-left:active,
    .mobile-fab-right:active {
        transform: translateY(-50%) scale(0.95);
    }

    /* Hide FABs when panels are open */
    .left-panel.open ~ .mobile-fab-left,
    .right-panel.open ~ .mobile-fab-right {
        opacity: 0;
        pointer-events: none;
    }

    /* Graph Modal Adjustments */
    .graph-modal {
        width: 90vw;
        max-width: 600px;
        max-height: 70vh;
    }

    .graph-modal-header {
        padding: 12px;
    }

    .graph-modal-title {
        font-size: 16px;
    }

    .graph-container {
        height: 240px;
    }

    /* Loading Overlay */
    .loading-overlay {
        z-index: 10001; /* Above everything */
    }

    /* Adjust Leaflet zoom controls - position below top toolbar */
    /* Match portrait mode specificity to override it */
    .leaflet-control-zoom,
    body .leaflet-control-zoom,
    body:has(.rotation-banner) .leaflet-control-zoom {
        top: 56px !important; /* Just below toolbar (padding 6px + button 44px + padding 6px = 56px) */
        bottom: auto !important;
        left: 12px !important;
        transition: top 0.3s ease;
    }

    .leaflet-control-zoom a {
        width: 40px !important;
        height: 40px !important;
        line-height: 40px !important;
        font-size: 20px !important;
    }

    /* Mobile Legend Button - Position in landscape */
    .mobile-legend-btn {
        bottom: 12px;
        z-index: 1600; /* Above legend box */
    }
}

/* Very small landscape screens (height < 400px) */
@media (max-width: 1024px) and (orientation: landscape) and (max-height: 400px) {
    .left-panel,
    .right-panel {
        width: 220px;
    }

    .filter-section {
        max-height: calc(100vh - 120px);
    }

    .legend-box {
        max-width: 180px;
        font-size: 9px;
    }

    .control-btn {
        min-width: 36px;
        min-height: 36px;
        padding: 6px;
    }

    .earthquake-magnitude {
        font-size: 10px !important;
        min-width: 28px !important;
        min-height: 28px !important;
        line-height: 28px !important;
    }

    .earthquake-item {
        min-height: 34px !important;
        padding: 2px 3px !important;
    }

    .earthquake-location {
        font-size: 8px !important;
    }

    .earthquake-time {
        font-size: 7px !important;
    }

    .stat-value {
        font-size: 10px !important;
    }

    .stat-label {
        font-size: 6px !important;
    }
}

/* ============================================================================
   INCREMENTAL RESPONSIVE OPTIMIZATIONS FOR 15 MOBILE SIZES
   Progressive enhancement from 480px to 1280px landscape width
   ============================================================================ */

/* 1. Small phones 520px+ (e.g., small Android landscape) */
@media (min-width: 520px) and (max-width: 1024px) and (orientation: landscape) {
    .earthquake-item {
        padding: 6px 9px !important;
        min-height: 49px !important;
        grid-template-columns: 39px auto auto !important;
    }

    .earthquake-magnitude {
        font-size: 13.5px !important;
        min-width: 39px !important;
        min-height: 39px !important;
        width: 39px !important;
        height: 39px !important;
    }

    .earthquake-location {
        font-size: 11.2px !important;
    }

    .earthquake-time,
    .source-badge {
        font-size: 8px !important;
    }
}

/* 2. iPhone SE landscape 568px+ */
@media (min-width: 568px) and (max-width: 1024px) and (orientation: landscape) {
    .earthquake-item {
        padding: 7px 9px !important;
        min-height: 50px !important;
        gap: 2px 7px !important;
        grid-template-columns: 40px auto auto !important;
    }

    .earthquake-magnitude {
        font-size: 14px !important;
        min-width: 40px !important;
        min-height: 40px !important;
        width: 40px !important;
        height: 40px !important;
    }

    .earthquake-location {
        font-size: 11.5px !important;
    }

    .earthquake-time,
    .source-badge {
        font-size: 8.5px !important;
    }
}

/* 3. Medium Android 640px+ */
@media (min-width: 640px) and (max-width: 1024px) and (orientation: landscape) {
    .earthquake-item {
        padding: 7px 10px !important;
        min-height: 52px !important;
        gap: 2px 7px !important;
        grid-template-columns: 41px auto auto !important;
    }

    .earthquake-magnitude {
        font-size: 14.5px !important;
        min-width: 41px !important;
        min-height: 41px !important;
        width: 41px !important;
        height: 41px !important;
    }

    .earthquake-location {
        font-size: 11.8px !important;
    }

    .earthquake-time,
    .source-badge {
        font-size: 8.8px !important;
    }
}

/* 4. iPhone 8 landscape 667px+ */
@media (min-width: 667px) and (max-width: 1024px) and (orientation: landscape) {
    .earthquake-item {
        padding: 7px 10px !important;
        min-height: 54px !important;
        gap: 3px 8px !important;
        grid-template-columns: 42px auto auto !important;
    }

    .earthquake-magnitude {
        font-size: 15px !important;
        min-width: 42px !important;
        min-height: 42px !important;
        width: 42px !important;
        height: 42px !important;
    }

    .earthquake-location {
        font-size: 12px !important;
    }

    .earthquake-time {
        font-size: 10px !important;
    }

    .source-badge {
        font-size: 9px !important;
        padding: 2px 5px !important;
    }
}

/* 5. iPhone 8 Plus landscape 736px+ */
@media (min-width: 736px) and (max-width: 1024px) and (orientation: landscape) {
    .earthquake-item {
        padding: 8px 10px !important;
        min-height: 56px !important;
        gap: 3px 8px !important;
        grid-template-columns: 44px auto auto !important;
    }

    .earthquake-magnitude {
        font-size: 15.5px !important;
        min-width: 44px !important;
        min-height: 44px !important;
        width: 44px !important;
        height: 44px !important;
    }

    .earthquake-location {
        font-size: 12.3px !important;
    }

    .earthquake-time {
        font-size: 10.3px !important;
    }

    .source-badge {
        font-size: 9px !important;
        padding: 2px 5px !important;
    }
}

/* 6. Medium-large Android 780px+ */
@media (min-width: 780px) and (max-width: 1024px) and (orientation: landscape) {
    .earthquake-item {
        padding: 8px 11px !important;
        min-height: 58px !important;
        gap: 3px 9px !important;
        grid-template-columns: 46px auto auto !important;
    }

    .earthquake-magnitude {
        font-size: 16px !important;
        min-width: 46px !important;
        min-height: 46px !important;
        width: 46px !important;
        height: 46px !important;
        border-radius: 7px !important;
    }

    .earthquake-location {
        font-size: 12.5px !important;
    }

    .earthquake-time {
        font-size: 10.5px !important;
    }

    .source-badge {
        font-size: 9.5px !important;
        padding: 2px 6px !important;
        border-radius: 4px !important;
    }
}

/* 7. iPhone X/11 Pro landscape 812px+ */
@media (min-width: 812px) and (max-width: 1024px) and (orientation: landscape) {
    .earthquake-item {
        padding: 8px 11px !important;
        min-height: 60px !important;
        gap: 3px 9px !important;
        grid-template-columns: 48px auto auto !important;
    }

    .earthquake-magnitude {
        font-size: 16.5px !important;
        min-width: 48px !important;
        min-height: 48px !important;
        width: 48px !important;
        height: 48px !important;
        border-radius: 7px !important;
    }

    .earthquake-location {
        font-size: 12.8px !important;
    }

    .earthquake-time {
        font-size: 10.8px !important;
    }

    .source-badge {
        font-size: 9.5px !important;
        padding: 2px 6px !important;
        border-radius: 4px !important;
    }
}

/* 8. iPhone 12/13/14 landscape 844px+ */
@media (min-width: 844px) and (max-width: 1024px) and (orientation: landscape) {
    .earthquake-item {
        padding: 9px 12px !important;
        min-height: 62px !important;
        gap: 3px 10px !important;
        border-radius: 9px !important;
        grid-template-columns: 50px auto auto !important;
    }

    .earthquake-magnitude {
        font-size: 17px !important;
        min-width: 50px !important;
        min-height: 50px !important;
        width: 50px !important;
        height: 50px !important;
        border-radius: 8px !important;
    }

    .earthquake-location {
        font-size: 13px !important;
        line-height: 1.35 !important;
    }

    .earthquake-time {
        font-size: 11px !important;
    }

    .source-badge {
        font-size: 10px !important;
        padding: 2px 7px !important;
        border-radius: 4px !important;
    }
}

/* 9. iPhone 11 Pro Max/XS Max landscape 896px+ */
@media (min-width: 896px) and (max-width: 1024px) and (orientation: landscape) {
    .earthquake-item {
        padding: 9px 12px !important;
        min-height: 64px !important;
        gap: 4px 10px !important;
        border-radius: 9px !important;
        grid-template-columns: 52px auto auto !important;
    }

    .earthquake-magnitude {
        font-size: 17.5px !important;
        min-width: 52px !important;
        min-height: 52px !important;
        width: 52px !important;
        height: 52px !important;
        border-radius: 8px !important;
    }

    .earthquake-location {
        font-size: 13.3px !important;
        line-height: 1.35 !important;
    }

    .earthquake-time {
        font-size: 11.3px !important;
    }

    .source-badge {
        font-size: 10px !important;
        padding: 3px 7px !important;
        border-radius: 5px !important;
    }
}

/* 10. iPhone 14 Pro Max landscape 926px+ (current target device) */
@media (min-width: 926px) and (max-width: 1024px) and (orientation: landscape) {
    .earthquake-item {
        padding: 10px 12px !important;
        min-height: 66px !important;
        gap: 4px 11px !important;
        border-radius: 10px !important;
        grid-template-columns: 54px auto auto !important;
    }

    .earthquake-magnitude {
        font-size: 18px !important;
        min-width: 54px !important;
        min-height: 54px !important;
        width: 54px !important;
        height: 54px !important;
        border-radius: 8px !important;
    }

    .earthquake-location {
        font-size: 13.5px !important;
        line-height: 1.4 !important;
    }

    .earthquake-time {
        font-size: 11.5px !important;
    }

    .source-badge {
        font-size: 10.5px !important;
        padding: 3px 8px !important;
        border-radius: 5px !important;
    }
}

/* 11. Large Android phones 960px+ */
@media (min-width: 960px) and (max-width: 1024px) and (orientation: landscape) {
    .earthquake-item {
        padding: 10px 13px !important;
        min-height: 68px !important;
        gap: 4px 12px !important;
        border-radius: 10px !important;
        grid-template-columns: 56px auto auto !important;
    }

    .earthquake-magnitude {
        font-size: 18.5px !important;
        min-width: 56px !important;
        min-height: 56px !important;
        width: 56px !important;
        height: 56px !important;
        border-radius: 9px !important;
    }

    .earthquake-location {
        font-size: 13.8px !important;
        line-height: 1.4 !important;
    }

    .earthquake-time {
        font-size: 11.8px !important;
    }

    .source-badge {
        font-size: 10.5px !important;
        padding: 3px 8px !important;
        border-radius: 5px !important;
    }
}

/* 12. iPad Mini landscape / Large tablets 1024px+ */
@media (min-width: 1024px) and (max-width: 1080px) and (orientation: landscape) {
    .earthquake-item {
        padding: 11px 14px !important;
        min-height: 70px !important;
        gap: 4px 12px !important;
        border-radius: 11px !important;
        grid-template-columns: 58px auto auto !important;
    }

    .earthquake-magnitude {
        font-size: 19px !important;
        min-width: 58px !important;
        min-height: 58px !important;
        width: 58px !important;
        height: 58px !important;
        border-radius: 9px !important;
    }

    .earthquake-location {
        font-size: 14px !important;
        line-height: 1.4 !important;
    }

    .earthquake-time {
        font-size: 12px !important;
    }

    .source-badge {
        font-size: 11px !important;
        padding: 3px 9px !important;
        border-radius: 5px !important;
    }
}

/* 13. High-res Android tablets 1080px+ */
@media (min-width: 1080px) and (max-width: 1180px) and (orientation: landscape) {
    .earthquake-item {
        padding: 12px 15px !important;
        min-height: 72px !important;
        gap: 5px 13px !important;
        border-radius: 12px !important;
        grid-template-columns: 60px auto auto !important;
    }

    .earthquake-magnitude {
        font-size: 19.5px !important;
        min-width: 60px !important;
        min-height: 60px !important;
        width: 60px !important;
        height: 60px !important;
        border-radius: 10px !important;
    }

    .earthquake-location {
        font-size: 14.3px !important;
        line-height: 1.45 !important;
    }

    .earthquake-time {
        font-size: 12.3px !important;
    }

    .source-badge {
        font-size: 11px !important;
        padding: 4px 9px !important;
        border-radius: 6px !important;
    }
}

/* 14. Extra-large tablets 1180px+ */
@media (min-width: 1180px) and (max-width: 1280px) and (orientation: landscape) {
    .earthquake-item {
        padding: 13px 16px !important;
        min-height: 74px !important;
        gap: 5px 14px !important;
        border-radius: 12px !important;
        grid-template-columns: 62px auto auto !important;
    }

    .earthquake-magnitude {
        font-size: 20px !important;
        min-width: 62px !important;
        min-height: 62px !important;
        width: 62px !important;
        height: 62px !important;
        border-radius: 10px !important;
    }

    .earthquake-location {
        font-size: 14.5px !important;
        line-height: 1.45 !important;
    }

    .earthquake-time {
        font-size: 12.5px !important;
    }

    .source-badge {
        font-size: 11.5px !important;
        padding: 4px 10px !important;
        border-radius: 6px !important;
    }
}

/* 15. Very large tablets 1280px+ */
@media (min-width: 1280px) and (orientation: landscape) {
    .earthquake-item {
        padding: 14px 18px !important;
        min-height: 76px !important;
        gap: 5px 15px !important;
        border-radius: 13px !important;
        grid-template-columns: 64px auto auto !important;
    }

    .earthquake-magnitude {
        font-size: 21px !important;
        min-width: 64px !important;
        min-height: 64px !important;
        width: 64px !important;
        height: 64px !important;
        border-radius: 11px !important;
    }

    .earthquake-location {
        font-size: 15px !important;
        line-height: 1.5 !important;
    }

    .earthquake-time {
        font-size: 13px !important;
    }

    .source-badge {
        font-size: 12px !important;
        padding: 5px 11px !important;
        border-radius: 6px !important;
    }
}
