/* Dashboard clock card: neumorphic analog dial, seven-segment time, date and weather */

.clock-card {
    --cw-face1: #f3f6fb;
    --cw-face2: #e2e8f1;
    --cw-shadow-dark: rgba(160,174,198,.6);
    --cw-shadow-light: rgba(255,255,255,.95);
    --cw-number: #5a6478;
    --cw-dot: #9aa3b5;
    --cw-hour: #252b3a;
    --cw-minute: #3f7df5;
    --cw-second: #ff7a3d;
    --cw-lit: #2f6df0;
    --cw-ghost: rgba(47,109,240,.09);
    --cw-glow: rgba(47,109,240,.35);
    --cw-t: #6b8cf5;
    --cw-t2: #9a7cf5;
    position: relative;
    overflow: hidden;
    margin-bottom: 14px;
    border: 1px solid color-mix(in srgb, var(--cw-t) 24%, rgba(120,130,150,.22));
    border-radius: 22px;
    background:
        radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--cw-t) 26%, transparent), transparent 46%),
        radial-gradient(circle at 0% 100%, color-mix(in srgb, var(--cw-t2) 22%, transparent), transparent 48%),
        linear-gradient(150deg, color-mix(in srgb, var(--cw-t) 7%, var(--panel, #fff)), color-mix(in srgb, var(--cw-t2) 6%, var(--panel, #fff)));
    box-shadow: 0 14px 32px color-mix(in srgb, var(--cw-t) 12%, transparent), inset 0 1px 0 rgba(255,255,255,.5);
}

html[data-theme="dark"] .clock-card {
    --cw-face1: #2a3044;
    --cw-face2: #1d2233;
    --cw-shadow-dark: rgba(0,0,0,.55);
    --cw-shadow-light: rgba(255,255,255,.07);
    --cw-number: #b6c0d4;
    --cw-dot: #6c7690;
    --cw-hour: #eef1f7;
    --cw-minute: #6aa0ff;
    --cw-second: #ff8a4d;
    --cw-lit: #6fe3ff;
    --cw-ghost: rgba(111,227,255,.09);
    --cw-glow: rgba(111,227,255,.85);
}

.clock-card::after {
    content: '';
    position: absolute;
    width: 180px;
    height: 180px;
    inset-inline-end: -60px;
    top: -90px;
    border-radius: 50%;
    background: radial-gradient(circle, color-mix(in srgb, var(--cw-t) 30%, transparent), transparent 65%);
    animation: cwGlow 7s ease-in-out infinite;
    pointer-events: none;
}

.clock-card > * {
    position: relative;
    z-index: 1;
}

.cw-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px 0;
    font-size: 14px;
    font-weight: 800;
    color: var(--text1);
}

.cw-chip {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    font-size: 16px;
    color: #fff;
    background: linear-gradient(145deg, #8fb0ff, #4f6df0);
    box-shadow: 0 6px 14px rgba(79,109,240,.3);
}

.cw-place {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-inline-start: auto;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text2);
}

.cw-place i {
    color: #e5603a;
}

.cw-body {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    padding: 12px 16px 16px;
}

/* ---------- analog dial ---------- */
.cw-clock {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 17px;
}

.cw-dial {
    position: relative;
    width: 172px;
    height: 172px;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--cw-face1), var(--cw-face2));
    box-shadow: 12px 12px 24px var(--cw-shadow-dark), -12px -12px 24px var(--cw-shadow-light);
}

.cw-dial::before {
    content: '';
    position: absolute;
    inset: -12px;
    z-index: -1;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--cw-face2), var(--cw-face1));
    box-shadow: inset 5px 5px 12px var(--cw-shadow-dark), inset -5px -5px 12px var(--cw-shadow-light);
}

.cw-face {
    position: absolute;
    inset: 10px;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--cw-face2), var(--cw-face1));
    box-shadow: inset 4px 4px 10px var(--cw-shadow-dark), inset -4px -4px 10px var(--cw-shadow-light);
}

.cw-num {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    display: grid;
    place-items: center;
    font-size: 13px;
    font-weight: 800;
    color: var(--cw-number);
}

.cw-num.is-quarter {
    font-size: 15px;
    color: var(--text1);
}

.cw-tick {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 2px;
    height: 2px;
    margin: -1px;
    border-radius: 50%;
    background: var(--cw-dot);
    opacity: .7;
}

.cw-hand {
    position: absolute;
    left: 50%;
    bottom: 50%;
    transform-origin: 50% 100%;
    border-radius: 6px;
}

.cw-hour {
    width: 7px;
    height: 36%;
    margin-left: -3.5px;
    background: linear-gradient(90deg, var(--cw-hour), color-mix(in srgb, var(--cw-hour) 70%, #888));
    box-shadow: 2px 3px 6px rgba(0,0,0,.28);
}

.cw-minute {
    width: 5.5px;
    height: 45%;
    margin-left: -2.75px;
    background: linear-gradient(90deg, #5b92ff, var(--cw-minute));
    box-shadow: 2px 3px 6px rgba(63,125,245,.4);
}

.cw-second {
    width: 2px;
    height: 48%;
    margin-left: -1px;
    background: var(--cw-second);
    box-shadow: 1px 2px 4px rgba(255,122,61,.4);
    animation: cwSweep 60s linear infinite;
}

.cw-second::after {
    content: '';
    position: absolute;
    left: -1px;
    bottom: -14px;
    width: 4px;
    height: 14px;
    border-radius: 2px;
    background: var(--cw-second);
}

.cw-cap {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 3;
    width: 16px;
    height: 16px;
    margin: -8px;
    border: 3px solid var(--cw-face1);
    border-radius: 50%;
    background: var(--cw-hour);
    box-shadow: 0 2px 6px rgba(0,0,0,.35);
}

.cw-cap::after {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: var(--cw-second);
}

/* ---------- seven-segment time ---------- */
.cw-lcd {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.cw-lcd-panel {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 5px;
    padding: 11px 12px 10px;
    border-radius: 14px;
    direction: ltr;
    background: linear-gradient(145deg, var(--cw-face2), var(--cw-face1));
    box-shadow: inset 4px 4px 10px var(--cw-shadow-dark), inset -4px -4px 10px var(--cw-shadow-light);
}

.cw-digit {
    width: 24px;
    height: 41px;
    flex: none;
    overflow: visible;
}

.cw-digit.is-small {
    width: 14px;
    height: 24px;
    margin-bottom: 1px;
}

.cw-digit polygon {
    fill: var(--cw-ghost);
    transition: fill .12s ease;
}

.cw-digit polygon.is-on {
    fill: var(--cw-lit);
    filter: drop-shadow(0 0 2px var(--cw-glow));
}

.cw-colon {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 9px;
    height: 41px;
    padding: 0 1px;
}

.cw-colon i {
    width: 4px;
    height: 4px;
    border-radius: 1px;
    background: var(--cw-lit);
    box-shadow: 0 0 4px var(--cw-glow);
    animation: cwBlink 1s steps(2) infinite;
}

.cw-period {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 800;
    color: var(--cw-minute);
    background: color-mix(in srgb, var(--cw-minute) 14%, transparent);
}

.cw-period i {
    font-size: 15px;
}

/* ---------- date and weather ---------- */
.cw-info {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.cw-date {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    border: 1px solid rgba(120,130,150,.22);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(107,140,245,.14), transparent 70%), color-mix(in srgb, var(--panel, #fff) 72%, transparent);
}

.cw-weekday {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text2);
}

.cw-weekday i {
    color: #6b8cf5;
}

.cw-jalali {
    font-size: 16px;
    font-weight: 800;
    line-height: 1.5;
    color: var(--text1);
}

.cw-gregorian {
    font-size: 11.5px;
    color: var(--text2);
    direction: ltr;
    text-align: start;
}

.cw-weather {
    --cw-wa: #ffd36a;
    --cw-wb: #f59e1e;
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid color-mix(in srgb, var(--cw-wb) 28%, rgba(120,130,150,.22));
    border-radius: 16px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--cw-wb) 18%, transparent), transparent 70%), color-mix(in srgb, var(--panel, #fff) 72%, transparent);
    transition: background .5s ease, border-color .5s ease;
}

.cw-weather[data-tone="cloud"] { --cw-wa: #b9c6dc; --cw-wb: #6f819f; }
.cw-weather[data-tone="rain"] { --cw-wa: #8ec5ff; --cw-wb: #3b82e8; }
.cw-weather[data-tone="snow"] { --cw-wa: #d9ecff; --cw-wb: #6fb0ee; }
.cw-weather[data-tone="storm"] { --cw-wa: #b79bff; --cw-wb: #6a4bd6; }
.cw-weather[data-tone="fog"] { --cw-wa: #cfd6e2; --cw-wb: #8892a6; }
.cw-weather[data-tone="night"] { --cw-wa: #8f9bff; --cw-wb: #4a56c8; }

.cw-weather-icon {
    position: relative;
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 50%;
    font-size: 28px;
    color: #fff;
    background: linear-gradient(145deg, var(--cw-wa), var(--cw-wb));
    box-shadow: 0 8px 18px color-mix(in srgb, var(--cw-wb) 38%, transparent);
}

.cw-weather-icon > i:first-child {
    position: relative;
    z-index: 2;
}

.cw-weather[data-kind="clear"] .cw-weather-icon > i:first-child { animation: cwSun 18s linear infinite; }
.cw-weather[data-kind="cloud"] .cw-weather-icon > i:first-child,
.cw-weather[data-kind="partly"] .cw-weather-icon > i:first-child,
.cw-weather[data-kind="fog"] .cw-weather-icon > i:first-child { animation: cwDrift 5s ease-in-out infinite; }

.cw-weather[data-kind="storm"] .cw-weather-icon::after {
    content: '';
    position: absolute;
    inset: 0;
    background: #fff;
    opacity: 0;
    animation: cwFlash 3.5s infinite;
}

.cw-drop {
    position: absolute;
    top: -6px;
    z-index: 1;
    display: none;
    width: 3px;
    height: 9px;
    border-radius: 2px;
    background: rgba(255,255,255,.85);
    animation: cwFall 1s linear infinite;
}

.cw-weather[data-kind="rain"] .cw-drop,
.cw-weather[data-kind="drizzle"] .cw-drop,
.cw-weather[data-kind="storm"] .cw-drop { display: block; }

.cw-weather[data-kind="snow"] .cw-drop {
    display: block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    animation-duration: 2.4s;
}

.cw-drop:nth-of-type(1) { left: 14%; }
.cw-drop:nth-of-type(2) { left: 38%; animation-delay: .35s; }
.cw-drop:nth-of-type(3) { left: 62%; animation-delay: .7s; }
.cw-drop:nth-of-type(4) { left: 82%; animation-delay: .15s; }

.cw-weather-text {
    min-width: 0;
}

.cw-temp {
    display: flex;
    align-items: baseline;
    gap: 4px;
    direction: ltr;
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
    color: var(--text1);
}

.cw-temp small {
    font-size: 15px;
    font-weight: 700;
    color: var(--text2);
}

.cw-cond {
    margin-top: 4px;
    font-size: 13px;
    font-weight: 800;
    color: var(--text1);
}

.cw-range {
    display: flex;
    gap: 8px;
    margin-top: 4px;
    direction: ltr;
    font-size: 11.5px;
    color: var(--text2);
}

.cw-range i {
    font-size: 12px;
}

.cw-weather.is-loading .cw-temp,
.cw-weather.is-loading .cw-cond {
    opacity: .5;
}

.cw-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cw-chips > span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text2);
    background: color-mix(in srgb, var(--text2) 10%, transparent);
}

.cw-chips i {
    font-size: 14px;
    color: #3b82e8;
}

.cw-error {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #dc424d;
}

.cw-error button {
    padding: 3px 9px;
    border: 1px solid #dc424d;
    border-radius: 999px;
    background: transparent;
    font: inherit;
    font-size: 11.5px;
    color: #dc424d;
    cursor: pointer;
}

@media (max-width: 430px) {
    .cw-body {
        grid-template-columns: 1fr;
        justify-items: center;
    }
    .cw-info {
        width: 100%;
    }
}

@keyframes cwGlow { 50% { opacity: .45; transform: scale(1.15); } }
@keyframes cwSweep { to { transform: rotate(360deg); } }
@keyframes cwBlink { 50% { opacity: .15; } }
@keyframes cwSun { to { transform: rotate(360deg); } }
@keyframes cwDrift { 50% { transform: translateX(4px); } }
@keyframes cwFlash { 0%, 88%, 100% { opacity: 0; } 90% { opacity: .7; } 93% { opacity: 0; } 96% { opacity: .5; } }
@keyframes cwFall { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(64px); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
    .clock-card::after,
    .cw-colon i,
    .cw-weather-icon > i,
    .cw-weather[data-kind="storm"] .cw-weather-icon::after,
    .cw-drop {
        animation: none !important;
    }
    .cw-second {
        animation-play-state: paused;
    }
}

/* ---------- the gear on the card ---------- */
.cw-gear {
    display: grid;
    flex: none;
    place-items: center;
    width: 30px;
    height: 30px;
    margin-inline-start: 6px;
    border: 1px solid rgba(124, 144, 180, .35);
    border-radius: 10px;
    background: rgba(255, 255, 255, .6);
    color: inherit;
    cursor: pointer;
    transition: transform .3s ease;
}

.cw-gear[hidden] {
    display: none;
}

.cw-gear:hover {
    transform: rotate(40deg);
}

html[data-theme="dark"] .cw-gear {
    background: rgba(255, 255, 255, .08);
}

/* ---------- the week under the clock ---------- */
.cw-week {
    --cw-week-bg: rgba(255, 255, 255, .62);
    --cw-week-line: rgba(124, 144, 180, .26);
    --cw-tile-bg: rgba(255, 255, 255, .78);
    position: relative;
    z-index: 1;
    margin: 0 16px 16px;
    padding: 12px;
    border: 1px solid var(--cw-week-line);
    border-radius: 20px;
    background: var(--cw-week-bg);
    box-shadow: 0 8px 20px rgba(60, 80, 120, .08);
}

html[data-theme="dark"] .cw-week {
    --cw-week-bg: rgba(255, 255, 255, .05);
    --cw-week-line: rgba(255, 255, 255, .13);
    --cw-tile-bg: rgba(255, 255, 255, .06);
    box-shadow: none;
}

.cw-week-head {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 13px;
}

.cw-week-head b {
    display: flex;
    gap: 6px;
    align-items: center;
    color: var(--text);
}

.cw-week-head b i {
    color: #3f7df5;
    font-size: 17px;
}

.cw-week-span {
    display: flex;
    gap: 6px;
    align-items: center;
    color: var(--text2);
    font-size: 12px;
}

.cw-week-days {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
}

.cw-wd {
    --cw-wd-tone: #e0820c;
    display: grid;
    justify-items: center;
    gap: 3px;
    min-width: 0;
    padding: 8px 2px 7px;
    border: 1px solid var(--cw-week-line);
    border-radius: 14px;
    background: var(--cw-tile-bg);
    color: var(--text);
    white-space: nowrap;
    transition: transform .25s cubic-bezier(.22, 1, .36, 1), box-shadow .25s ease;
    animation: cwRise .5s cubic-bezier(.2, .8, .2, 1) both;
}

.cw-wd:hover {
    box-shadow: 0 10px 18px color-mix(in srgb, var(--cw-wd-tone) 24%, transparent);
    transform: translateY(-3px);
}

.cw-wd[data-tone="cloud"],
.cw-wd[data-tone="fog"] {
    --cw-wd-tone: #7c90b4;
}

.cw-wd[data-tone="rain"],
.cw-wd[data-tone="storm"] {
    --cw-wd-tone: #2f78e0;
}

.cw-wd[data-tone="snow"] {
    --cw-wd-tone: #4fb0e6;
}

.cw-wd > span {
    color: var(--text2);
    font-size: 11px;
    font-weight: 700;
}

.cw-wd-icon {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 10px;
    background: linear-gradient(145deg, color-mix(in srgb, var(--cw-wd-tone) 62%, #fff), var(--cw-wd-tone));
    box-shadow: 0 5px 11px color-mix(in srgb, var(--cw-wd-tone) 30%, transparent);
    color: #fff;
    font-size: 16px;
}

.cw-wd b {
    font-size: 13.5px;
    line-height: 1.2;
}

.cw-wd small {
    color: var(--text2);
    font-size: 11px;
    line-height: 1.1;
}

/* where this day's warmth sits inside the week */
.cw-wd-bar {
    position: relative;
    display: block;
    width: 74%;
    height: 4px;
    margin-top: 2px;
    border-radius: 4px;
    background: var(--cw-week-line);
}

.cw-wd-bar i {
    position: absolute;
    top: 0;
    bottom: 0;
    border-radius: 4px;
    background: linear-gradient(90deg, #5bb7e8, #f0a020);
}

.cw-wd.is-today {
    border-color: transparent;
    background: linear-gradient(160deg, #4f8df7, #2f5fd0);
    box-shadow: 0 10px 20px rgba(47, 95, 208, .32);
    color: #fff;
}

.cw-wd.is-today > span,
.cw-wd.is-today small {
    color: rgba(255, 255, 255, .86);
}

.cw-wd.is-today .cw-wd-icon {
    background: rgba(255, 255, 255, .22);
    box-shadow: none;
    animation: cwFloat 3s ease-in-out infinite;
}

.cw-wd.is-today .cw-wd-bar {
    background: rgba(255, 255, 255, .28);
}

.cw-wd.is-today .cw-wd-bar i {
    background: #fff;
}

.cw-week-off {
    display: flex;
    gap: 7px;
    align-items: flex-start;
    margin: 10px 0 0;
    padding: 8px 10px;
    border: 1px solid rgba(176, 119, 18, .38);
    border-radius: 12px;
    background: rgba(176, 119, 18, .11);
    color: #8f5f08;
    font-size: 12.5px;
    line-height: 1.6;
}

html[data-theme="dark"] .cw-week-off {
    color: #e8bd5a;
}

@keyframes cwRise {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes cwFloat {
    50% {
        transform: translateY(-2px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .cw-wd,
    .cw-wd.is-today .cw-wd-icon {
        animation: none;
    }
}

/* ---------- where the station is ---------- */
.overlay .modal.fuel-purchase-modal.cw-place-modal {
    width: min(1120px, calc(100vw - 24px));
    max-width: min(1120px, calc(100vw - 24px));
}

.cw-pick {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
    gap: 6px;
    max-height: 300px;
    overflow-y: auto;
    padding: 2px;
}

.cw-pick button {
    min-height: 42px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--panel);
    color: var(--text);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    transition: transform .2s ease, border-color .2s ease;
    animation: fiCardIn .35s cubic-bezier(.2, .8, .2, 1) both;
}

.cw-pick button:hover {
    border-color: #14756c;
    transform: translateY(-1px);
}

.cw-pick button.on {
    border-color: #14756c;
    background: #14756c;
    color: #fff;
    font-weight: 700;
}

.cw-time {
    display: flex;
    margin-top: 12px;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid rgba(31, 143, 134, .35);
    border-radius: 14px;
    background: rgba(31, 143, 134, .08);
    color: var(--text);
    font-size: 13.5px;
    line-height: 1.6;
}

.cw-time > i {
    color: #14756c;
    font-size: 22px;
}

@media (prefers-reduced-motion: reduce) {
    .cw-pick button {
        animation: none;
    }
}
