:root {
    color-scheme: dark;
    --bg: #07120e;
    --surface: #0b1a16;
    --surface-soft: #112721;
    --surface-glass: rgba(11, 26, 22, 0.78);
    --surface-glass-bright: rgba(23, 107, 91, 0.12);
    --ink: #e8f3f0;
    --muted: #82a39a;
    --line: rgba(34, 75, 65, 0.38);
    --line-active: rgba(223, 177, 38, 0.45);
    --brand: #dfb126;
    --brand-dark: #b58d19;
    --brand-soft: rgba(223, 177, 38, 0.1);
    --accent: #dfb126;
    --accent-soft: rgba(223, 177, 38, 0.08);
    --teal: #176b5b;
    --teal-glow: rgba(23, 107, 91, 0.35);
    --blue: #3d80fc;
    --danger: #d94e4e;
    --shadow: 0 16px 45px rgba(0, 0, 0, 0.55);
    --shadow-active: 0 0 25px rgba(223, 177, 38, 0.25);
    --glow: 0 0 20px rgba(223, 177, 38, 0.15);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    min-height: 100%;
    background-color: var(--bg);
}

body {
    min-height: 100vh;
    background: 
        radial-gradient(circle at 80% 20%, rgba(223, 177, 38, 0.05), transparent 450px),
        radial-gradient(circle at 20% 80%, rgba(23, 107, 91, 0.08), transparent 550px),
        radial-gradient(circle at 50% 0%, rgba(23, 107, 91, 0.22), transparent 750px),
        linear-gradient(180deg, var(--bg), #020705);
    color: var(--ink);
    font-family: "Plus Jakarta Sans", "Inter", "Avenir Next", Avenir, "Segoe UI", system-ui, sans-serif;
    font-weight: 500;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

button,
select,
input {
    font: inherit;
    color: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* App Shell & Layout */
.app-shell {
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto;
    padding: 24px 0 48px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 0 24px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 24px;
}

.topbar h1 {
    font-size: clamp(1.8rem, 4.5vw, 2.8rem);
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--ink) 30%, var(--brand) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.eyebrow {
    color: var(--brand);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.header-weather {
    display: inline-flex;
    height: 40px;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-glass);
    padding: 6px 12px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.weather-symbol {
    display: grid;
    width: 26px;
    height: 26px;
    place-items: center;
    border-radius: 50%;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 1.1rem;
    font-weight: 900;
}

.weather-temp {
    font-size: 1rem;
    font-weight: 800;
}

.sync-status {
    display: inline-flex;
    height: 40px;
    align-items: center;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--surface-glass);
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.icon-button {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: var(--brand);
    color: #07120e;
    cursor: pointer;
    font-size: 1.4rem;
    line-height: 1;
    display: grid;
    place-items: center;
    box-shadow: 0 8px 24px rgba(223, 177, 38, 0.3);
}

.icon-button:hover {
    background: var(--ink);
    transform: scale(1.05);
}

.refresh-app-btn {
    display: inline-flex;
    height: 40px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-glass);
    color: var(--ink);
    padding: 0 14px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 700;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.refresh-app-btn:hover {
    background: var(--surface-soft);
    border-color: var(--brand);
    box-shadow: 0 4px 15px rgba(223, 177, 38, 0.1);
}

.refresh-app-btn:active {
    transform: scale(0.97);
}

.refresh-app-btn.spinning span:first-child {
    animation: spin 0.8s linear infinite;
}

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

/* Tabs */
.app-tabs {
    display: inline-flex;
    gap: 4px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-glass);
    padding: 4px;
    margin-bottom: 24px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.app-tabs button {
    height: 38px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    padding: 0 18px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.88rem;
}

.app-tabs button:hover {
    color: var(--ink);
}

.app-tabs button.active {
    background: var(--brand);
    color: #07120e;
    font-weight: 800;
    box-shadow: 0 8px 20px rgba(223, 177, 38, 0.25);
}

/* Dashboard & Sections */
.dashboard {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
    gap: 20px;
    align-items: start;
}

section {
    border: 1px solid var(--line);
    border-radius: 20px;
    background: linear-gradient(145deg, var(--surface) 0%, #081512 100%);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.02);
    overflow: hidden;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.location-panel,
.prayer-panel,
.weather-panel,
.mosque-panel,
.qibla-panel {
    padding: 24px;
}

.location-panel,
.mosque-panel,
.qibla-panel {
    grid-column: 1 / -1;
}

.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.panel-heading.compact {
    margin-bottom: 16px;
}

.panel-heading h2,
.weather-panel h2,
.mosque-panel h2 {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -0.3px;
    color: var(--ink);
}

.panel-heading p,
.weather-panel p,
.mosque-panel p {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.4;
}

/* Selector Grid */
.selector-grid {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto;
    gap: 14px;
    align-items: end;
    background: var(--surface-soft);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--line);
}

label {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

select {
    width: 100%;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink);
    padding: 0 14px;
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2382a39a'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
}

select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(223, 177, 38, 0.15);
}

select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Buttons */
.primary-button,
.secondary-button {
    height: 44px;
    border: 0;
    border-radius: 10px;
    padding: 0 22px;
    cursor: pointer;
    font-weight: 800;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
}

.primary-button {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    color: #050d0a;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 24px rgba(223, 177, 38, 0.28);
}

.primary-button:hover {
    background: linear-gradient(135deg, #ffffff 0%, var(--brand) 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(223, 177, 38, 0.38);
}

.secondary-button {
    border: 1px solid var(--line);
    background: var(--surface-soft);
    color: var(--ink);
}

.secondary-button:hover {
    background: var(--surface);
    border-color: var(--brand);
}

.primary-button.compact,
.secondary-button.compact {
    height: 36px;
    padding: 0 14px;
    font-size: 0.8rem;
    border-radius: 8px;
}

.link-button {
    text-decoration: none;
}

.link-button[aria-disabled="true"] {
    pointer-events: none;
    opacity: 0.4;
}

/* Prayer Panel */
.next-prayer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 24px;
    background: linear-gradient(135deg, #0d3830 0%, #061e1a 100%);
    border-radius: 16px;
    border: 1px solid var(--line-active);
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 12px 35px rgba(223, 177, 38, 0.14), inset 0 0 20px rgba(23, 107, 91, 0.25);
}

.next-prayer::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(223, 177, 38, 0.12) 0%, transparent 70%);
    pointer-events: none;
}

.next-prayer h2 {
    margin-top: 4px;
    font-size: clamp(1.8rem, 5vw, 2.6rem);
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.5px;
    color: var(--brand);
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.countdown {
    min-width: 124px;
    border-radius: 10px;
    background: rgba(223, 177, 38, 0.12);
    color: var(--brand);
    border: 1px solid rgba(223, 177, 38, 0.35);
    padding: 10px 14px;
    text-align: center;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    font-variant-numeric: tabular-nums;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    animation: countdownPulse 3s infinite ease-in-out;
}

@keyframes countdownPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 15px rgba(0,0,0,0.15); }
    50% { transform: scale(1.02); border-color: var(--brand); box-shadow: 0 4px 20px rgba(223, 177, 38, 0.15); }
}

.time-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
    background: var(--surface-soft);
    padding: 10px 14px;
    border-radius: 10px;
}

#currentClock {
    color: var(--ink);
    font-weight: 800;
}

.prayer-grid,
.weather-grid {
    display: grid;
    gap: 12px;
}

.prayer-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.prayer-time,
.weather-card,
.mosque-item {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-soft);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.prayer-time {
    padding: 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.prayer-time:hover {
    border-color: rgba(223, 177, 38, 0.25);
    transform: translateY(-2px);
}

.prayer-time.active {
    border-color: var(--brand);
    background: var(--accent-soft);
    box-shadow: var(--shadow-active), inset 0 0 10px rgba(223, 177, 38, 0.05);
}

.prayer-time span,
.weather-card span {
    display: block;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.prayer-time.active span {
    color: var(--brand);
}

.prayer-time strong {
    display: block;
    margin-top: 6px;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.prayer-time.active strong {
    color: var(--brand);
    text-shadow: 0 0 10px rgba(223, 177, 38, 0.15);
}

/* Weather Panel */
.weather-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.weather-card-type {
    font-size: 0.65rem !important;
    font-weight: 800;
    letter-spacing: 0.8px;
    color: var(--brand) !important;
    margin-bottom: 4px;
}

.weather-range {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
}

.weather-range .max-temp {
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--ink);
    line-height: 1.1;
}

.weather-range .min-temp {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--muted);
}

.weather-card {
    min-height: 120px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
}

.weather-card:hover {
    border-color: var(--line-active);
    transform: translateY(-2px);
}

.weather-card strong {
    display: block;
    font-size: 1.65rem;
    font-weight: 800;
}

.weather-visual {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.weather-large-icon {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 50%;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 1.6rem;
    box-shadow: inset 0 0 0 1px rgba(223, 177, 38, 0.2);
}

.weather-metrics {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.weather-metrics span {
    display: inline-flex;
    height: 22px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--surface);
    color: var(--muted);
    padding: 0 8px;
    font-size: 0.7rem;
    font-weight: 700;
}

/* Mosque Panel (Harita ve Liste) */
.map-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.7fr);
    gap: 16px;
    min-height: 480px;
}

.map-container-relative {
    position: relative;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--line);
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
    background-color: #0b110e;
}

.map-overlay-btn {
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: var(--surface-glass);
    border: 1px solid var(--line);
    color: var(--ink);
    padding: 8px 18px;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 6px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.map-overlay-btn:hover {
    background: var(--surface-soft);
    border-color: var(--brand);
    transform: translateX(-50%) translateY(-1px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.5);
}

.map-overlay-btn:active {
    transform: translateX(-50%) scale(0.97);
}

#map {
    width: 100%;
    height: 480px;
    z-index: 1;
}

.mosque-list {
    display: grid;
    align-content: start;
    gap: 12px;
    max-height: 480px;
    overflow-y: auto;
    padding-right: 6px;
}

/* Custom Scrollbar */
.mosque-list::-webkit-scrollbar {
    width: 6px;
}
.mosque-list::-webkit-scrollbar-track {
    background: transparent;
}
.mosque-list::-webkit-scrollbar-thumb {
    background: var(--line);
    border-radius: 10px;
}
.mosque-list::-webkit-scrollbar-thumb:hover {
    background: var(--muted);
}

.mosque-item {
    padding: 16px;
}

.mosque-item:hover {
    border-color: var(--line-active);
    transform: translateY(-1px);
}

.mosque-item h3 {
    font-size: 1rem;
    font-weight: 800;
    color: var(--ink);
}

.mosque-item p {
    margin: 6px 0 12px;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 600;
}

.mosque-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mini-link {
    display: inline-flex;
    height: 32px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    padding: 0 14px;
    background: var(--brand);
    color: #07120e;
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 800;
}

.mini-link:hover {
    background: var(--ink);
}

.mini-link.secondary {
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
}

.mini-link.secondary:hover {
    border-color: var(--brand);
    background: var(--surface-soft);
}

/* Qibla Panel & Rotatable Circular Map */
.qibla-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
    gap: 20px;
    align-items: center;
}

.qibla-map-wrapper {
    border-radius: 50% !important;
    width: 100%;
    aspect-ratio: 1;
    max-width: 440px;
    margin: 0 auto;
    box-shadow: 0 20px 50px rgba(0,0,0,0.65), inset 0 0 30px rgba(0,0,0,0.5);
    border: 4px solid var(--line);
    transition: border-color 0.3s;
    background-color: #000;
}

.qibla-map-wrapper:focus-within,
.qibla-map-wrapper:hover {
    border-color: var(--brand);
}

#qiblaMap {
    width: 100%;
    height: 100% !important;
    border-radius: 50%;
    z-index: 1;
    /* CSS rotation will be applied to .leaflet-map-pane inside it, 
       this ensures we can rotate the tiles and markers natively! */
}

/* Leaflet pane rotation transitions */
.leaflet-map-pane {
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.qibla-card {
    display: grid;
    align-content: start;
    justify-items: center;
    gap: 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-soft);
    padding: 20px;
    text-align: center;
}

.qibla-compass {
    width: min(160px, 45vw);
    aspect-ratio: 1;
    border: 3px solid var(--brand);
    border-radius: 50%;
    background: 
        radial-gradient(circle, transparent 40%, rgba(223, 177, 38, 0.05) 100%),
        linear-gradient(90deg, transparent 49.5%, var(--line) 50%, transparent 50.5%),
        linear-gradient(0deg, transparent 49.5%, var(--line) 50%, transparent 50.5%),
        var(--surface);
    display: grid;
    place-items: center;
    box-shadow: inset 0 0 25px rgba(0, 0, 0, 0.5), 0 0 20px rgba(223, 177, 38, 0.15);
    position: relative;
}

.qibla-compass::before {
    content: 'K';
    position: absolute;
    top: 6px;
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--danger);
}

.qibla-arrow {
    display: grid;
    width: 62px;
    height: 62px;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    color: #07120e;
    font-size: 2rem;
    box-shadow: 0 10px 25px rgba(223, 177, 38, 0.45);
    transform-origin: center;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    border: 2px solid #ffffff;
}

.qibla-metrics-box span {
    display: block;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.qibla-metrics-box strong {
    display: block;
    margin-top: 4px;
    font-size: 2rem;
    font-weight: 800;
    color: var(--brand);
    text-shadow: 0 0 10px rgba(223, 177, 38, 0.1);
}

.qibla-metrics-box p {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 700;
}

.card-divider {
    width: 100%;
    border: 0;
    border-top: 1px solid var(--line);
    margin: 4px 0;
}

/* Qibla rotation controls UI */
.qibla-rotation-group {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.rotation-label {
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rotation-slider-row {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
}

.rotation-step-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 800;
    display: grid;
    place-items: center;
}

.rotation-step-btn:hover {
    border-color: var(--brand);
    color: var(--brand);
    background: var(--surface-soft);
}

#qiblaMapRotation {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: var(--line);
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

#qiblaMapRotation::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--brand);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    transition: transform 0.1s;
}

#qiblaMapRotation::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.qibla-actions-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.qibla-actions-row button {
    width: 100%;
}

/* Turkey Search */
.turkey-search {
    display: grid;
    grid-template-columns: minmax(200px, 1fr) auto auto;
    gap: 10px;
    margin-bottom: 16px;
    background: var(--surface-soft);
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--line);
}

.turkey-search input {
    width: 100%;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
    padding: 0 14px;
    outline: none;
}

.turkey-search input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(223, 177, 38, 0.15);
}

/* Map Markers Styling in Leaflet */
.mosque-map-marker span,
.kaaba-marker span,
.user-map-marker span {
    transition: transform 0.2s;
}

.mosque-map-marker span:hover,
.kaaba-marker span:hover,
.user-map-marker span:hover {
    transform: scale(1.15);
}

/* General Extras */
.empty-state {
    border: 1px dashed var(--line);
    border-radius: 12px;
    padding: 24px;
    color: var(--muted);
    background: rgba(11, 26, 22, 0.4);
    line-height: 1.5;
    text-align: center;
    font-size: 0.9rem;
}

.toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 3000;
    max-width: min(400px, calc(100vw - 48px));
    border-radius: 12px;
    background: #0f241e;
    color: var(--ink);
    border: 1px solid var(--line-active);
    padding: 14px 18px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-weight: 600;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* Leaflet Popups Custom */
.leaflet-popup-content-wrapper {
    background: var(--surface) !important;
    color: var(--ink) !important;
    border: 1px solid var(--line) !important;
    border-radius: 10px !important;
    box-shadow: var(--shadow) !important;
}

.leaflet-popup-tip {
    background: var(--surface) !important;
    border: 1px solid var(--line) !important;
}

.leaflet-popup-content h3 {
    margin: 0 0 6px;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--brand);
}

.leaflet-popup-content p {
    margin: 0;
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 600;
}

/* Custom premium styling for Leaflet controls */
.leaflet-bar {
    border: 1px solid var(--line) !important;
    box-shadow: var(--shadow) !important;
    border-radius: 8px !important;
    overflow: hidden;
}

.leaflet-bar a {
    background-color: var(--surface-glass) !important;
    color: var(--ink) !important;
    border-bottom: 1px solid var(--line) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
}

.leaflet-bar a:hover {
    background-color: var(--surface-soft) !important;
    color: var(--brand) !important;
}

.leaflet-control-layers-expanded {
    background: var(--surface-glass) !important;
    border: 1px solid var(--line) !important;
    color: var(--ink) !important;
    border-radius: 10px !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 8px 12px !important;
}

/* Responsive Breakpoints */
@media (max-width: 900px) {
    .dashboard,
    .map-layout,
    .qibla-layout {
        grid-template-columns: 1fr;
    }

    .selector-grid {
        grid-template-columns: 1fr 1fr;
    }

    #refreshBtn {
        grid-column: 1 / -1;
    }

    .mosque-list {
        max-height: none;
        overflow: visible;
        padding-right: 0;
    }

    .qibla-map-wrapper {
        max-width: min(360px, 80vw);
    }

    .weather-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 620px) {
    .app-shell {
        width: min(100% - 20px, 1200px);
        padding-top: 14px;
    }

    .topbar,
    .panel-heading,
    .next-prayer,
    .time-row {
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
    }

    .topbar-actions {
        justify-content: space-between;
    }

    .header-weather,
    .sync-status,
    .refresh-app-btn {
        flex: 1;
    }

    .app-tabs {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        width: 100%;
    }

    .selector-grid,
    .turkey-search,
    .prayer-grid {
        grid-template-columns: 1fr;
    }

    .weather-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .location-panel,
    .prayer-panel,
    .weather-panel,
    .mosque-panel,
    .qibla-panel {
        padding: 16px;
    }

    #map {
        height: 360px;
    }
}
