
:root {
    --bg: #FAF9F6;
    --surface: #FFFFFF;
    --surface-2: #F4F2EC;
    --surface-3: #ECEAE2;
    --border: #EAE8E1;
    --border-strong: #D8D5CB;
    --text: #1C1C1C;
    --text-secondary: #4A4A4A;
    --text-muted: #8A8A8A;
    --accent: #E8A317;
    --accent-hover: #C9881A;
    --accent-soft: #FEF3C7;
    --planned: #059669;
    --planned-soft: #D1FAE5;
    --urgent: #DC2626;
    --urgent-soft: #FEE2E2;
    --ad-bg: #FAF7EC;
    --ad-border: #E5DFC9;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .04);
    --shadow: 0 4px 16px rgba(0, 0, 0, .06);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, .08);
}

html.dark {
    --bg: #0A0A0A;
    --surface: #131313;
    --surface-2: #1A1A1A;
    --surface-3: #222;
    --border: #262626;
    --border-strong: #383838;
    --text: #F5F5F0;
    --text-secondary: #C0C0BC;
    --text-muted: #888884;
    --accent: #FBBF24;
    --accent-hover: #F59E0B;
    --accent-soft: rgba(251, 191, 36, .12);
    --planned: #34D399;
    --planned-soft: rgba(52, 211, 153, .15);
    --urgent: #F87171;
    --urgent-soft: rgba(248, 113, 113, .15);
    --ad-bg: rgba(232, 163, 23, .04);
    --ad-border: rgba(232, 163, 23, .18);
}

html:has(#themeToggle:checked) {
    --bg: #0A0A0A;
    --surface: #131313;
    --surface-2: #1A1A1A;
    --surface-3: #222;
    --border: #262626;
    --border-strong: #383838;
    --text: #F5F5F0;
    --text-secondary: #C0C0BC;
    --text-muted: #888884;
    --accent: #FBBF24;
    --accent-hover: #F59E0B;
    --accent-soft: rgba(251, 191, 36, .12);
    --planned: #34D399;
    --planned-soft: rgba(52, 211, 153, .15);
    --urgent: #F87171;
    --urgent-soft: rgba(248, 113, 113, .15);
    --ad-bg: rgba(232, 163, 23, .04);
    --ad-border: rgba(232, 163, 23, .18);
}

* {
    font-family: 'Vazirmatn', system-ui, sans-serif;
}

body {
    background: var(--bg);
    color: var(--text);
    transition: background .3s, color .3s;
    line-height: 1.7;
    overflow-x: hidden;
}

html.show-app-splash, html.show-app-splash body {
    overflow: hidden;
}

.app-splash {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    place-items: center;
    overflow: hidden;
    background: #0a0a0a;
    color: #f5f5f0;
    opacity: 1;
    transition: opacity .24s cubic-bezier(.23, 1, .32, 1);
}

.show-app-splash .app-splash {
    display: grid;
}

.app-splash.is-leaving {
    opacity: 0;
    pointer-events: none;
}

.splash-circuit {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: .42;
}

.splash-circuit path {
    fill: none;
    stroke: #34312a;
    stroke-width: 1.5;
    stroke-dasharray: 700;
    stroke-dashoffset: 700;
    animation: splash-circuit-draw 1.05s cubic-bezier(.23, 1, .32, 1) forwards;
}

.splash-circuit path:nth-child(2) {
    animation-delay: .12s;
}

.splash-circuit path:nth-child(3) {
    animation-delay: .2s;
}

.splash-nodes circle {
    fill: #fbbf24;
    opacity: 0;
    transform-box: fill-box;
    transform-origin: center;
    animation: splash-node-in .3s cubic-bezier(.23, 1, .32, 1) .65s forwards;
}

.splash-content {
    position: relative;
    z-index: 1;
    width: min(86vw, 360px);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.splash-mark {
    position: relative;
    width: 108px;
    height: 108px;
    display: grid;
    place-items: center;
    margin-bottom: 24px;
}

.splash-logo {
    position: relative;
    z-index: 2;
    width: 76px;
    height: 76px;
    border-radius: 24px;
    display: grid;
    place-items: center;
    color: #171717;
    background: linear-gradient(145deg, #fde68a, #fbbf24 58%, #e8a317);
    box-shadow: 0 18px 50px rgba(251, 191, 36, .2);
    opacity: 0;
    transform: translateY(8px) scale(.94);
    animation: splash-logo-in .55s cubic-bezier(.23, 1, .32, 1) .18s forwards;
}

.splash-ring {
    position: absolute;
    inset: 7px;
    border: 1px solid rgba(251, 191, 36, .28);
    border-radius: 30px;
    opacity: 0;
    animation: splash-ring 1.5s cubic-bezier(.23, 1, .32, 1) .45s infinite;
}

.splash-ring-two {
    animation-delay: .72s;
}

.splash-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    opacity: 0;
    transform: translateY(7px);
    animation: splash-copy-in .5s cubic-bezier(.23, 1, .32, 1) .38s forwards;
}

.splash-copy strong {
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -.02em;
}

.splash-copy span {
    font-size: 12px;
    color: #96938b;
}

.splash-progress {
    width: 190px;
    height: 3px;
    margin-top: 28px;
    border-radius: 999px;
    overflow: hidden;
    background: #24231f;
}

.splash-progress span {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #e8a317, #fde68a);
    transform: translateX(100%);
    animation: splash-progress-fill 1.15s cubic-bezier(.23, 1, .32, 1) .18s forwards;
}

.splash-status {
    margin-top: 10px;
    color: #77746d;
    font-size: 10px;
    opacity: 0;
    animation: splash-status-in .35s cubic-bezier(.23, 1, .32, 1) .55s forwards;
}

@keyframes splash-circuit-draw {
    to {
        stroke-dashoffset: 0
    }
}

@keyframes splash-node-in {
    to {
        opacity: 1;
        transform: scale(1)
    }
}

@keyframes splash-logo-in {
    to {
        opacity: 1;
        transform: translateY(0) scale(1)
    }
}

@keyframes splash-copy-in {
    to {
        opacity: 1;
        transform: translateY(0)
    }
}

@keyframes splash-ring {
    0% {
        opacity: .55;
        transform: scale(.72)
    }
    100% {
        opacity: 0;
        transform: scale(1.18)
    }
}

@keyframes splash-progress-fill {
    to {
        transform: translateX(0)
    }
}

@keyframes splash-status-in {
    to {
        opacity: 1
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-splash {
        transition: opacity .15s ease
    }

    .splash-circuit path {
        stroke-dashoffset: 0;
        animation: none
    }

    .splash-nodes circle, .splash-logo, .splash-copy, .splash-status {
        opacity: 1;
        transform: none;
        animation: none
    }

    .splash-ring {
        display: none
    }

    .splash-progress span {
        transform: none;
        animation: none
    }
}

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

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

::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 10px;
    border: 2px solid var(--bg);
}

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

/* پس‌زمینه شبکه برق متحرک */
.hero-bg {
    position: relative;
    overflow: hidden;
    background: var(--bg);
}

.grid-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: .6;
    z-index: 0;
}

.grid-line {
    stroke: var(--border);
    stroke-width: 1;
    fill: none;
}

.grid-node {
    fill: var(--border-strong);
}

.grid-pulse {
    fill: var(--accent);
}

@keyframes movePulse {
    0% {
        offset-distance: 0%;
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        offset-distance: 100%;
        opacity: 0;
    }
}

.pulse-dot {
    offset-path: path('M0,100 Q200,50 400,100 T800,80');
    animation: movePulse 4s linear infinite;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: .4;
    pointer-events: none;
    z-index: 0;
}

@keyframes floatOrb1 {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(40px, -30px) scale(1.1);
    }
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: var(--accent);
    top: -10%;
    right: -5%;
    animation: floatOrb1 12s ease-in-out infinite;
}

.surface {
    background: var(--surface);
    border: 1px solid var(--border);
}

.surface-2 {
    background: var(--surface-2);
}

.text-muted {
    color: var(--text-muted);
}

.text-secondary {
    color: var(--text-secondary);
}

.border-default {
    border-color: var(--border);
}

.border-strong {
    border-color: var(--border-strong);
}

.btn-primary {
    background: var(--accent);
    color: #1a1a1a;
    font-weight: 700;
    transition: all .2s;
    box-shadow: 0 4px 14px rgba(232, 163, 23, .3);
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(232, 163, 23, .4);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    transition: all .2s;
    position: relative;
    overflow: hidden;
}

.btn-ghost:hover {
    background: var(--surface-2);
    color: var(--text);
    border-color: var(--border-strong);
}

.ripple {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    animation: rippleEffect .6s linear;
    background: rgba(255, 255, 255, .5);
}

@keyframes rippleEffect {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.badge-planned {
    background: var(--planned-soft);
    color: var(--planned);
    border: 1px solid rgba(5, 150, 105, .2);
}

.badge-urgent {
    background: var(--urgent-soft);
    color: var(--urgent);
    border: 1px solid rgba(220, 38, 38, .2);
}

html.dark .badge-planned {
    border-color: rgba(52, 211, 153, .25);
}

html.dark .badge-urgent {
    border-color: rgba(248, 113, 113, .25);
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite linear;
    border-radius: 8px;
}

.drawer-backdrop {
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s;
    backdrop-filter: blur(3px);
}

.drawer-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.filter-drawer {
    position: fixed;
    z-index: 1000;
    right: 50%;
    bottom: 16px;
    width: min(420px, calc(100vw - 24px));
    max-height: min(72vh, 620px);
    overflow: hidden;
    border-radius: 22px;
    box-shadow: var(--shadow-lg);
    transform: translate(50%, calc(100% + 40px));
    opacity: 0;
    pointer-events: none;
    transition: transform .35s cubic-bezier(.32, .72, 0, 1), opacity .2s;
}

.filter-drawer.active {
    transform: translate(50%, 0);
    opacity: 1;
    pointer-events: auto;
}

.dropdown-chevron {
    transition: transform .18s cubic-bezier(.23, 1, .32, 1);
    transform-origin: center;
}

[aria-expanded="true"] .dropdown-chevron {
    transform: rotate(180deg);
}

.drawer-header {
    position: relative;
    min-height: 58px;
    padding: 22px 16px 10px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
}

.drawer-header h3 {
    font-size: 14px;
    font-weight: 700;
}

.drawer-handle {
    position: absolute;
    top: 8px;
    right: 50%;
    transform: translateX(50%);
    width: 42px;
    height: 4px;
    border-radius: 8px;
    background: var(--border-strong);
}

.drawer-close {
    position: absolute;
    left: 12px;
    bottom: 9px;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--surface-2);
    font-size: 22px;
    line-height: 1;
    color: var(--text-muted);
}

.drawer-list {
    max-height: 50vh;
    overflow-y: auto;
    padding: 8px;
}

.city-option, .drawer-option {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    text-align: right;
    transition: background .15s, color .15s;
}

.city-option:hover {
    background: var(--surface-2);
}

.city-option.active, .drawer-option.active {
    background: var(--accent-soft);
    color: var(--accent);
}

.drawer-option:hover {
    background: var(--surface-2);
}

body.drawer-open {
    overflow: hidden;
}

@media (min-width: 768px) {
    .filter-drawer {
        max-height: 340px;
        border-radius: 14px;
        transform: translateY(-8px) scale(.98);
        transform-origin: top center;
        transition: transform .18s ease, opacity .15s;
    }

    .filter-drawer.active {
        transform: translateY(0) scale(1);
    }

    .filter-drawer .drawer-header {
        display: none;
    }

    .filter-drawer .drawer-list {
        max-height: 270px;
    }

    #statusPanel, #sortPanel {
        max-height: none;
    }
}

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

.fade-up {
    animation: fadeUp .4s ease-out backwards;
}

.ad-slot {
    background: var(--ad-bg);
    border: 1px dashed var(--ad-border);
    color: var(--text-muted);
}

.nums {
    font-feature-settings: "ss01";
}

.sticky-filter {
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    background: color-mix(in srgb, var(--bg) 88%, transparent);
}

.filter-toolbar {
    display: grid;
    grid-template-columns:repeat(2, minmax(0, 1fr));
    grid-template-areas:"city city" "from to" "status status" "actions actions";
    align-items: end;
    gap: 10px;
    padding: 11px;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .06);
}

.filter-field {
    min-width: 0;
}

.filter-city {
    grid-area: city;
}

.filter-from-date {
    grid-area: from;
}

.filter-to-date {
    grid-area: to;
}

.filter-status {
    grid-area: status;
}

.filter-label {
    display: block;
    margin: 0 3px 6px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
    line-height: 1;
}

.filter-control {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 14px;
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.filter-control:focus-visible {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.filter-control-icon {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    background: var(--accent-soft);
    flex: none;
}

.filter-actions {
    grid-area: actions;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.filter-submit, .filter-reset {
    height: 44px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    white-space: nowrap;
}

.filter-submit {
    flex: 1;
    padding: 0 18px;
    font-weight: 700;
}

.filter-reset {
    padding: 0 13px;
}

@media (hover: hover) and (pointer: fine) {
    .filter-control:hover {
        border-color: var(--border-strong);
        background: var(--surface-2);
    }
}

@media (min-width: 768px) {
    .filter-toolbar {
        grid-template-columns:repeat(4, minmax(0, 1fr));
        grid-template-areas:"city city status status" "from to actions actions";
    }
}

@media (min-width: 1024px) {
    .filter-toolbar {
        grid-template-columns:minmax(170px, 1.1fr) minmax(145px, 1fr) minmax(145px, 1fr) minmax(135px, .85fr) auto;
        grid-template-areas:"city from to status actions";
        gap: 12px;
        padding: 12px;
    }
}

@media (max-width: 767px) {
    #filters {
        position: relative;
        top: auto
    }

    .filter-toolbar {
        box-shadow: none
    }
}

@media (max-width: 420px) {
    .filter-toolbar {
        padding: 9px;
        gap: 9px
    }

    .filter-submit {
        padding-inline: 12px
    }

    .filter-reset span {
        display: none
    }

    .filter-reset {
        width: 44px;
        padding: 0
    }
}

/* ۳D Tilt Card */
.tilt-card {
    transform-style: preserve-3d;
    transition: transform .1s ease-out, box-shadow .2s;
    position: relative;
    overflow: hidden;
}

.tilt-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--accent);
}

.tilt-shine {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at var(--mx) var(--my), rgba(255, 255, 255, .4), transparent 40%);
    opacity: 0;
    transition: opacity .3s;
    pointer-events: none;
    z-index: 2;
}

.tilt-card:hover .tilt-shine {
    opacity: 0.3;
}

.tilt-content {
    transform: translateZ(20px);
}

/* Live outage progress */
.progress-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .45rem;
    font-size: .7rem;
}

.progress-status {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-weight: 700;
}

.progress-status::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: currentColor;
    box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 14%, transparent);
}

.progress-detail {
    color: var(--text-muted);
    white-space: nowrap;
}

.duration-bar {
    height: 8px;
    background: var(--surface-3);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, .1);
}

.duration-fill {
    height: 100%;
    border-radius: inherit;
    width: 0;
    position: relative;
    transition: width 1s cubic-bezier(.22, 1, .36, 1);
    overflow: hidden;
}

.duration-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 25%, rgba(255, 255, 255, .55) 48%, transparent 70%);
    transform: translateX(-120%);
}

.outage-progress.state-upcoming .progress-status {
    color: #d97706;
}

.outage-progress.state-upcoming .duration-fill {
    min-width: 16%;
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
    animation: upcoming-pulse 1.8s ease-in-out infinite;
}

.outage-progress.state-active .progress-status {
    color: var(--urgent);
}

.outage-progress.state-active .duration-fill {
    background: linear-gradient(90deg, #ef4444, #f97316, #fbbf24);
    box-shadow: 0 0 12px rgba(249, 115, 22, .35);
}

.outage-progress.state-active .duration-fill::after {
    animation: progress-shine 1.8s linear infinite;
}

.outage-progress.state-restored .progress-status {
    color: #16a34a;
}

.outage-progress.state-restored .duration-fill {
    background: linear-gradient(90deg, #16a34a, #22c55e, #4ade80);
}

.outage-progress.state-restored .duration-fill::after {
    transform: translateX(120%);
}

.outage-progress.state-unknown .progress-status {
    color: var(--text-muted);
}

.outage-progress.state-unknown .duration-fill {
    background: var(--border);
}

@keyframes upcoming-pulse {
    0%, 100% {
        filter: saturate(.9);
        box-shadow: 0 0 0 rgba(245, 158, 11, 0)
    }
    50% {
        filter: saturate(1.25);
        box-shadow: 0 0 12px rgba(245, 158, 11, .45)
    }
}

@keyframes progress-shine {
    to {
        transform: translateX(120%)
    }
}

@media (prefers-reduced-motion: reduce) {
    .duration-fill, .duration-fill::after {
        animation: none !important;
        transition: none !important;
    }
}

/* Timeline View */
.timeline-item {
    position: relative;
    padding-right: 2rem;
    border-right: 2px solid var(--border);
}

.timeline-item::before {
    content: '';
    position: absolute;
    right: -7px;
    top: 1rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--surface);
    border: 2px solid var(--accent);
    z-index: 1;
}

.timeline-item.urgent::before {
    border-color: var(--urgent);
    background: var(--urgent);
}

.timeline-item.planned::before {
    border-color: var(--planned);
    background: var(--planned);
}

button {
    user-select: none;
}

.count-num {
    font-variant-numeric: tabular-nums;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 6px;
}

/* Light Switch Toggle */
.switch-track {
    width: 56px;
    height: 28px;
    background: var(--surface-3);
    border-radius: 14px;
    position: relative;
    cursor: pointer;
    border: 1px solid var(--border-strong);
    transition: all .3s;
}

.switch-thumb {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 22px;
    height: 22px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: all .3s cubic-bezier(.32, .72, 0, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-checkbox {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.theme-checkbox:focus-visible + .switch-track {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.theme-checkbox:checked + .switch-track {
    background: var(--accent-soft);
    border-color: var(--accent);
}

.theme-checkbox:checked + .switch-track .switch-thumb {
    right: calc(100% - 26px);
    background: var(--accent);
    color: #fff;
}

.header-faq-link{height:36px;padding:0 11px;display:inline-flex;align-items:center;gap:7px;border:1px solid var(--border);border-radius:11px;background:var(--surface-2);color:var(--text-secondary);font-size:12px;font-weight:600;transition:color 160ms ease,background-color 160ms ease,border-color 160ms ease,transform 140ms cubic-bezier(.23,1,.32,1);}
.header-faq-link:focus-visible{outline:2px solid var(--accent);outline-offset:2px;}
.header-faq-link:active{transform:scale(.97);}
@media(hover:hover) and (pointer:fine){.header-faq-link:hover{color:var(--text);background:var(--surface-3);border-color:var(--border-strong);}}
@media(max-width:520px){.header-faq-link span{display:none}.header-faq-link{width:36px;padding:0;justify-content:center}}

.active-view {
    background: var(--surface-2);
    color: var(--accent) !important;
}

.bookmark-button {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: color .15s, background .15s, transform .15s;
}

.bookmark-button:hover {
    color: var(--accent);
    background: var(--accent-soft);
    transform: translateY(-1px);
}

.bookmark-button.active {
    color: var(--accent);
    background: var(--accent-soft);
}

.bookmark-button.active svg {
    fill: currentColor;
}

.date-input-wrap {
    position: relative;
    width: 100%;
}

.date-input {
    width: 100%;
    height: 44px;
    padding: 0 50px 0 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: 14px;
    outline: none;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s, background .2s;
}

.date-input:hover {
    border-color: var(--border-strong);
}

.date-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.date-input-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    width: 28px;
    height: 28px;
    padding: 6px;
    border-radius: 9px;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 1;
    color: var(--accent) !important;
    background: var(--accent-soft);
}

jdp-container {
    --jdp-day-size: 46px;
    --jdp-color-0: var(--surface);
    --jdp-color-1: var(--surface-2);
    --jdp-color-2: var(--surface-3);
    --jdp-color-3: var(--border-strong);
    --jdp-color-4: var(--text-muted);
    --jdp-color-5: var(--text);
    --jdp-primary: var(--accent);
    --jdp-red: var(--urgent);
    font-family: 'Vazirmatn', sans-serif !important;
    z-index: 1000 !important;
    border: 1px solid  var(--border) !important;
    border-radius: 18px !important;
    padding: 10px 8px 8px !important;
    box-shadow: 0 18px 55px rgba(0, 0, 0, .16), 0 0 0 1px color-mix(in srgb, var(--accent) 8%, transparent) !important;
    animation: calendar-pop .18s cubic-bezier(.23, 1, .32, 1) !important;
}

jdp-container .jdp-years, jdp-container .jdp-months {
    height: 52px;
    position: relative;
    align-items: flex-end;
    justify-content: center;
    background: color-mix(in srgb, var(--surface-2) 82%, transparent);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-inline: 1.5%;
    padding: 18px 7px 5px;
}

jdp-container .jdp-years {
    width: 38%;
}

jdp-container .jdp-months {
    width: 55%;
}

jdp-container .jdp-years::before, jdp-container .jdp-months::before {
    position: absolute;
    top: 5px;
    right: 9px;
    color: var(--text-muted);
    font-size: 9px;
    line-height: 1;
}

jdp-container .jdp-years::before {
    content: 'سال';
}

jdp-container .jdp-months::before {
    content: 'ماه';
}

jdp-container .jdp-year select, jdp-container .jdp-month select {
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    pointer-events: none;
    appearance: none;
    opacity: 1;
    color: var(--text);
    background: transparent;
}

jdp-container .jdp-years, jdp-container .jdp-months {
    display: none !important;
}

.date-period {
    height: 48px;
    margin: 0 4px 7px;
    padding: 0 10px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: color-mix(in srgb, var(--surface-2) 86%, transparent);
    color: var(--text);
    overflow: hidden;
}

.date-period::after {
    content: '';
    position: absolute;
    right: 12px;
    left: 12px;
    bottom: 0;
    height: 1px;
    background: var(--border);
}

.date-period-icon {
    width: 28px;
    height: 28px;
    margin-left: 2px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    background: var(--accent-soft);
    flex: none;
}

.date-period-month, .date-period-year {
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
}

.date-period-separator {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

jdp-container .jdp-icon-plus, jdp-container .jdp-icon-minus {
    display: none !important;
}

jdp-container .jdp-days {
    gap: 2px;
    justify-content: flex-start;
    padding: 5px 4px 2px;
}

jdp-container .jdp-days-header {
    margin: 6px 4px 3px;
    padding: 0 !important;
    border-bottom: 1px solid var(--border);
    background: transparent !important;
}

jdp-container .jdp-day, jdp-container .jdp-day-name {
    width: calc((100% - 12px) / 7);
    flex-basis: calc((100% - 12px) / 7);
    margin: 0;
    font-weight: 400 !important;
}

jdp-container .jdp-day-name {
    height: 28px;
    line-height: 28px;
    color: var(--text-muted);
    font-size: 10px !important;
}

jdp-container .jdp-day {
    height: 36px;
    line-height: 34px;
    border-radius: 10px !important;
    border: 1px solid transparent;
    transition: transform .14s ease, background-color .14s ease, border-color .14s ease, color .14s ease;
}

jdp-container .jdp-day.not-in-month {
    opacity: .2;
}

jdp-container .jdp-day.disabled-day {
    opacity: .12;
}

jdp-container .jdp-day.today {
    border-color: color-mix(in srgb, var(--accent) 55%, var(--border)) !important;
    background: var(--accent-soft);
    color: var(--accent) !important;
}

jdp-container .jdp-day.selected, jdp-container .jdp-day.is-input-selected {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    color: #171717 !important;
    box-shadow: none;
}

jdp-container .jdp-day.selected::after, jdp-container .jdp-day.is-input-selected::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #171717;
    opacity: .55;
}

jdp-container .jdp-day.is-input-selected.today {
    outline: 2px solid color-mix(in srgb, var(--accent) 32%, var(--text));
    outline-offset: 2px;
}

jdp-container .jdp-footer {
    margin-top: 5px;
    padding: 10px 5px 2px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-start;
    gap: 8px;
}

jdp-container .jdp-footer .jdp-btn-close {
    display: none !important;
}

jdp-container .jdp-btn-today, jdp-container .jdp-btn-tomorrow {
    min-width: 76px;
    min-height: 36px;
    border: 1px solid transparent;
    border-radius: 11px !important;
    padding: 7px 15px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-family: inherit;
    font-size: 11px !important;
    font-weight: 600 !important;
    line-height: 1;
    cursor: pointer;
    transition: transform .14s ease, box-shadow .14s ease, background-color .14s ease;
}

jdp-container .jdp-btn-today {
    background: var(--accent) !important;
    color: #171717 !important;
    box-shadow: none;
}

jdp-container .jdp-btn-tomorrow {
    background: var(--surface-2);
    border-color: var(--border);
    color: var(--text);
}

jdp-container .jdp-btn-today::before, jdp-container .jdp-btn-tomorrow::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: .7;
}

jdp-container .jdp-btn-tomorrow:disabled {
    opacity: .4;
    cursor: not-allowed;
}

.date-drawer-header {
    display: none;
}

.date-drawer-heading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
}

.date-drawer-value {
    color: var(--accent);
    font-size: 10px;
    line-height: 1.2;
}

@media (hover: hover) and (pointer: fine) {
    jdp-container .jdp-day:not(.disabled-day):hover {
        z-index: 1;
        transform: translateY(-1px);
        background: var(--surface-3);
        border-color: var(--border-strong);
    }

    jdp-container .jdp-btn-today:hover, jdp-container .jdp-btn-tomorrow:not(:disabled):hover {
        transform: translateY(-1px);
        box-shadow: 0 7px 18px color-mix(in srgb, var(--accent) 22%, transparent);
    }
}

@media (max-width: 767px) {
    jdp-container {
        border-radius: 24px !important;
        padding: 12px 8px 9px !important;
        overflow: hidden !important;
        animation: calendar-drawer-in .28s cubic-bezier(.32, .72, 0, 1) !important
    }

    .date-drawer-header {
        display: flex;
        min-height: 68px;
        margin: -12px -8px 10px;
        width: calc(100% + 16px);
        flex: none;
        background: var(--surface)
    }

    .date-period {
        margin-inline: 8px;
        height: 50px
    }

    jdp-container .jdp-days-header {
        margin-top: 5px
    }
}

@keyframes calendar-pop {
    from {
        opacity: 0;
        transform: translateY(-5px) scale(.97)
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1)
    }
}

@keyframes calendar-drawer-in {
    from {
        opacity: 0;
        transform: translate(-50%, 16px)
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0)
    }
}

@media (prefers-reduced-motion: reduce) {
    .dropdown-chevron {
        transition-duration: .01ms;
    }

    jdp-container {
        animation: none !important
    }

    jdp-container .jdp-day {
        transition: none;
    }
}

.outage-table {
    border-collapse: collapse;
    min-width: 720px;
}

/* Dark Mode Sweep Effect */
.sweep-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 9999;
    transform: translateY(100%);
    pointer-events: none;
}

@keyframes sweepUp {
    0% {
        transform: translateY(100%);
    }
    50% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-100%);
    }
}

.sweep-active {
    animation: sweepUp .8s cubic-bezier(.7, 0, .3, 1) forwards;
}

/* Live Feed */
@keyframes livePing {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

.live-dot::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: currentColor;
    animation: livePing 1.8s ease-out infinite;
}

.feed-item-enter {
    animation: feedEnter .5s ease-out backwards;
}

@keyframes feedEnter {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

#backToTop {
    opacity: 0;
    transform: translateY(20px);
    transition: all .3s ease;
}

#backToTop.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all .8s cubic-bezier(.16, 1, .3, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 4px;
    right: 12px;
    left: 12px;
    height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform .3s ease;
    border-radius: 2px;
}

.nav-link:hover::after {
    transform: scaleX(1);
}

#resultsContainer {
    display: grid;
    gap: 16px;
}
