:root {
    --bg-base: #fafafa;
    --bg-panel: rgba(255, 255, 255, 0.85);
    --bg-input: #ffffff;
    --bg-hover: rgba(124, 58, 237, 0.05);

    --border-light: rgba(0, 0, 0, 0.1);
    --border-active: #7C3AED;

    --text-main: #111827;
    --text-muted: #6b7280;

    --primary: #7C3AED;
    --primary-hover: #6D28D9;
    --secondary: #A78BFA;
    --accent: #DDD6FE;

    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);

    --radius-xl: 20px;
    --radius-lg: 12px;
    --radius-md: 8px;
}

.dark {
    --bg-base: #0F0A1E;
    --bg-panel: rgba(26, 17, 51, 0.7);
    --bg-input: rgba(43, 30, 80, 0.5);
    --bg-hover: rgba(124, 58, 237, 0.15);

    --border-light: rgba(167, 139, 250, 0.2);

    --text-main: #f8fafc;
    --text-muted: #a78bfa;
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

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

body {
    font-family: 'Inter', system-ui, sans-serif;
    background-color: var(--bg-base);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
    transition: background-color 0.3s ease;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.flex-1 {
    flex: 1;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-4 {
    gap: 1rem;
}

.gap-6 {
    gap: 1.5rem;
}

.grid {
    display: grid;
}

.md\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mt-2 {
    margin-top: 0.5rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.w-5 {
    width: 1.25rem;
}

.h-5 {
    height: 1.25rem;
}

.w-6 {
    width: 1.5rem;
}

.h-6 {
    height: 1.5rem;
}

.hidden {
    display: none !important;
}

/* Components */
.glass-panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-light);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--shadow-md);
}

.card {
    padding: 1.5rem;
    border-radius: var(--radius-xl);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    outline: none;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--bg-hover);
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--bg-hover);
    color: var(--text-main);
}

.border-light {
    border-color: var(--border-light);
}

/* Layout */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    min-height: 100vh;
}

.topbar {
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 100px;
}

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

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

.brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(124, 58, 237, 0.4);
}

.preset-btn {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-muted);
    padding: 0.4rem 0.8rem;
    border-radius: 100px;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.preset-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--bg-hover);
}

.workspace {
    display: flex;
    gap: 2rem;
    flex: 1;
    flex-direction: column;
    /* mobile default */
}

@media (min-width: 900px) {
    .workspace {
        flex-direction: row;
    }
}

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

/* Editor Fields */
.expression-editor {
    display: flex;
    gap: 0.5rem;
    width: 100%;
    justify-content: space-between;
}

.field-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.cron-field {
    width: 100%;
    text-align: center;
    background: var(--bg-input);
    border: 2px solid var(--border-light);
    color: var(--primary);
    padding: 1rem 0;
    border-radius: var(--radius-lg);
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.75rem;
    font-weight: 700;
    outline: none;
    transition: all 0.2s;
}

.cron-field:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.15);
    transform: translateY(-2px);
}

.field-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.text-input,
.select-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    color: var(--text-main);
    padding: 0.875rem 1.25rem;
    border-radius: var(--radius-md);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    outline: none;
    transition: all 0.2s;
}

.text-input:focus,
.select-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.15);
}

.select-input {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/200.svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23a78bfa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
    padding-right: 2.5rem;
}

.modifier-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.mod-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-main);
}

/* Timeline */
.timeline-panel {
    width: 100%;
}

@media (min-width: 900px) {
    .timeline-panel {
        width: 350px;
    }
}

.timeline {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
    padding-left: 1.5rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0.375rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-light);
}

.timeline-item {
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.5rem;
    top: 0.5rem;
    width: 12px;
    height: 12px;
    background: var(--bg-base);
    border: 2px solid var(--primary);
    border-radius: 50%;
    transform: translateX(1px);
    z-index: 2;
    transition: all 0.2s;
}

.timeline-item:hover::before {
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary);
}

.tl-time {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
}

.tl-rel {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 0.125rem;
}

/* Typography Colors */
.text-primary {
    color: var(--primary);
}

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

.text-white {
    color: #fff;
}

.font-medium {
    font-weight: 500;
}

.text-xl {
    font-size: 1.25rem;
}

.text-lg {
    font-size: 1.125rem;
}

.text-sm {
    font-size: 0.875rem;
}

.text-xs {
    font-size: 0.75rem;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text-main);
    color: var(--bg-base);
    padding: 0.75rem 1.5rem;
    border-radius: 100px;
    font-weight: 600;
    font-size: 0.875rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 100;
}

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