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

:root {
    --bg-start: #667eea;
    --bg-end: #764ba2;
    --card-bg: rgba(255, 255, 255, 0.96);
    --panel-bg: #f8f9fa;
    --result-bg: #ffffff;
    --result-stripe: #f8fafc;
    --input-bg: #ffffff;
    --text: #2c3e50;
    --text-strong: #1f2937;
    --label-color: #475569;
    --muted: #7f8c8d;
    --primary: #4f46e5;
    --primary-2: #06b6d4;
    --accent: #60a5fa;
    --success: #22c55e;
    --border: #e9ecef;
    --chip: #eef2ff;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: linear-gradient(135deg, var(--bg-start) 0%, var(--bg-end) 100%);
    min-height: 100vh;
    padding: 16px;
    color: var(--text);
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: var(--card-bg);
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.header {
    text-align: center;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.header h1 {
    font-size: 1.7rem;
    margin-bottom: 0;
    font-weight: 800;
    letter-spacing: -0.01em;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.header .subtitle {
    color: var(--muted);
    font-size: 1rem;
}

.current-time {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: #f1f5f9;
    color: var(--text-strong);
    padding: 10px 12px;
    border-radius: 10px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
}

.current-timestamp {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0;
    font-family: 'SF Mono', monospace;
    cursor: pointer;
}

.current-date {
    font-size: 0.92rem;
    opacity: 0.82;
    cursor: pointer;
    font-family: 'SF Mono', ui-monospace, monospace;
}

.current-timestamp:hover,
.current-date:hover {
    text-decoration: underline;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 10px;
}

.quick-btn {
    background: #00b894;
    color: white;
    border: none;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.quick-btn:hover {
    background: #00a085;
    transform: translateY(-2px);
}

.section {
    background: var(--panel-bg);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

.section-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-strong);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-group {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.input-wrapper {
    flex: 1;
    min-width: 200px;
}

.input-label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}

input[type="text"],
input[type="datetime-local"],
select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
    background: var(--input-bg);
    color: var(--text);
}

input[type="text"]:focus,
input[type="datetime-local"]:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.15);
}

input[type="text"] {
    font-family: 'SF Mono', monospace;
}

.btn {
    background: linear-gradient(135deg, var(--accent), #3b82f6);
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    white-space: nowrap;
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.25);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(59, 130, 246, 0.28);
}

.quick-values {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
}

.quick-values::-webkit-scrollbar {
    display: none;
}

.quick-value-btn {
    background: var(--chip);
    border: 1px solid #e5e7eb;
    padding: 5px 9px;
    border-radius: 9999px;
    cursor: pointer;
    font-size: 0.78rem;
    transition: all 0.2s ease;
    color: var(--text-strong);
    flex: 0 0 auto;
    white-space: nowrap;
}

.quick-value-btn:hover {
    background: #e0e7ff;
    border-color: #c7d2fe;
    color: #1f2937;
}

.result {
    margin-top: 16px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    display: none;
}

.result-header {
    background: linear-gradient(135deg, var(--accent), #3b82f6);
    color: white;
    padding: 12px 16px;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.result-content {
    background: var(--result-bg);
    max-height: 400px;
    overflow-y: auto;
}

.result-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    display: grid;
    grid-template-columns: 160px 1fr;
    align-items: center;
    gap: 10px;
}

.result-item:last-child {
    border-bottom: none;
}

.result-label {
    font-weight: 700;
    color: var(--label-color);
}

.result-value {
    font-family: 'SF Mono', ui-monospace, monospace;
    color: var(--text-strong);
    font-weight: 600;
    word-break: break-all;
    display: flex;
    align-items: center;
    gap: 8px;
}

.copy-btn {
    background: var(--success);
    color: #fff;
    border: none;
    padding: 4px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.78rem;
    margin-left: auto;
}

.copy-btn:hover {
    filter: brightness(0.95);
}

.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.toast.show {
    opacity: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 8px;
    }

    .container {
        padding: 16px;
    }

    .header h1 {
        font-size: 1.45rem;
    }

    .current-timestamp {
        font-size: 1rem;
    }

    .current-date {
        font-size: 0.85rem;
    }

    .input-group {
        flex-direction: column;
    }

    .input-wrapper {
        min-width: auto;
    }

    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }

    .result-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .result-label {
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.3rem;
    }

    .quick-actions {
        grid-template-columns: 1fr;
    }

    .current-timestamp {
        font-size: 0.95rem;
    }

    .current-time {
        flex-direction: column;
        align-items: flex-start;
    }

    .section {
        padding: 16px;
    }
}

.timezone-note {
    background: #fff7ed;
    color: #9a3412;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 0.82rem;
    margin-bottom: 12px;
    border: 1px solid #fed7aa;
}

.tz-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.tz-select {
    width: 100%;
}

.tz-filter {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.tz-filter input {
    flex: 1;
    padding: 10px;
    border: 2px solid var(--border);
    border-radius: 8px;
}

/* Alternate rows for results */
.result-content .result-item:nth-child(even) {
    background: var(--result-stripe);
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --card-bg: rgba(12, 18, 32, 0.95);
        --panel-bg: rgba(24, 35, 55, 0.92);
        --result-bg: rgba(17, 26, 44, 0.92);
        --result-stripe: rgba(255, 255, 255, 0.04);
        --input-bg: rgba(15, 23, 42, 0.85);
        --text: #e2e8f0;
        --text-strong: #f8fafc;
        --label-color: #cbd5ff;
        --muted: #9ca3af;
        --border: rgba(148, 163, 184, 0.35);
        --chip: rgba(15, 23, 42, 0.8);
    }

    body {
        background: radial-gradient(circle at top, #1f2a44 0%, #0f172a 60%, #030712 100%);
    }

    .container {
        border-color: rgba(255, 255, 255, 0.08);
        box-shadow: 0 20px 45px rgba(0, 0, 0, 0.55);
    }

    .quick-value-btn {
        background: rgba(37, 51, 82, 0.8);
        border-color: rgba(99, 102, 241, 0.35);
        color: #e2e8f0;
    }

    .quick-value-btn:hover {
        background: rgba(79, 70, 229, 0.35);
        border-color: rgba(129, 140, 248, 0.6);
        color: #f8fafc;
    }

    .quick-actions .quick-btn {
        background: rgba(15, 118, 110, 0.18);
        color: #22d3ee;
    }

    .current-time {
        background: rgba(15, 23, 42, 0.7);
        border-color: rgba(148, 163, 184, 0.35);
    }

    .timezone-note {
        background: rgba(251, 146, 60, 0.14);
        color: #fed7aa;
        border-color: rgba(251, 146, 60, 0.35);
    }

    .result-header {
        background: linear-gradient(135deg, rgba(96, 165, 250, 0.8), rgba(59, 130, 246, 0.85));
    }

    .copy-btn {
        background: rgba(34, 197, 94, 0.8);
    }

}
/* History Section */
.history-section {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px dashed var(--border);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.history-item:hover {
    border-color: var(--accent);
    background: var(--chip);
    transform: translateX(2px);
}

.history-type {
    font-size: 1.1rem;
}

.history-value {
    font-family: 'SF Mono', monospace;
    font-weight: 600;
    color: var(--text-strong);
}

.history-time {
    margin-left: auto;
    color: var(--muted);
    font-size: 0.8rem;
}

.history-empty {
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
    padding: 10px;
}
