/* ============================================
   AMAN HALAB - Complete Stylesheet
   Single file for Hostinger compatibility
   ============================================ */

/* === DESIGN TOKENS (Aman Halab — shadcn-inspired modern) === */
:root {
    --primary: #18181B;
    --primary-soft: #27272A;
    --primary-light: #F4F4F5;
    --primary-glow: rgba(24, 24, 27, 0.08);
    --primary-foreground: #FAFAFA;
    --accent: #B89A57;
    --accent-soft: #D4C08A;

    --success: #16A34A;
    --success-light: #DCFCE7;
    --warning: #EA580C;
    --warning-light: #FFF7ED;
    --danger: #DC2626;
    --danger-light: #FEF2F2;

    --bg: #FAFAFA;
    --bg-soft: #F4F4F5;
    --card: #FFFFFF;

    --text: #09090B;
    --text-secondary: #3F3F46;
    --text-muted: #71717A;
    --text-light: #A1A1AA;

    --border: #E4E4E7;
    --border-light: #F4F4F5;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-glow: none;

    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);

    --duration-fast: 150ms;
    --duration-normal: 250ms;
    --duration-slow: 400ms;

    --tab-bar-height: 56px;
    --sidebar-width: 80px;
    --panel-width: 440px;

    /* Z-Index Scale */
    --z-base: 0;
    --z-map: 1;
    --z-controls: 100;
    --z-header: 200;
    /* Tab bar uses this */
    --z-side-panel: 1500;
    /* Side panel in mobile view */
    --z-backdrop: 2000;
    /* Higher than side panel */
    --z-sheet: 2010;
    /* Higher than backdrop to appear on top */
    --z-modal: 2100;
    /* Higher than sheet for modals */
    --z-toast: 2200;
    /* Highest for toasts */
    --z-breaking-banner: 4000;
    /* Even higher for breaking news banner */
}

/* === GLASS MODE (Glassmorphism) === */
body.glass-mode .sidebar {
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(24px) saturate(1.8);
    -webkit-backdrop-filter: blur(24px) saturate(1.8);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2), 0 8px 32px rgba(0, 0, 0, 0.08);
}

body.glass-mode .side-panel {
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(28px) saturate(1.8);
    -webkit-backdrop-filter: blur(28px) saturate(1.8);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15), 0 8px 32px rgba(0, 0, 0, 0.1);
}

body.glass-mode .side-panel .panel-header {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

body.glass-mode .news-card {
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(16px) saturate(1.6);
    -webkit-backdrop-filter: blur(16px) saturate(1.6);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

body.glass-mode .news-card:hover {
    background: rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

body.glass-mode .tab-bar {
    background: rgba(255, 255, 255, 0.4) !important;
    backdrop-filter: blur(24px) saturate(1.8);
    -webkit-backdrop-filter: blur(24px) saturate(1.8);
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.06);
}

body.glass-mode .bottom-sheet {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(32px) saturate(2);
    -webkit-backdrop-filter: blur(32px) saturate(2);
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

body.glass-mode .map-btn {
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(16px) saturate(1.6);
    -webkit-backdrop-filter: blur(16px) saturate(1.6);
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

body.glass-mode .map-btn:hover {
    background: rgba(255, 255, 255, 0.65);
}

body.glass-mode .breaking-banner {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(20px) saturate(1.6);
    -webkit-backdrop-filter: blur(20px) saturate(1.6);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

body.glass-mode .report-modal-card {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(32px) saturate(2);
    -webkit-backdrop-filter: blur(32px) saturate(2);
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

body.glass-mode .settings-item {
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 14px 16px;
}

body.glass-mode .settings-group {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 8px;
}

body.glass-mode .pin-body {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

body.glass-mode .custom-pin .pin-body {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

body.glass-mode .mobile-bubble {
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(24px) saturate(1.8);
    -webkit-backdrop-filter: blur(24px) saturate(1.8);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

/* === RESET === */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Cairo', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 15px;
    line-height: 1.7;
    background: var(--bg);
    color: var(--text);
    height: 100vh;
    height: 100dvh;
    padding-top: env(safe-area-inset-top);
    overflow: hidden;
    -webkit-font-smoothing: auto;
    -moz-osx-font-smoothing: auto;
    -webkit-tap-highlight-color: transparent;
    text-rendering: optimizeLegibility;
    word-spacing: 0.02em;
    font-feature-settings: 'kern' 1;
}

::selection {
    background: var(--primary-light);
    color: var(--primary);
}

/* Focus visible for keyboard navigation (accessibility) */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--text-light);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* === BREAKING NEWS BANNER === */
.breaking-banner {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%) translateY(-120px);
    z-index: var(--z-breaking-banner);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    border-inline-start: 3px solid var(--danger);
    cursor: pointer;
    max-width: min(92vw, 480px);
    width: max-content;
    opacity: 0;
    transition: transform var(--duration-slow) var(--ease-spring),
        opacity var(--duration-slow) var(--ease-out);
}

.breaking-banner.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.breaking-banner-badge {
    background: var(--danger);
    color: white;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
    position: relative;
}

.breaking-banner-badge::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: var(--radius-full);
    background: var(--danger);
    opacity: 0.3;
    animation: badge-pulse 2s ease-in-out infinite;
    z-index: -1;
}

@keyframes badge-pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.3;
    }

    50% {
        transform: scale(1.15);
        opacity: 0;
    }
}

.breaking-banner-title {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}

.breaking-banner-close {
    background: var(--bg-soft);
    border: none;
    color: var(--text-muted);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background var(--duration-fast), color var(--duration-fast);
    min-width: 48px;
    min-height: 48px;
}

.breaking-banner-close:hover {
    background: var(--danger-light);
    color: var(--danger);
}

.breaking-banner[hidden] {
    display: none;
}

/* === APP LAYOUT === */
.app {
    display: flex;
    height: calc(100% - env(safe-area-inset-top));
    background: var(--bg);
}

/* === SIDEBAR (Desktop only) === */
.sidebar {
    width: var(--sidebar-width);
    background: var(--card);
    border-inline-start: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
    gap: 4px;
    z-index: 100;
}

.sidebar-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    text-align: center;
}

.sidebar-logo {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: opacity var(--duration-normal) var(--ease-out);
}

.sidebar-logo:hover {
    opacity: 0.85;
}

.sidebar-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-lg);
}

.sidebar-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0;
}

.sidebar-date {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.sidebar-item {
    width: 56px;
    height: 56px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    cursor: pointer;
    transition: color var(--duration-normal) var(--ease-out);
    border: none;
    background: transparent;
    position: relative;
    overflow: hidden;
    text-decoration: none;
}

.sidebar-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--bg-soft);
    border-radius: var(--radius-lg);
    opacity: 0;
    transform: scale(0.8);
    transition: opacity var(--duration-normal) var(--ease-out), transform var(--duration-normal) var(--ease-out);
}

.sidebar-item:hover::before,
.sidebar-item.active::before {
    opacity: 1;
    transform: scale(1);
}

.sidebar-item:hover,
.sidebar-item.active {
    color: var(--text);
}

.sidebar-item:active {
    transform: scale(0.92);
    transition-duration: 80ms;
}

.sidebar-item svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    stroke-width: 1.8;
    fill: none;
    position: relative;
    z-index: 1;
    transition: transform var(--duration-normal) var(--ease-spring);
}

.sidebar-item:hover svg {
    transform: scale(1.1);
}

.sidebar-item span {
    font-size: 12px;
    font-weight: 600;
    position: relative;
    z-index: 1;
    letter-spacing: 0;
    white-space: nowrap;
    margin-top: 2px;
}

/* === MAIN CONTENT === */
.main {
    flex: 1;
    position: relative;
    display: flex;
    overflow: hidden;
}

/* === MAP CONTAINER === */
.map-container {
    flex: 1;
    position: relative;
    min-width: 0;
}

#map {
    width: 100%;
    height: 100%;
}

/* City Label */
@keyframes pulse-dot {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.6;
        transform: scale(1.2);
    }
}

/* Map Controls */
.map-controls {
    position: absolute;
    bottom: 120px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 1000;
}

.map-legend {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 900;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 8px 10px;
    box-shadow: var(--shadow-sm);
    max-width: 220px;
}

.map-legend-title {
    font-size: 11px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 6px;
}

.map-legend-items {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 10px;
}

.map-legend-items span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 600;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.95);
    flex-shrink: 0;
}

.legend-dot.blue { background: #2563EB; }
.legend-dot.green { background: #16A34A; }
.legend-dot.orange { background: #EA580C; }
.legend-dot.red { background: #DC2626; }
.legend-dot.purple { background: #7C3AED; }
.legend-dot.zinc { background: #52525B; }

.map-btn {
    width: 40px;
    height: 40px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    transition: background var(--duration-normal) var(--ease-out), color var(--duration-normal) var(--ease-out);
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
}

.map-btn:hover {
    background: var(--bg-soft);
    color: var(--primary);
    transform: scale(1.05);
}

.map-btn:active {
    transform: scale(0.92);
    transition-duration: 80ms;
}

/* === MOBILE MAP BUBBLE === */
.map-bubble {
    position: absolute;
    z-index: 1200;
    max-width: min(360px, 88vw);
    background: var(--card);
    color: var(--text);
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: 0 12px 28px rgba(87, 68, 33, 0.12);
    padding: 14px 16px 12px;
    transform: translate(-50%, -100%);
    display: none;
    pointer-events: auto;
}

.map-bubble.visible {
    display: block;
}

.map-bubble-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.map-bubble-text {
    font-size: 14.5px;
    line-height: 1.8;
    color: var(--text);
    max-height: 50vh;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.map-bubble-next {
    align-self: flex-start;
    border: none;
    background: rgba(184, 154, 87, 0.18);
    color: #6D552B;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
}

.map-bubble-next:active {
    transform: scale(0.98);
}

.map-bubble-arrow {
    position: absolute;
    width: 12px;
    height: 12px;
    bottom: -6px;
    left: var(--arrow-left, 50%);
    transform: translateX(-50%) rotate(45deg);
    background: var(--card);
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.map-btn svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

/* === MAP BUBBLE (floating on pin) === */
.map-bubble {
    position: absolute;
    z-index: 1200;
    max-width: min(340px, 85vw);
    min-width: 220px;
    background: var(--card);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 30px rgba(87, 68, 33, 0.16), 0 2px 8px rgba(87, 68, 33, 0.08);
    transform: translate(-50%, -100%);
    display: none;
    pointer-events: auto;
    overflow: hidden;
    animation: bubble-pop var(--duration-normal) var(--ease-spring);
}

@keyframes bubble-pop {
    from { opacity: 0; transform: translate(-50%, -100%) scale(0.85); }
    to { opacity: 1; transform: translate(-50%, -100%) scale(1); }
}

.map-bubble.visible {
    display: block;
}

/* Arrow pointing down to the pin */
.map-bubble-arrow {
    position: absolute;
    width: 14px;
    height: 14px;
    bottom: -7px;
    left: var(--arrow-left, 50%);
    transform: translateX(-50%) rotate(45deg);
    background: var(--card);
    box-shadow: 3px 3px 4px rgba(87, 68, 33, 0.08);
}

.map-bubble-body {
    padding: 14px 16px 10px;
    cursor: pointer;
}

.map-bubble-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.6;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.map-bubble-summary {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    max-height: 5.1em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.map-bubble-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 8px;
}

.map-bubble-meta-dot {
    width: 3px;
    height: 3px;
    background: var(--text-light);
    border-radius: 50%;
}

.map-bubble-footer {
    display: flex;
    border-top: 1px solid var(--border-light);
}

.map-bubble-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 12px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    transition: background var(--duration-fast);
    min-height: 44px;
}

.map-bubble-btn:active {
    background: var(--primary-light);
    transition-duration: 80ms;
}

.map-bubble-btn + .map-bubble-btn {
    border-inline-start: 1px solid var(--border-light);
}

.map-bubble-btn svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.map-bubble-btn.close-btn {
    color: var(--text-muted);
    flex: 0;
    padding: 10px 14px;
}

/* === SIDE PANEL === */
.side-panel {
    width: 0;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
    opacity: 0;
    transition: width var(--duration-slow) var(--ease-out),
        opacity var(--duration-slow) var(--ease-out);
    will-change: width, opacity;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

.side-panel.open {
    width: var(--panel-width);
    opacity: 1;
}

.panel-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: var(--panel-width);
}

.panel-view[hidden] {
    display: none;
}

.panel-header {
    padding: 16px 24px 10px;
    text-align: center;
    flex-shrink: 0;
}

.panel-header-branded {
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: start;
}

.panel-brand {
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-brand-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0;
}

.panel-brand-logo {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    object-fit: cover;
}

.panel-header h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0;
}

.panel-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 20px 32px;
    /* Content flows under tab bar with gradient fade */
    scroll-behavior: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
}

/* === NEWS PANEL === */
.news-tabs {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-bottom: 14px;
    padding: 3px;
    background: var(--bg-soft);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    position: relative;
}

.news-tab {
    padding: 8px 16px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: color var(--duration-normal) var(--ease-out), background var(--duration-normal) var(--ease-out);
    min-height: 48px;
    position: relative;
}

.news-tab:hover {
    color: var(--text);
}

.news-tab:active {
    transform: scale(0.95);
    transition-duration: 80ms;
}

.news-tab.active {
    background: var(--card);
    color: var(--text);
    box-shadow: var(--shadow-sm);
}

.news-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-bottom: 16px;
    position: relative;
    overflow-x: hidden;
}


/* News Card - Facebook style */
.news-card {
    background: var(--card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: background var(--duration-normal) var(--ease-out), border-color var(--duration-normal) var(--ease-out);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 0;
    gap: 0;
    position: relative;
}

.news-card-icon {
    position: absolute;
    top: 10px;
    inset-inline-end: 10px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2563EB;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    color: #fff;
}

.news-card-icon svg {
    width: 14px;
    height: 14px;
    fill: #fff;
    stroke: none;
    position: relative;
}

.news-card-icon img {
    width: 14px;
    height: 14px;
    object-fit: cover;
    border-radius: 4px;
}

.news-card-icon.blue {
    background: #2563EB;
    color: #fff;
}

.news-card-icon.green {
    background: #16A34A;
    color: #fff;
}

.news-card-icon.orange {
    background: #EA580C;
    color: #fff;
}

.news-card-icon.red {
    background: #DC2626;
    color: #fff;
}

.news-card-icon.purple {
    background: #7C3AED;
    color: #fff;
}

.news-card-icon.zinc {
    background: #52525B;
    color: #fff;
}

.news-card.highlighted .news-card-icon {
    box-shadow: 0 0 0 2px #18181B, 0 4px 10px rgba(0, 0, 0, 0.18);
}

@media (hover: hover) {
    .news-card:hover {
        background: var(--bg-soft);
    }

    .news-card:hover .news-thumb {
        opacity: 0.95;
    }
}

.news-card {
    animation: card-fade-in var(--duration-normal) var(--ease-out) both;
}

@keyframes card-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.news-card:active {
    transform: scale(0.99);
    transition-duration: 80ms;
}

.news-card.highlighted {
    border-color: var(--primary);
    box-shadow: var(--shadow-md), 0 0 0 3px var(--primary-glow);
    animation: highlight-pulse 1.5s ease-in-out;
}

@keyframes highlight-pulse {
    0% { box-shadow: var(--shadow-md), 0 0 0 3px var(--primary-glow); }
    50% { box-shadow: var(--shadow-md), 0 0 0 6px var(--primary-glow), 0 0 20px var(--primary-glow); }
    100% { box-shadow: var(--shadow-md), 0 0 0 3px var(--primary-glow); }
}

/* Breaking news card */
.news-card.breaking {
    border-color: var(--danger-light);
    border-top: 3px solid var(--danger);
}

.breaking-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 700;
    color: var(--danger);
    background: var(--danger-light);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    margin-bottom: 4px;
    width: fit-content;
}

.breaking-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--danger);
    border-radius: var(--radius-full);
    animation: pulse-dot 1.5s ease-in-out infinite;
}

/* Radiating card style */
.news-card.radiating {
    border-color: var(--primary-light);
    border-inline-start: 3px solid var(--primary-soft);
    animation: card-radiate-border 3s ease-in-out infinite;
}

@keyframes card-radiate-border {
    0%, 100% { border-color: var(--primary-light); border-inline-start-color: var(--primary-soft); }
    50% { border-color: var(--primary-soft); border-inline-start-color: var(--primary); }
}

.radiating-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    background: var(--primary-light);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    margin-bottom: 4px;
    width: fit-content;
}

.radiating-badge svg {
    animation: radiate-icon-spin 4s linear infinite;
}

@keyframes radiate-icon-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.news-thumb-wrap {
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: var(--bg-soft);
    border-radius: 14px 14px 0 0;
}

.news-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--duration-slow) var(--ease-out);
}

.news-body {
    padding: 12px 14px 6px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.news-card.no-image .news-body {
    padding-top: 14px;
}

.news-source {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.news-source-verified {
    color: var(--primary);
    display: flex;
    align-items: center;
}

.news-source-verified svg {
    width: 14px;
    height: 14px;
    fill: var(--primary);
    stroke: none;
}

.news-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.news-meta-dot {
    width: 3px;
    height: 3px;
    background: var(--text-light);
    border-radius: var(--radius-full);
}

.news-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.6;
    margin-bottom: 4px;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-desc {
    font-size: 14.5px;
    color: var(--text-secondary);
    line-height: 1.75;
    font-weight: 400;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 2px;
}

.news-footer {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 14px 10px;
    border-top: none;
    position: relative;
}

.news-action-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    padding: 6px 8px;
    border-radius: var(--radius-md);
    transition: background var(--duration-fast), color var(--duration-fast);
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
    min-height: 48px;
    flex: 1;
    justify-content: center;
    position: relative;
    /* Removed z-index to prevent overlay issues */
}

.news-action-btn:hover {
    background: var(--bg-soft);
    color: var(--text-secondary);
    /* Removed z-index to prevent overlay issues */
}

.news-action-btn:active {
    transform: scale(0.95);
    transition-duration: 80ms;
}

.news-action-btn svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    transition: stroke var(--duration-fast), fill var(--duration-fast);
    position: relative;
    /* Removed z-index to prevent overlay issues */
}

.news-action-btn.liked {
    color: var(--danger);
}

.news-action-btn.liked svg {
    fill: currentColor;
}

@keyframes like-pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.news-action-btn.like-btn.just-liked {
    animation: like-pop 300ms var(--ease-spring);
}

.news-action-btn.like-btn:hover {
    background: var(--danger-light);
    color: var(--danger);
}

.news-action-btn.like-btn:hover svg {
    fill: currentColor;
}

/* === NEWS EMPTY STATE === */
.news-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 60px 20px;
    color: var(--text-muted);
    text-align: center;
}

.news-empty-state svg {
    opacity: 0.4;
}

.news-empty-state p {
    font-size: 15px;
    font-weight: 600;
}

.news-refresh-btn {
    padding: 10px 24px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    min-height: 48px;
    transition: opacity var(--duration-fast), transform var(--duration-fast);
}

.news-refresh-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.news-refresh-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* === REPORT PANEL === */
.report-step {
    animation: fadeIn var(--duration-slow) var(--ease-out);
    display: grid;
    gap: 14px;
}

.report-step[hidden] {
    display: none !important;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.report-location-chosen {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--success-light);
    border-radius: var(--radius-lg);
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--success);
}

.report-change-location {
    margin-inline-start: auto;
    background: none;
    border: none;
    color: var(--primary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    min-height: 48px;
}

.report-change-location:active {
    opacity: 0.7;
}

.report-section-title {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-secondary);
    margin-bottom: 10px;
    letter-spacing: 0.01em;
}

.report-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #D9DCE3;
    border-radius: var(--radius-md);
    background: var(--card);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    transition: border-color var(--duration-fast), box-shadow var(--duration-fast), background var(--duration-fast);
    margin-bottom: 10px;
    min-height: 48px;
}

.report-hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.report-input:focus {
    outline: none;
    border-color: var(--primary);
    background: #FFFFFF;
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.report-textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px 14px;
    border: 1px solid #D9DCE3;
    border-radius: var(--radius-md);
    background: var(--card);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    resize: none;
    margin-bottom: 10px;
    transition: border-color var(--duration-fast), box-shadow var(--duration-fast), background var(--duration-fast);
    line-height: 1.7;
}

.report-textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: #FFFFFF;
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.report-textarea::placeholder {
    color: var(--text-muted);
    font-weight: 500;
}

.report-input::placeholder {
    color: var(--text-muted);
    font-weight: 500;
}

.report-categories {
    display: block;
    margin-bottom: 20px;
    background: linear-gradient(180deg, #FCFCFD 0%, #F9FAFB 100%);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 12px;
}

.report-categories > *:last-child {
    margin-bottom: 0;
}

.report-cat-step-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.report-cat-step-title {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.report-cat-back {
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    min-height: 40px;
    transition: background var(--duration-fast), border-color var(--duration-fast), color var(--duration-fast);
}

.report-cat-back:hover {
    background: var(--bg-soft);
    border-color: var(--text-light);
    color: var(--text);
}

.report-categories-main,
.report-categories-sub {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
    align-items: stretch;
}

.report-main-cat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 12px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--card);
    cursor: pointer;
    font-family: inherit;
    color: var(--text-secondary);
    min-height: 84px;
    box-shadow: var(--shadow-sm);
    transition: transform var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), background var(--duration-fast);
    width: 100%;
}

.report-main-cat:hover {
    border-color: rgba(24, 24, 27, 0.25);
    background: var(--primary-light);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.report-main-cat:active {
    transform: scale(0.98);
}

.report-main-cat-icon {
    font-size: 20px;
    line-height: 1;
}

.report-main-cat span {
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    line-height: 1.3;
}

.report-main-cat small {
    color: var(--text-light);
    font-size: 11px;
    font-weight: 700;
    background: var(--bg-soft);
    border-radius: var(--radius-full);
    padding: 1px 8px;
}

.report-cat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--card);
    cursor: pointer;
    transition: border-color var(--duration-fast), background var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast);
    min-height: 88px;
    font-family: inherit;
    box-shadow: var(--shadow-sm);
    width: 100%;
}

.report-cat:hover {
    border-color: rgba(24, 24, 27, 0.25);
    background: var(--primary-light);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.report-cat:active {
    transform: scale(0.98);
}

.report-cat.active {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: 0 0 0 2px var(--primary-glow), var(--shadow-md);
}

.report-cat-icon {
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--duration-fast);
}

.report-cat-icon svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    stroke: none;
}

.report-cat span {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    transition: color var(--duration-fast);
    text-align: center;
    line-height: 1.25;
}

.report-cat:hover span,
.report-cat.active span,
.report-cat:hover .report-cat-icon,
.report-cat.active .report-cat-icon {
    color: var(--primary);
}

/* Report Images */
.report-images {
    display: flex;
    gap: 12px;
    margin-bottom: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.report-image-add {
    width: 88px;
    height: 88px;
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    color: var(--text-muted);
    transition: border-color var(--duration-normal) var(--ease-out), color var(--duration-normal) var(--ease-out), background var(--duration-normal) var(--ease-out);
    flex-shrink: 0;
}

.report-image-add:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.report-image-add span {
    font-size: 12px;
    font-weight: 600;
}

.report-image-preview {
    width: 88px;
    height: 88px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

.report-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.report-image-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 28px;
    height: 28px;
    background: var(--danger);
    color: white;
    border: 2px solid var(--card);
    border-radius: var(--radius-full);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    /* Expand touch target beyond visual size */
    padding: 0;
}

.report-image-remove::before {
    content: '';
    position: absolute;
    inset: -10px;
}

.report-notice {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: #FFF8E8;
    border-radius: var(--radius-lg);
    margin-bottom: 12px;
    border: 1px solid rgba(184, 154, 87, 0.28);
}

.report-notice svg {
    width: 20px;
    height: 20px;
    stroke: var(--warning);
    stroke-width: 2;
    fill: none;
    flex-shrink: 0;
}

.report-notice span {
    font-size: 12px;
    font-weight: 700;
    color: #92400E;
    line-height: 1.6;
}

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-lg);
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity var(--duration-normal) var(--ease-out), transform var(--duration-normal) var(--ease-out);
    min-height: 48px;
}

.btn:active {
    transform: scale(0.96);
}

.btn-primary {
    background: var(--primary);
    color: var(--primary-foreground);
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-submit {
    width: 100%;
    background: var(--bg-soft);
    color: var(--text-muted);
    font-size: 15px;
    letter-spacing: 0.01em;
}

.btn-submit:not(:disabled) {
    background: var(--primary);
    color: var(--primary-foreground);
    box-shadow: 0 8px 20px rgba(9, 9, 11, 0.18);
}

.btn-submit:not(:disabled):hover {
    opacity: 0.9;
}

.btn-submit:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

#report-next:disabled {
    background: var(--bg-soft);
    color: var(--text-muted);
    box-shadow: none;
    cursor: not-allowed;
}

/* === REPORT MODAL === */
body.report-modal-open {
    overflow: hidden;
}

body.sheet-open {
    overflow: hidden;
}

body.report-step-2 #map {
    pointer-events: none;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    opacity: 0;
    transition: opacity var(--duration-normal) var(--ease-out);
    z-index: 2600;
}

.modal-backdrop[hidden] {
    display: none !important;
}

.modal-backdrop.visible {
    opacity: 1;
}

.report-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--duration-normal) var(--ease-out);
    z-index: 2601;
}

.report-modal[hidden] {
    display: none !important;
}

.report-modal.open {
    opacity: 1;
    pointer-events: auto;
}

.report-modal-card {
    width: min(720px, 92vw);
    max-height: 90vh;
    background: var(--card);
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: 0 24px 60px rgba(9, 9, 11, 0.22);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.report-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 16px;
    border-bottom: 1px solid var(--border-light);
    background: linear-gradient(180deg, #FFFFFF 0%, #FAFBFC 100%);
}

.report-modal-header h2 {
    font-size: 19px;
    font-weight: 800;
    margin: 0;
    letter-spacing: 0.01em;
}

.modal-close {
    background: none;
    border: none;
    font-size: 26px;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px 10px;
    border-radius: var(--radius-md);
    min-height: 48px;
    min-width: 48px;
}

.modal-close:hover {
    color: var(--text);
    background: var(--bg-soft);
}

.report-modal-body {
    padding: 16px 20px 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: #FFFFFF;
}

.report-map-wrap {
    position: relative;
    height: 260px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid #E6E8EE;
    background: var(--bg-soft);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

#report-map {
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

.report-map-hint {
    position: absolute;
    bottom: 12px;
    inset-inline-start: 12px;
    background: rgba(255, 255, 255, 0.95);
    padding: 6px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    box-shadow: var(--shadow-sm);
    pointer-events: none;
}

.report-step-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 2px;
}

@media (max-width: 768px) {
    .modal-backdrop {
        bottom: var(--tab-bar-height);
    }

    .report-modal {
        bottom: var(--tab-bar-height);
    }

    .report-modal {
        align-items: stretch;
    }

    .report-modal-card {
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    .report-modal-header {
        padding: 14px 16px;
    }

    .report-modal-body {
        padding: 12px 14px 20px;
    }

    .report-map-wrap {
        height: 45vh;
        border-radius: var(--radius-md);
    }

    .report-step-actions .btn {
        width: 100%;
    }

    .report-input,
    .report-textarea {
        font-size: 15px;
    }
}

/* === SETTINGS PANEL === */
.settings-card {
    background: var(--card);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.settings-item {
    display: flex;
    align-items: center;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border-light);
    min-height: 64px;
}

.settings-item:last-child {
    border-bottom: none;
}

.settings-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-inline-end: 14px;
    flex-shrink: 0;
}

.settings-icon svg {
    width: 22px;
    height: 22px;
    stroke: white;
    stroke-width: 2;
    fill: none;
}

.settings-icon.red {
    background: var(--danger-light);
    color: var(--danger);
}
.settings-icon.red svg { stroke: var(--danger); }

.settings-icon.green {
    background: var(--success-light);
    color: var(--success);
}
.settings-icon.green svg { stroke: var(--success); }

.settings-icon.blue {
    background: var(--bg-soft);
    color: var(--text);
}
.settings-icon.blue svg { stroke: var(--text); }

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

.settings-label {
    font-weight: 700;
    font-size: 14px;
    color: var(--text);
}

.settings-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Toggle Switch */
.toggle {
    width: 52px;
    height: 30px;
    background: var(--border);
    border-radius: var(--radius-full);
    position: relative;
    cursor: pointer;
    transition: background var(--duration-normal) var(--ease-out);
    flex-shrink: 0;
}

.toggle::after {
    content: '';
    position: absolute;
    width: 26px;
    height: 26px;
    background: white;
    border-radius: var(--radius-full);
    top: 2px;
    right: 2px;
    transition: transform var(--duration-normal) var(--ease-spring);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.toggle.active {
    background: var(--primary);
}

.toggle.active::after {
    transform: translateX(-22px);
}

/* Expand toggle touch target to 48px */
.toggle::before {
    content: '';
    position: absolute;
    inset: -9px -4px;
}

/* Panel fade-in animation */
.panel-view:not([hidden]) {
    animation: panelFadeIn var(--duration-normal) var(--ease-out);
}

@keyframes panelFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* My Reports (بلاغاتي) */
.my-reports-list {
    border-top: 1px solid var(--border-light);
}

.my-report-item {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-light);
}

.my-report-item:last-child {
    border-bottom: none;
}

.my-report-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.my-report-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
}

.my-report-token {
    color: var(--text-muted);
    font-family: monospace;
    direction: ltr;
}

.my-report-status {
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 12px;
}

.my-report-status.success {
    background: var(--success-light);
    color: var(--success);
}

.my-report-status.warning {
    background: var(--warning-light);
    color: #92400E;
}

.my-report-status.danger {
    background: var(--danger-light);
    color: var(--danger);
}

.settings-about {
    text-align: center;
    padding: 16px 0 8px;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.6;
    opacity: 0.7;
}

/* === SETTINGS LINK BUTTONS === */
.settings-links {
    padding: 4px 20px 12px;
    margin-top: -8px;
    display: flex;
    justify-content: center;
}

.settings-links-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3px;
    justify-items: center;
    width: 100%;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.settings-link-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    text-decoration: none;
    transition: opacity var(--duration-normal) var(--ease-out), color var(--duration-normal) var(--ease-out);
    min-height: 48px;
    opacity: 0.7;
    font-size: 12px;
    line-height: 1.5;
    font-weight: 600;
    cursor: pointer;
}

.settings-link-btn:hover {
    color: var(--text);
    opacity: 0.8;
    background: transparent;
    transform: translateY(-1px);
}

.settings-link-icon {
    margin-bottom: 4px;
    opacity: 0.6;
    width: 16px;
    height: 16px;
}

.settings-link-btn:hover .settings-link-icon {
    opacity: 0.6;
    transform: scale(1.02);
}

.settings-link-btn:active {
    transform: translateY(0);
}

/* Responsive adjustments for mobile */
@media (max-width: 768px) {
    .settings-links-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
        max-width: 280px;
    }

    .settings-link-btn {
        padding: 6px;
        font-size: 12px;
    }

    .settings-link-icon {
        width: 16px;
        height: 16px;
    }
}

@media (max-width: 480px) {
    .settings-links-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 4px;
        max-width: 260px;
    }

    .settings-link-btn {
        padding: 6px;
        font-size: 12px;
    }

    .settings-link-icon {
        width: 14px;
        height: 14px;
    }
}

/* === TAB BAR (Mobile only) === */
.tab-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--tab-bar-height);
    background: rgba(255, 255, 255, 0.97);
    border-top: 1px solid var(--border-light);
    z-index: var(--z-header);
    /* Changed from hardcoded value to variable (200) */
    padding-bottom: env(safe-area-inset-bottom);
    pointer-events: auto;
    transition: opacity var(--duration-normal) var(--ease-out), transform var(--duration-normal) var(--ease-out);
    /* Smooth transition for show/hide */
}

.tab-bar-inner {
    display: flex;
    height: 100%;
    justify-content: space-around;
    align-items: center;
    padding: 0 4px;
    max-width: 500px;
    margin: 0 auto;
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    text-decoration: none;
    padding: 8px 12px;
    border-radius: var(--radius-xl);
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
    transition: color var(--duration-normal) var(--ease-out);
    position: relative;
    min-width: 56px;
    min-height: 48px;
    /* Removed z-index to prevent stacking context issues */
}

.tab-item::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 24px;
    height: 3px;
    background: var(--primary);
    border-radius: var(--radius-full);
    transition: transform var(--duration-normal) var(--ease-spring);
    /* Removed z-index to prevent stacking context issues */
}

.tab-item.active {
    color: var(--text);
}

.tab-item.active::before {
    transform: translateX(-50%) scaleX(1);
}

.tab-item:active {
    transform: scale(0.9);
    transition-duration: 80ms;
}

.tab-item svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 1.8;
    fill: none;
    position: relative;
    /* Removed z-index to prevent stacking context issues */
}

.tab-item span {
    font-size: 12px;
    font-weight: 600;
    position: relative;
    /* Removed z-index to prevent stacking context issues */
}

/* === BOTTOM SHEET === */
.sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: var(--z-backdrop);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--duration-slow) var(--ease-out), visibility var(--duration-slow) var(--ease-out);
}

.sheet-backdrop.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    /* Ensure backdrop blocks all interactions when visible */
}

.bottom-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--card);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border-top: 1px solid var(--border);
    z-index: var(--z-sheet);
    transform: translateY(100%);
    transition: transform var(--duration-slow) var(--ease-out);
    max-height: 100vh;
    max-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    will-change: transform;
}

.bottom-sheet.visible {
    transform: translateY(0);
    pointer-events: auto;
    /* Ensure sheet captures all interactions */
}

.sheet-handle {
    display: flex;
    justify-content: center;
    padding: 12px;
    cursor: grab;
    min-height: 28px;
}

.sheet-handle::after {
    content: '';
    width: 40px;
    height: 4px;
    background: var(--border);
    border-radius: var(--radius-full);
}

.sheet-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 24px 120px;
    overscroll-behavior: contain;
    /* Changed from 32px to 120px */
}

.sheet-image {
    width: 100%;
    max-height: 400px;
    height: auto;
    object-fit: contain;
    border-radius: var(--radius-lg);
    margin-bottom: 12px;
    background: var(--bg-soft);
}

.sheet-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.5;
}

.sheet-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.sheet-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--success);
    background: var(--success-light);
    padding: 5px 12px;
    border-radius: var(--radius-full);
}

.sheet-badge svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.sheet-badge.breaking-sheet-badge {
    color: var(--danger);
    background: var(--danger-light);
}

.sheet-source {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
}

.sheet-time,
.sheet-location {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

.sheet-time svg,
.sheet-location svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.sheet-desc {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.85;
    font-weight: 400;
    margin-bottom: 14px;
}

.sheet-source-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: var(--radius-lg);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    margin-bottom: 10px;
    transition: background var(--duration-normal) var(--ease-out), color var(--duration-normal) var(--ease-out);
    min-height: 48px;
}

.sheet-source-link:hover {
    background: var(--primary);
    color: white;
}

.sheet-source-link:hover svg {
    stroke: white;
}

.sheet-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    /* Prevent buttons from shrinking */
}

.sheet-btn {
    flex: 1;
    flex-shrink: 1;
    padding: 10px 12px;
    border: none;
    border-radius: var(--radius-lg);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: opacity var(--duration-normal) var(--ease-out), transform var(--duration-normal) var(--ease-out);
    min-height: 48px;
    white-space: nowrap;
    /* Prevent text from wrapping and causing overflow */
}

.sheet-btn:active {
    transform: scale(0.96);
    transition-duration: 80ms;
}

.sheet-btn svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.sheet-btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-soft));
    color: white;
    box-shadow: 0 4px 16px rgba(184, 154, 87, 0.35);
}

.sheet-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(184, 154, 87, 0.4);
}

.sheet-btn-secondary {
    background: var(--bg-soft);
    color: var(--text-secondary);
}

.sheet-btn-secondary:hover {
    background: var(--border-light);
}

.sheet-btn-whatsapp {
    background: #25D366;
    color: white;
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.35);
}

.sheet-btn-whatsapp:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4);
}

.sheet-btn-whatsapp svg {
    width: 18px;
    height: 18px;
}

/* === TOAST === */
.offline-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-toast);
    background: var(--danger);
    color: #fff;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.offline-banner .material-symbols-rounded {
    font-size: 18px;
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 20;
}

.offline-banner[hidden] {
    display: none;
}

.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text);
    color: white;
    padding: 14px 24px;
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 600;
    box-shadow: var(--shadow-xl);
    z-index: 3100;
    opacity: 0;
    transition: opacity var(--duration-slow) var(--ease-spring), transform var(--duration-slow) var(--ease-spring);
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    will-change: transform, opacity;
}

.toast.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.toast.success {
    background: var(--success);
}

/* === MAP MARKERS === */
.custom-pin {
    width: 30px;
    height: 30px;
    position: relative;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
    transition: filter var(--duration-normal) var(--ease-spring);
    cursor: pointer;
}

.custom-pin:hover {
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.35));
}

.custom-pin.active {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.custom-pin.active .pin-body {
    box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--text);
}

.pin-body {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: #2563EB;
    border: 2.5px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    color: #fff;
}

.pin-body::before {
    display: none;
}

.pin-body.blue {
    background: #2563EB;
    border-color: #fff;
}

.pin-body.green {
    background: #16A34A;
    border-color: #fff;
}

.pin-body.orange {
    background: #EA580C;
    border-color: #fff;
}

.pin-body.red {
    background: #DC2626;
    border-color: #fff;
}

.pin-body.purple {
    background: #7C3AED;
    border-color: #fff;
}

.pin-body.zinc {
    background: #52525B;
    border-color: #fff;
}

.pin-icon {
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pin-icon svg {
    width: 16px;
    height: 16px;
    fill: #fff;
    stroke: none;
}

.pin-icon .material-symbols-rounded {
    font-size: 16px;
    color: #fff;
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 20;
    line-height: 1;
}

.map-legend-items .material-symbols-rounded {
    font-size: 14px;
    vertical-align: middle;
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 20;
}

.pin-icon img {
    width: 15px;
    height: 15px;
    object-fit: cover;
    border-radius: 4px;
}

.pin-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border-radius: var(--radius-full);
    opacity: 0;
    animation: pin-pulse 2.5s ease-out infinite;
}

.pin-pulse::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: var(--radius-full);
    border: 2px solid currentColor;
    opacity: 0.3;
    animation: pin-pulse 2.5s ease-out infinite 0.4s;
}

@keyframes pin-pulse {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }

    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

/* Radiating pin effect — signal wave animation */
.custom-pin.is-radiating .pin-body {
    animation: radiate-glow 3s ease-in-out infinite;
}

.pin-radiate {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    pointer-events: none;
    z-index: -1;
}

.pin-radiate-wave {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.5);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2.5px solid var(--radiate-color, var(--primary));
    background: radial-gradient(circle, rgba(184, 154, 87, 0.12), transparent 72%);
    opacity: 0;
    animation: radiate-wave 3s cubic-bezier(0.2, 0.6, 0.3, 1) infinite;
    pointer-events: none;
}

.pin-radiate-wave:nth-child(2) {
    animation-delay: 1s;
}

.pin-radiate-wave:nth-child(3) {
    animation-delay: 2s;
}

@keyframes radiate-wave {
    0% {
        transform: translate(-50%, -50%) scale(0.6);
        opacity: 0.7;
        border-width: 3px;
    }
    50% {
        opacity: 0.35;
        border-width: 2px;
    }
    100% {
        transform: translate(-50%, -50%) scale(3.2);
        opacity: 0;
        border-width: 0.5px;
    }
}

@keyframes radiate-glow {
    0%, 100% {
        box-shadow: 0 0 0 0 transparent;
    }
    50% {
        box-shadow: 0 0 12px 3px rgba(37, 99, 235, 0.3);
    }
}

.report-pin-marker {
    animation: bounce-in var(--duration-slow) var(--ease-spring);
}

@keyframes bounce-in {
    0% {
        transform: scale(0) translateY(-20px);
        opacity: 0;
    }

    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .map-legend {
        top: 10px;
        left: 10px;
        max-width: 170px;
        padding: 7px 8px;
    }

    .map-legend-items {
        grid-template-columns: 1fr;
        gap: 3px;
    }

    .custom-pin {
        filter: drop-shadow(0 2px 4px rgba(15, 23, 42, 0.2));
        transition: none;
    }

    .custom-pin:hover {
        filter: drop-shadow(0 2px 4px rgba(15, 23, 42, 0.2));
    }

    .custom-pin.active {
        filter: drop-shadow(0 4px 10px rgba(15, 23, 42, 0.3));
    }

    .custom-pin.active .pin-body {
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.9), 0 0 16px rgba(37, 99, 235, 0.3);
    }

    .pin-pulse {
        display: none;
        animation: none;
    }

    /* Kill expensive wave/pulse animations on mobile (GPU-heavy) */
    .pin-radiate-wave {
        animation: none;
        display: none;
    }

    .pin-pulse {
        display: none;
    }
}

/* === SKELETON LOADING === */
.skeleton {
    background: linear-gradient(90deg, var(--bg-soft) 25%, var(--border-light) 50%, var(--bg-soft) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.skeleton-card {
    pointer-events: none;
    display: flex;
    flex-direction: column;
    padding: 0;
    border-radius: 14px;
}

.skeleton-card .news-thumb-wrap {
    width: 100%;
    height: 140px;
    border-radius: 14px 14px 0 0;
}

.skeleton-card .news-body {
    padding: 12px 14px;
}

.skeleton-line {
    height: 14px;
    margin-bottom: 8px;
    width: 100%;
}

.skeleton-line-short {
    width: 40%;
}

.skeleton-line-medium {
    width: 70%;
}

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

/* Pin Tooltip (desktop) */
.pin-tooltip {
    font-family: 'Cairo', sans-serif;
    direction: rtl;
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    background: var(--card);
    color: var(--text);
    border: 1px solid var(--border-light);
    z-index: 1001;
    pointer-events: none;
    animation: tooltipFadeIn var(--duration-fast) var(--ease-out);
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pin-tooltip::before {
    border-top-color: var(--card) !important;
}

/* === LEAFLET OVERRIDES === */
.leaflet-control-zoom {
    display: none !important;
}

.leaflet-control-attribution {
    font-size: 10px !important;
    background: rgba(255, 255, 255, 0.8) !important;
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* === DRAG HANDLE (hidden - fullscreen mode) === */
.panel-drag-handle {
    display: none;
}

/* Mobile (<= 768px) */
@media (max-width: 768px) {
    .report-categories {
        padding: 10px;
    }

    .report-categories-main,
    .report-categories-sub {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .report-main-cat,
    .report-cat {
        min-height: 80px;
    }

    .report-main-cat span,
    .report-cat span {
        font-size: 12px;
    }

    .sidebar {
        display: none;
    }

    .tab-bar {
        display: block;
    }

    .main {
        flex-direction: column;
    }

    .map-container {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: var(--tab-bar-height);
        z-index: 1;
    }

    /* SIDE PANEL: fullscreen overlay for all views */
    .side-panel {
        position: fixed;
        inset: 0;
        bottom: var(--tab-bar-height);
        width: 100% !important;
        height: auto;
        z-index: var(--z-side-panel);
        border-inline-end: none;
        opacity: 1;
        border-radius: 0;
        box-shadow: none;
        transition: transform var(--duration-slow) var(--ease-out);
        overflow: hidden;
        will-change: transform;
    }

    /* Hidden when not open - fully offscreen */
    .side-panel:not(.open) {
        transform: translateY(100%);
        pointer-events: none;
        visibility: hidden;
    }

    /* Open: slide up into view */
    .side-panel.open.panel-fullscreen {
        transform: translateY(0);
        visibility: visible;
    }

    /* FIX: Panel views must not overflow mobile width */
    .panel-view {
        min-width: 0 !important;
        width: 100%;
    }

    /* Map controls: hidden when not on map */
    .map-controls.hidden-mobile {
        opacity: 0;
        pointer-events: none;
        transition: opacity var(--duration-normal);
    }

    .news-card {
        position: relative;
        z-index: 1;
    }

    .news-thumb-wrap {
        height: 140px;
    }

    .news-title {
        font-size: 14px;
    }

    .news-desc {
        font-size: 12px;
    }

    .news-card-icon {
        width: 24px;
        height: 24px;
        top: 8px;
        inset-inline-end: 8px;
    }

    .news-card-icon svg {
        width: 12px;
        height: 12px;
    }

    .news-footer {
        /* Removed z-index to prevent overlay issues with bottom sheet */
    }

    .news-action-btn {
        /* Removed z-index to prevent overlay issues with bottom sheet */
    }

    .news-action-btn:hover {
        /* Removed z-index to prevent overlay issues with bottom sheet */
    }

    .news-action-btn svg {
        /* Removed z-index to prevent overlay issues with bottom sheet */
    }

    .map-controls {
        bottom: 16px;
        right: 16px;
    }

    .panel-content {
        padding: 0 16px 24px;
    }

    /* Ensure fullscreen panels scroll properly */
    .side-panel.open .panel-view:not([hidden]) {
        height: 100%;
        display: flex;
        flex-direction: column;
    }

    .side-panel.open .panel-content {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 32px;
    }

    /* Report form mobile adjustments */
    .report-textarea {
        min-height: 100px;
    }

    .btn-submit {
        margin-bottom: 24px;
    }

    .report-notice {
        margin-bottom: 16px;
    }

    /* Settings mobile adjustments */
    .settings-card {
        border-radius: var(--radius-lg);
    }

    /* Bottom sheet mobile adjustments */
    .sheet-content {
        padding: 0 16px 120px;
        /* Changed from 24px to 120px */
    }

    .sheet-title {
        font-size: 18px;
    }

    .sheet-actions {
        flex-wrap: wrap;
    }

    .sheet-btn {
        font-size: 13px;
        padding: 12px;
    }

    /* iOS input zoom fix */
    input,
    textarea,
    select {
        font-size: 16px !important;
    }

    .toast {
        bottom: 76px;
        left: 16px;
        right: 16px;
        transform: translateX(0) translateY(100px);
        white-space: normal;
        text-align: center;
        justify-content: center;
    }

    .toast.visible {
        transform: translateX(0) translateY(0);
    }

    /* Breaking banner mobile */
    .breaking-banner {
        top: 12px;
        max-width: calc(100vw - 24px);
        padding: 10px 12px;
        gap: 8px;
    }

    .breaking-banner-title {
        font-size: 12px;
    }

    /* Fixed tab bar overlap issue */
    .tab-item {
        /* Removed z-index to prevent stacking context issues */
        position: relative;
    }

    .tab-item::before {
        /* Removed z-index to prevent stacking context issues */
    }

    .tab-item svg {
        position: relative;
        /* Removed z-index to prevent stacking context issues */
        pointer-events: none;
    }

    .tab-item span {
        position: relative;
        /* Removed z-index to prevent stacking context issues */
        pointer-events: none;
    }

    /* Ensure proper spacing between items */
    .tab-item {
        padding: 6px 8px;
        min-width: 56px;
    }

    /* Improve touch targets */
    .tab-item::before {
        width: 28px;
    }
}

/* Desktop (> 768px) */
@media (min-width: 769px) {
    .tab-bar {
        display: none;
    }

    /* Restore backdrop-filter on desktop only */
    .tab-bar {
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }

    .map-btn {
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }

    .sheet-backdrop {
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        background: rgba(0, 0, 0, 0.4);
    }

    .sidebar {
        display: flex;
    }

    .main {
        flex-direction: row-reverse;
    }

    .map-container {
        flex: 1;
        min-width: 0;
    }

    .side-panel {
        border-inline-end: 1px solid var(--border);
    }

    /* Desktop panel content scroll */
    .panel-content {
        overflow-y: auto;
        overflow-x: hidden;
    }

    .sheet-actions {
        flex-wrap: wrap;
    }

    /* On desktop, bottom sheet is hidden - detail shows in panel */
    .bottom-sheet {
        display: none;
    }

    .sheet-backdrop {
        display: none;
    }
}

/* Mobile specific overrides */
@media (max-width: 768px) {
    .bottom-sheet {
        z-index: var(--z-sheet);
        /* Uses updated variable (2010) */
        /* Removed isolation to prevent stacking context issues */
        display: flex;
        /* Ensure display is flex, not overridden */
    }

    .sheet-backdrop {
        z-index: var(--z-backdrop);
        /* Uses updated variable (2000) */
        /* Removed isolation to prevent stacking context issues */
        display: block;
        /* Ensure display is block, not overridden */
    }

    /* Tab bar always stays visible on top of content */

    /* Ensure backdrop blocks all interactions */
    body:has(.sheet-backdrop.visible) {
        overflow: hidden;
        /* Prevent body scroll when sheet is open */
    }
}

/* === SIMPLIFIED MODE === */
.simplified-mode .news-title {
    font-size: 17px;
}

.simplified-mode .news-source {
    font-size: 13px;
}

.simplified-mode .news-desc {
    font-size: 15px;
    line-height: 1.9;
}

.simplified-mode .sheet-title {
    font-size: 24px;
}

.simplified-mode .sheet-desc {
    font-size: 16px;
    line-height: 1.95;
}

.simplified-mode .sidebar-item {
    width: 64px;
    height: 64px;
}

.simplified-mode .sidebar-item svg {
    width: 26px;
    height: 26px;
}

.simplified-mode .sidebar-item span {
    font-size: 12px;
}

.simplified-mode .tab-item svg {
    width: 28px;
    height: 28px;
}

.simplified-mode .tab-item span {
    font-size: 12px;
}

.simplified-mode .panel-header h1 {
    font-size: 28px;
}

.simplified-mode .settings-label {
    font-size: 16px;
}

.simplified-mode .settings-desc {
    font-size: 13px;
}

.simplified-mode .btn {
    font-size: 17px;
}

.simplified-mode .map-bubble-text {
    font-size: 16px;
    line-height: 2;
}

.simplified-mode .panel-content {
    padding: 0 24px 36px;
}

.simplified-mode .prayer-dua-text {
    font-size: 18px;
    line-height: 2.2;
}

/* Old browser fallbacks - no longer needed since backdrop-filter is desktop-only */

/* Fallback for inset-inline-end */
@supports not (inset-inline-end: 0) {
    .news-card.breaking::before {
        right: 0;
    }

    .news-card-icon {
        right: 10px;
    }

    .prayer-hero::before {
        right: -15%;
    }
}

/* Fallback for inset-inline-start */
@supports not (inset-inline-start: 0) {
    .report-map-hint {
        left: 12px;
    }

    .prayer-hero::after {
        left: -10%;
    }
}

@media (max-width: 768px) {
    @supports not (inset-inline-end: 0) {
        .news-card-icon {
            right: 8px;
        }
    }
}

/* === MOBILE PERFORMANCE: kill expensive infinite animations === */
@media (max-width: 768px) {
    .breaking-badge::before {
        animation: none;
    }
    .breaking-badge::before {
        opacity: 0.3;
    }
    .news-card.radiating {
        animation: none;
    }
    .radiating-badge svg {
        animation: none;
    }
    .custom-pin.is-radiating .pin-body {
        animation: none;
    }
    .cal-next-countdown {
        animation: none;
    }
    /* Flatten box-shadow animations on mobile */
    .news-card.highlighted {
        animation: none;
    }
    /* Use GPU-composited properties only */
    .side-panel {
        will-change: transform;
    }
    .bottom-sheet {
        will-change: transform;
    }
    .sheet-backdrop {
        will-change: opacity;
    }
    /* Faster transitions on mobile */
    .news-card {
        transition: none;
    }
    .news-tab {
        transition: color 100ms;
    }
    .sidebar-item,
    .sidebar-item::before {
        transition: none;
    }
    .btn {
        transition: none;
    }
    .sheet-btn {
        transition: none;
    }
    .news-action-btn {
        transition: none;
    }
    .news-action-btn svg {
        transition: none;
    }
    .report-cat {
        transition: border-color 100ms, background 100ms;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Mobile card stacking */
@media (max-width: 768px) {
    .news-card-icon {
        position: absolute;
        z-index: 2;
    }
}

/* ============================================
   PRAYER CALENDAR (editorial simplified)
   ============================================ */

/* ── Prayer Panel (الروزنامة) ── */
.panel-view[data-panel="prayer"] {
    --prayer-scale: 1;
    --cal-bg: #fbf8f1;
    --cal-surface: #fffcf6;
    --cal-border: #e4d7bb;
    --cal-ink: #2f2a1f;
    --cal-muted: #847a65;
    --cal-green: #8c6f3b;
    --cal-green-dark: #775b2e;
    --cal-card-shadow: 0 2px 8px rgba(87, 68, 33, 0.08);
    background: var(--cal-bg);
    width: 100%;
    min-width: 0;
    font-family: 'Tajawal', 'Cairo', sans-serif;
}

.side-panel.prayer-active { --panel-width: 540px; }
.panel-view[data-panel="prayer"].prayer-text-xlarge { --prayer-scale: 1.15; }
.panel-view[data-panel="prayer"] .panel-content { padding: 0 14px 32px; }

#prayer-panel-content {
    width: min(100%, 460px);
    margin-inline: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-top: 14px;
}

/* fade-in */
.panel-view[data-panel="prayer"].cal-ready #prayer-panel-content > * {
    animation: prayer-fade-up 400ms var(--ease-out) both;
}
.panel-view[data-panel="prayer"].cal-ready #prayer-panel-content > *:nth-child(2) { animation-delay: 60ms; }
.panel-view[data-panel="prayer"].cal-ready #prayer-panel-content > *:nth-child(3) { animation-delay: 120ms; }
.panel-view[data-panel="prayer"].cal-ready #prayer-panel-content > *:nth-child(4) { animation-delay: 180ms; }
.panel-view[data-panel="prayer"].cal-ready #prayer-panel-content > *:nth-child(5) { animation-delay: 240ms; }
.panel-view[data-panel="prayer"].cal-ready #prayer-panel-content > *:nth-child(6) { animation-delay: 300ms; }

/* ── Header ── */
.cal-header {
    background: transparent;
    border-bottom: 1px solid var(--cal-border);
    padding: 16px 16px 12px;
    text-align: center;
}
.cal-title {
    margin: 0;
    font-size: calc(28px * var(--prayer-scale));
    font-weight: 800;
    color: var(--cal-ink);
}
.cal-date-line {
    margin-top: 4px;
    font-size: calc(14px * var(--prayer-scale));
    font-weight: 600;
    color: var(--cal-muted);
}

/* ── Footer (text scale) ── */
.cal-footer { display: flex; justify-content: center; padding-top: 4px; }
.cal-text-scale-btn {
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--cal-border); background: var(--cal-surface);
    color: var(--cal-muted); border-radius: 999px; padding: 8px 16px;
    font-family: inherit; font-size: calc(13px * var(--prayer-scale));
    font-weight: 700; cursor: pointer;
}
.cal-text-scale-btn:hover { background: #f0f0f0; }

/* ── Shared card ── */
.cal-next-prayer,
.prayer-ramadan-card,
.cal-section {
    border-radius: 16px;
    background: var(--cal-surface);
    box-shadow: var(--cal-card-shadow);
}

/* ═══════════════════════════════════════
   NEXT PRAYER HERO — simple, no pseudo
   ═══════════════════════════════════════ */
.cal-next-prayer {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(150deg, #1b7d2d, #27a83c);
    color: #fff;
    text-align: center;
    padding: 24px 16px 20px;
    border: none;
}
.cal-next-label {
    font-size: calc(13px * var(--prayer-scale));
    font-weight: 700;
    opacity: 0.85;
}
.cal-next-name {
    margin-top: 6px;
    font-size: calc(34px * var(--prayer-scale));
    font-weight: 900;
    line-height: 1.15;
}
.cal-next-countdown {
    margin-top: 8px;
    font-size: calc(40px * var(--prayer-scale));
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    letter-spacing: 1px;
    animation: prayer-countdown-pulse 2.6s ease-in-out infinite;
}
.cal-next-time {
    margin-top: 6px;
    font-size: calc(14px * var(--prayer-scale));
    font-weight: 700;
    opacity: 0.9;
}
.cal-next-hijri {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.2);
    font-size: calc(13px * var(--prayer-scale));
    font-weight: 700;
    opacity: 0.85;
    width: 100%;
}

/* ═══════════════════════════════════════
   RAMADAN CARD — white card, green accent
   ═══════════════════════════════════════ */
.prayer-ramadan-card {
    padding: 16px;
    background: var(--cal-surface) !important;
    color: var(--cal-ink);
    border: 1px solid var(--cal-border);
}
.prayer-ramadan-title {
    font-size: calc(20px * var(--prayer-scale));
    font-weight: 800;
    color: var(--cal-green-dark);
    letter-spacing: 0;
}
.prayer-ramadan-subtitle {
    margin-top: 4px;
    font-size: calc(15px * var(--prayer-scale));
    font-weight: 700;
    color: var(--cal-muted);
}
.prayer-ramadan-start {
    margin-top: 6px;
    font-size: calc(14px * var(--prayer-scale));
    font-weight: 700;
    color: var(--cal-muted);
}
.prayer-ramadan-stats {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.prayer-ramadan-stat {
    border: 1px solid var(--cal-border);
    border-radius: 12px;
    background: var(--cal-bg);
    padding: 10px 6px;
    text-align: center;
}
.prayer-ramadan-stat span {
    display: block;
    font-size: calc(12px * var(--prayer-scale));
    font-weight: 700;
    color: var(--cal-muted);
}
.prayer-ramadan-stat strong {
    margin-top: 3px;
    display: block;
    font-size: calc(17px * var(--prayer-scale));
    font-weight: 900;
    color: var(--cal-green-dark);
}
.prayer-ramadan-countdowns {
    margin-top: 10px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.prayer-ramadan-live {
    border: 1px solid var(--cal-border);
    border-radius: 12px;
    background: var(--cal-bg);
    padding: 10px 8px;
}
.prayer-ramadan-countdown-label {
    text-align: center;
    font-size: calc(12px * var(--prayer-scale));
    font-weight: 700;
    color: var(--cal-muted);
}
.prayer-ramadan-countdown-value {
    margin-top: 4px;
    text-align: center;
    font-size: calc(22px * var(--prayer-scale));
    font-weight: 900;
    color: var(--cal-green-dark);
    font-variant-numeric: tabular-nums;
}

/* ═══════════════════════════════════════
   SECTION CARDS (prayer times, weather)
   ═══════════════════════════════════════ */
.cal-section-title {
    padding: 14px 16px 8px;
    font-size: calc(20px * var(--prayer-scale));
    font-weight: 800;
    color: var(--cal-ink);
}

/* prayer times */
.prayer-times-grid {
    padding: 0;
    display: flex;
    flex-direction: column;
}
.prayer-time-item {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border-bottom: 1px solid var(--cal-border);
}
.prayer-time-item:last-child { border-bottom: none; }
.prayer-time-name {
    font-size: calc(18px * var(--prayer-scale));
    font-weight: 700;
    color: var(--cal-ink);
    display: flex;
    align-items: center;
    gap: 8px;
}
.prayer-time-icon {
    font-size: calc(20px * var(--prayer-scale));
    line-height: 1;
}
.prayer-time-value {
    font-size: calc(18px * var(--prayer-scale));
    font-weight: 800;
    color: var(--cal-muted);
    font-variant-numeric: tabular-nums;
}
.prayer-time-item.active {
    background: rgba(26,122,46,0.06);
    border-inline-start: 4px solid var(--cal-green);
    padding-inline-start: 12px;
}
.prayer-time-item.active .prayer-time-value {
    color: var(--cal-green);
    font-weight: 900;
}

/* weather current */
.cal-weather-current { padding: 0; }
.cal-weather-simple-row {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.cal-weather-simple-icon {
    font-size: calc(30px * var(--prayer-scale));
    line-height: 1;
}
.cal-weather-simple-condition {
    flex: 1;
    font-size: calc(18px * var(--prayer-scale));
    font-weight: 700;
    color: var(--cal-ink);
}
.cal-weather-simple-temp {
    font-size: calc(24px * var(--prayer-scale));
    font-weight: 900;
    color: var(--cal-ink);
}
.cal-weather-simple-empty {
    padding: 16px;
    font-size: calc(14px * var(--prayer-scale));
    font-weight: 600;
    color: var(--cal-muted);
    text-align: center;
}

/* 5-day forecast */
.cal-forecast-label {
    padding: 10px 16px 4px;
    font-size: calc(14px * var(--prayer-scale));
    font-weight: 700;
    color: var(--cal-muted);
    border-top: 1px solid var(--cal-border);
}
.cal-forecast-row {
    display: flex;
    gap: 6px;
    padding: 8px 14px 14px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.cal-forecast-row::-webkit-scrollbar { display: none; }
.cal-forecast-row:empty { display: none; }
.cal-forecast-day {
    flex: 1 0 0;
    min-width: 56px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 4px 8px;
    border-radius: 12px;
    background: var(--cal-bg);
    border: 1px solid var(--cal-border);
}
.cal-forecast-day-name {
    font-size: calc(12px * var(--prayer-scale));
    font-weight: 800;
    color: var(--cal-ink);
}
.cal-forecast-icon {
    font-size: calc(22px * var(--prayer-scale));
    line-height: 1;
}
.cal-forecast-high {
    font-size: calc(14px * var(--prayer-scale));
    font-weight: 800;
    color: var(--cal-ink);
}
.cal-forecast-low {
    font-size: calc(12px * var(--prayer-scale));
    font-weight: 600;
    color: var(--cal-muted);
}

/* ── Hide unused ── */
.cal-grid-wrapper, .cal-day-detail, .cal-moon-row, .cal-settings-section {
    display: none !important;
}

@keyframes prayer-fade-up {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes prayer-countdown-pulse {
    0%, 100% { text-shadow: 0 4px 14px rgba(0,0,0,0.2); }
    50%      { text-shadow: 0 6px 20px rgba(255,255,255,0.2); }
}

@media (max-width: 768px) {
    .side-panel.prayer-active { --panel-width: 100%; }
    .panel-view[data-panel="prayer"] .panel-content { padding: 0 10px 24px; }
    #prayer-panel-content { width: 100%; gap: 12px; padding-top: 10px; }
    .panel-view[data-panel="prayer"].cal-ready #prayer-panel-content > * { animation: none; }
    .prayer-ramadan-stats { grid-template-columns: repeat(3, 1fr); }
    .prayer-ramadan-countdowns { grid-template-columns: 1fr; }
}
@media (min-width: 769px) {
    .side-panel.prayer-active { width: 540px; }
}
@media (prefers-reduced-motion: reduce) {
    .panel-view[data-panel="prayer"].cal-ready #prayer-panel-content > * { animation: none; }
    .cal-next-countdown { animation: none; }
}
