/* ==========================================================================
 * timezones.css — Time Zone Comparison tool styles
 * ==========================================================================
 * Tool-specific CSS for the Time Zone Comparison page. Leverages base.css
 * box, button, and layout utilities. All classes prefixed with tz-.
 * ======================================================================== */

/* Settings container: format toggle + time input row + slider */
.tz-settings {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Format toggle button group */
.tz-format-toggle {
    display: flex;
    gap: 0.5rem;
}

.tz-fmt-btn.active {
    background-color: var(--color-text);
    color: var(--color-bg);
    border-color: var(--color-accent1);
    transform: translate(4px, 4px);
    box-shadow: 0 0 0 var(--color-accent1);
}

/* Time input row: label, time, date, Now button */
.tz-time-input {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.tz-time-input label {
    font-weight: bold;
    white-space: nowrap;
}

/* Slider container */
.tz-slider-wrap {
    width: 100%;
    margin: 0.75rem 0;
}

#tz-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: var(--color-accent2);
    border-radius: 3px;
    border: none;
    outline: none;
    cursor: pointer;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

#tz-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-accent2);
    border: none;
    box-shadow: none;
    cursor: grab;
}

#tz-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-accent2);
    border: none;
    box-shadow: none;
    cursor: grab;
}

#tz-slider:active::-webkit-slider-thumb {
    cursor: grabbing;
}

#tz-slider:active::-moz-range-thumb {
    cursor: grabbing;
}

/* Firefox track fix */
#tz-slider::-moz-range-track {
    height: 6px;
    background: var(--color-accent2);
    border-radius: 3px;
    border: none;
}

.tz-slider-ticks {
    display: flex;
    justify-content: space-between;
    padding: 0 10px; /* HALF of thumb width (20px / 2 = 10px) */
    margin-top: 4px;
    box-sizing: border-box;
    width: 100%;
}

.tz-slider-ticks span {
    width: 2px;
    height: 8px;
    background: var(--color-accent2);
    flex-shrink: 0;
}

.tz-slider-labels {
    display: flex;
    justify-content: space-between;
    padding: 0 10px; /* SAME as ticks — half thumb width */
    margin-top: 2px;
    box-sizing: border-box;
    width: 100%;
    font-family: var(--font-code, monospace);
    font-size: 0.6rem;
    color: var(--color-text-muted);
    user-select: none;
}

.tz-slider-labels span {
    width: 0;
    overflow: visible;
    display: inline-flex;
    justify-content: center;
    white-space: nowrap;
    flex-shrink: 0;
    font-size: 0.6rem;
}

/* Search / Add zone area */
.tz-add-zone {
    position: relative;
}

#tz-search {
    width: 100%;
    box-sizing: border-box;
}

/* Dropdown list */
.tz-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 300px;
    overflow-y: auto;
    list-style: none;
    margin: 0;
    padding: 0;
    background: var(--color-bg);
    border: 1px solid var(--color-border, #ccc);
    border-top: none;
    z-index: 100;
    display: none;
}

.tz-dropdown.tz-dropdown-visible {
    display: block;
}

.tz-dropdown li {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.tz-dropdown li:hover,
.tz-dropdown li.highlighted {
    background-color: var(--color-accent1);
    color: var(--color-bg);
}

.tz-dropdown li.tz-dropdown-disabled {
    opacity: 0.5;
    cursor: default;
}

.tz-dropdown li.tz-dropdown-disabled:hover,
.tz-dropdown li.tz-dropdown-disabled.highlighted {
    background-color: transparent;
    color: inherit;
}

.tz-dropdown-city {
    font-weight: bold;
}

.tz-dropdown-meta {
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Zone cards grid — single column layout */
.tz-clocks {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

/* Individual zone card — compact two-row layout */
.tz-card {
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* Local zone card indicator — badge only, no special border */
.tz-card-local {
    /* No special border — matches other cards */
}

/* Card header: single line with info left, actions right */
.tz-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.25rem;
}

.tz-card-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
    flex: 1;
}

.tz-card-label {
    font-family: var(--font-heading);
    font-weight: bold;
    font-size: 0.95rem;
    white-space: nowrap;
}

.tz-card-meta {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tz-card-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

.tz-card-local-badge {
    font-size: 0.65rem;
    font-weight: bold;
    text-transform: uppercase;
    background-color: var(--color-accent3);
    color: var(--color-bg);
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    white-space: nowrap;
}

/* Drag handle */
.tz-drag-handle {
    cursor: grab;
    color: var(--color-text-muted);
    font-size: 1.1rem;
    line-height: 1;
    padding: 0.2rem 0.4rem;
    opacity: 0.5;
    transition: opacity 0.15s ease, color 0.15s ease;
    user-select: none;
    touch-action: none;
}

.tz-drag-handle:hover {
    opacity: 1;
    color: var(--color-accent2);
}

.tz-drag-handle:active {
    cursor: grabbing;
}

/* Dragging state */
.tz-card.tz-dragging {
    opacity: 0.5;
}

/* Drop indicator line */
.tz-drop-indicator {
    height: 3px;
    background: var(--color-accent2);
    border-radius: 2px;
    margin: -0.5rem 0;
    pointer-events: none;
    transition: opacity 0.1s ease;
}

.tz-card-remove {
    font-size: 1.2rem;
    line-height: 1;
    padding: 0.2rem 0.4rem;
}

.tz-card-remove:hover {
    color: var(--color-accent3);
}

/* Digital clock time display */
.tz-card-time {
    font-family: "Courier New", monospace;
    font-size: 2rem;
    font-weight: bold;
    letter-spacing: 0.05em;
    text-align: center;
    transition: color 0.3s ease;
}

.tz-card-time.tz-time-flash {
    color: var(--color-accent2);
    transition: color 0s;
}

/* Legacy date/offset classes (replaced by .tz-card-meta) */

/* Visually hidden but accessible to screen readers */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus and accessibility styles */
.tz-fmt-btn:focus-visible,
#tz-search:focus-visible,
#tz-slider:focus-visible,
.tz-card-remove:focus-visible,
.tz-drag-handle:focus-visible,
.tz-card:focus-visible {
    outline: 2px solid var(--color-accent1);
    outline-offset: 2px;
}

/* Clickable label for inline nickname editing */
.tz-card-label-editable {
    cursor: pointer;
    border-bottom: 1px dashed transparent;
    transition: border-bottom-color 0.15s ease, color 0.15s ease;
}

.tz-card-label-editable:hover {
    border-bottom-color: var(--color-accent2);
    color: var(--color-accent2);
}

/* Inline nickname input */
.tz-nickname-input {
    font-family: var(--font-heading);
    font-weight: bold;
    font-size: 0.95rem;
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--color-accent2);
    color: var(--color-text);
    padding: 0.1rem 0.2rem;
    outline: none;
    width: auto;
    min-width: 8ch;
    max-width: 100%;
}

.tz-nickname-input:focus {
    border-bottom-color: var(--color-accent1);
}



/* Nickname label wrap */
.tz-card-label-wrap {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-wrap: wrap;
    min-width: 0;
}

/* Original zone label (shown muted below nickname) */
/* .tz-card-label-original removed — no longer used */

/* Responsive: mobile */
@media screen and (max-width: 480px) {
    .tz-settings {
        flex-direction: column;
        gap: 0.5rem;
    }

    .tz-time-input {
        flex-direction: column;
        align-items: stretch;
    }

    .tz-card-time {
        font-size: 1.5rem;
    }

    .tz-slider-labels {
        font-size: 0.5rem;
    }
}
