:root {
    --bg-app: #0f1115;
    --bg-panel: #1a1d24;
    --bg-input: #0a0b0e;
    --bg-card: #222630;

    --color-primary: #f97316;
    /* Amber/Orange for time theme */
    --color-primary-hover: #ea580c;

    --border-color: #2e3440;
    --border-focus: #f97316;

    --text-main: #f8fafc;
    --text-muted: #94a3b8;

    --color-error: #ef4444;
    --bg-error: rgba(239, 68, 68, 0.1);

    --font-ui: 'Inter', system-ui, sans-serif;
    --font-mono: 'Space Mono', monospace;

    --radius: 12px;
}

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

body {
    font-family: var(--font-ui);
    background-color: var(--bg-app);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Utils */
.hidden {
    display: none !important;
}

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

.icon {
    width: 18px;
    height: 18px;
}

.icon-lg {
    width: 24px;
    height: 24px;
}

/* Layout */
.app-shell {
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 0 1rem;
}

/* Header */
.navbar {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand h1 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.preset-select {
    background: var(--bg-panel);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    outline: none;
    cursor: pointer;
    transition: all 0.2s;
}

.preset-select:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.2);
}

/* Main Content */
.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding-bottom: 3rem;
}

/* Hero & Inputs */
.hero-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.cron-input-group {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

.cron-fields {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.cron-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
}

.cron-segment {
    background: var(--bg-input);
    border: 2px solid transparent;
    color: var(--color-primary);
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    padding: 0.75rem 0.5rem;
    border-radius: 8px;
    outline: none;
    transition: all 0.2s;
}

.cron-segment:focus {
    border-color: var(--border-focus);
    background: var(--bg-card);
}

.cron-field label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.cron-raw-container {
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.25rem 0.25rem 0.25rem 1rem;
    transition: all 0.2s;
}

.cron-raw-container:focus-within {
    border-color: var(--border-focus);
}

.cron-raw-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: 1.1rem;
    letter-spacing: 0.1em;
    outline: none;
}

.btn-icon {
    background: var(--bg-panel);
    border: none;
    color: var(--text-muted);
    width: 40px;
    height: 40px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--color-primary);
    color: #fff;
}

/* Translation Card */
.translation-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
}

.translation-card.error {
    background: var(--bg-error);
    border-color: var(--color-error);
}

.translation-header {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.translation-card.error .translation-header {
    color: var(--color-error);
}

.translation-card.error .icon {
    color: var(--color-error);
}

#human-readable {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-main);
    text-wrap: balance;
}

.translation-card.error #human-readable {
    font-size: 1.25rem;
    font-weight: 500;
    color: #fca5a5;
}

/* Bottom Panel */
.panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.panel-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
}

.badge {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.runs-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.runs-list li {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border-radius: 8px;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    color: var(--text-main);
    border: 1px solid transparent;
}

.runs-list li:hover {
    border-color: var(--border-color);
    background: var(--bg-card);
}

.run-index {
    color: var(--text-muted);
    font-size: 0.8rem;
    width: 24px;
}

.run-date {
    color: var(--color-primary);
    font-weight: 600;
}

.run-time {
    color: var(--text-main);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--color-primary);
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: 30px;
    font-weight: 500;
    font-size: 0.9rem;
    box-shadow: 0 10px 25px rgba(249, 115, 22, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1000;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

@media (max-width: 640px) {
    .cron-fields {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .cron-field {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        background: var(--bg-input);
        padding: 0.5rem 1rem;
        border-radius: 8px;
    }

    .cron-segment {
        background: transparent;
        padding: 0;
        width: 50%;
        text-align: right;
    }

    #human-readable {
        font-size: 1.5rem;
    }

    .runs-list li {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
}