/* Timestamp Converter — styles.css — Indigo/Violet/Cyan Dark */

:root {
    --bg: #0F1219;
    --bg2: #0B0E15;
    --surface: #141A27;
    --surface2: #1A2236;
    --border: #1F2E4A;
    --indigo: #6366F1;
    --violet: #8B5CF6;
    --cyan: #22D3EE;
    --green: #34D399;
    --red: #F87171;
    --text: #E2E8F0;
    --muted: #334765;
    --radius: 12px;
}

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

html,
body {
    min-height: 100%;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', system-ui;
    font-size: 13px;
    -webkit-font-smoothing: antialiased;
}

.mono {
    font-family: 'JetBrains Mono', monospace;
}

/* ── Header ──────────────────────────────────────────── */
.hdr {
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    padding: 8px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

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

.logo-icon {
    font-size: 1.1rem;
}

h1 {
    font-size: 0.88rem;
    font-weight: 700;
    color: #A5B4FC;
    white-space: nowrap;
}

.live-block {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.72rem;
    flex-wrap: wrap;
}

.live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 6px var(--green);
    animation: pulse 2s infinite;
    flex-shrink: 0;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1
    }

    50% {
        opacity: 0.4
    }
}

.live-label {
    color: var(--muted);
}

.live-val {
    color: var(--cyan);
    font-family: 'JetBrains Mono', monospace;
}

.live-sep {
    color: var(--muted);
}

/* ── Layout ──────────────────────────────────────────── */
.main {
    padding: 14px 18px;
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.top-row {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 12px;
}

/* ── Card ────────────────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
}

.card-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: #A5B4FC;
    margin-bottom: 10px;
}

/* ── Input ───────────────────────────────────────────── */
.input-group {
    margin-bottom: 12px;
}

.inp-label {
    display: block;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    font-weight: 700;
    margin-bottom: 5px;
}

.inp-row {
    display: flex;
    gap: 5px;
}

.ts-input {
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 0.8rem;
    outline: none;
    font-family: 'JetBrains Mono', monospace;
}

.ts-input:focus {
    border-color: var(--indigo);
}

.ts-input[style*="flex:1"] {
    flex: 1;
}

.opt-sel {
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 8px;
    padding: 5px 8px;
    font-size: 0.75rem;
    outline: none;
}

.opt-sel:focus {
    border-color: var(--indigo);
}

/* ── Output grid ─────────────────────────────────────── */
.output-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.out-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 10px;
}

.out-lbl {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    font-weight: 700;
    width: 90px;
    flex-shrink: 0;
}

.out-val {
    flex: 1;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.out-copy {
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    transition: all 0.15s;
    flex-shrink: 0;
}

.out-copy:hover {
    background: rgba(99, 102, 241, 0.12);
    color: var(--indigo);
    border-color: var(--indigo);
}

.out-copy.copied {
    color: var(--green);
    border-color: var(--green);
}

.out-relative {
    color: var(--cyan);
}

.out-unix {
    color: #A5B4FC;
}

.out-iso {
    color: #C4B5FD;
}

/* ── Timezone ────────────────────────────────────────── */
.tz-form {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.fp-row {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.tz-result {
    background: var(--surface2);
    border-radius: 8px;
    padding: 10px 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    min-height: 36px;
    color: var(--cyan);
}

/* ── Date math ───────────────────────────────────────── */
.math-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.math-row .ts-input {
    min-width: 0;
}

.math-result {
    background: var(--surface2);
    border-radius: 8px;
    padding: 10px 12px;
    margin-top: 10px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--green);
}

.math-result.hidden {
    display: none;
}

/* ── Batch ───────────────────────────────────────────── */
.batch-layout {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.batch-layout>div:first-child,
.batch-layout>div:last-child {
    flex: 1;
    min-width: 160px;
}

.batch-ta {
    width: 100%;
    height: 110px;
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    resize: vertical;
    outline: none;
}

.batch-ta:focus {
    border-color: var(--indigo);
}

.batch-ta[readonly] {
    color: var(--cyan);
}

/* ── History ─────────────────────────────────────────── */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
    max-height: 180px;
    overflow-y: auto;
}

.hist-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface2);
    border-radius: 7px;
    padding: 7px 10px;
    cursor: pointer;
}

.hist-item:hover {
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.hist-in {
    color: #C4B5FD;
    font-family: 'JetBrains Mono';
    font-size: 0.72rem;
}

.hist-rel {
    color: var(--muted);
    font-size: 0.68rem;
}

.hist-empty {
    color: var(--muted);
    font-size: 0.78rem;
    padding: 10px 0;
}

/* ── Buttons ─────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.15s;
    white-space: nowrap;
}

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

.btn-indigo {
    background: var(--indigo);
    color: white;
}

.btn-indigo:hover {
    background: #7577F3;
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    color: var(--text);
    border-color: var(--cyan);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.7rem;
}

/* ── Toast ───────────────────────────────────────────── */
#toast-wrap {
    position: fixed;
    bottom: 16px;
    right: 16px;
    z-index: 600;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.toast {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 0.8rem;
    animation: slide-up .2s ease;
}

.toast.ok {
    border-color: rgba(52, 211, 153, .4);
    color: var(--green);
}

.toast.err {
    border-color: rgba(248, 113, 113, .4);
    color: var(--red);
}

@keyframes slide-up {
    from {
        transform: translateY(8px);
        opacity: 0;
    }
}

.hidden {
    display: none !important;
}

@media (max-width: 680px) {
    .top-row {
        grid-template-columns: 1fr;
    }

    .math-row {
        gap: 5px;
    }
}