:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #edf5ff;
    --bg-hover: #e2e8f0;
    --text-primary: #d4d4d4;
    --text-secondary: #9cdcfe;
    --accent-primary: #0e639c;
    --accent-hover: #1177bb;
    --success: #4ec9b0;
    --error: #f44747;
    --warning: #dcdcaa;
    --border: #e2e8f0;
    --shadow: rgba(0, 0, 0, 0.4);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 300;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.subtitle {
    color: var(--text-primary);
    opacity: 0.7;
    font-size: 1.1rem;
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.section {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 8px var(--shadow);
}

.section h2 {
    font-size: 1.3rem;
    font-weight: 400;
    color: var(--text-secondary);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

/* Presets */
.presets {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.preset-btn {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

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

/* Input Group */
.input-group {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

#cron-input {
    flex: 1;
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    color: var(--text-primary);
    padding: 15px 20px;
    font-size: 1.4rem;
    font-family: 'Consolas', 'Monaco', monospace;
    border-radius: 6px;
    outline: none;
    transition: border-color 0.2s;
}

#cron-input:focus {
    border-color: var(--accent-primary);
}

#cron-input.valid {
    border-color: var(--success);
}

#cron-input.invalid {
    border-color: var(--error);
}

.btn-copy {
    background: var(--accent-primary);
    color: white;
    border: none;
    padding: 0 20px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-copy:hover {
    background: var(--accent-hover);
}

.btn-copy svg {
    width: 24px;
    height: 24px;
}

.validation-message {
    margin-top: 10px;
    font-size: 0.95rem;
    min-height: 24px;
}

.validation-message.success {
    color: var(--success);
}

.validation-message.error {
    color: var(--error);
}

/* Builder Grid */
.builder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-secondary);
}

.field-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent-primary);
}

.field-group select {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 8px;
    border-radius: 4px;
    font-size: 0.9rem;
    outline: none;
}

.field-group select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.field-group select:focus {
    border-color: var(--accent-primary);
}

.field-group select option {
    padding: 5px 8px;
}

.field-group select option:checked {
    background: var(--accent-primary);
}

.field-hint {
    font-size: 0.8rem;
    color: var(--text-primary);
    opacity: 0.6;
}

/* Description */
.description-box {
    background: var(--bg-tertiary);
    border-radius: 6px;
    padding: 20px;
    font-size: 1.1rem;
    line-height: 1.8;
}

.description-box .placeholder {
    color: var(--text-primary);
    opacity: 0.5;
    font-style: italic;
}

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

/* Executions List */
.executions-list {
    background: var(--bg-tertiary);
    border-radius: 6px;
    overflow: hidden;
}

.executions-list .placeholder {
    padding: 20px;
    color: var(--text-primary);
    opacity: 0.5;
    font-style: italic;
}

.execution-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
}

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

.execution-item:hover {
    background: var(--bg-hover);
}

.execution-number {
    background: var(--accent-primary);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
}

.execution-time {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 1rem;
    color: var(--text-secondary);
}

.execution-relative {
    font-size: 0.9rem;
    color: var(--text-primary);
    opacity: 0.7;
}

/* Cheat Sheet */
.cheat-sheet {
    background: var(--bg-tertiary);
    border-radius: 6px;
    padding: 20px;
}

.cheat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.cheat-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cheat-item code {
    background: var(--bg-secondary);
    color: var(--warning);
    padding: 4px 10px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.95rem;
    min-width: 60px;
    text-align: center;
}

.cheat-item span {
    color: var(--text-primary);
    font-size: 0.95rem;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--success);
    color: var(--bg-primary);
    padding: 15px 25px;
    border-radius: 6px;
    font-weight: 600;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 1000;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* Footer */
footer {
    text-align: center;
    padding: 40px 0 20px;
    color: var(--text-primary);
    opacity: 0.5;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8rem;
    }

    .container {
        padding: 15px;
    }

    .section {
        padding: 20px;
    }

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

    .btn-copy {
        padding: 15px;
    }

    .builder-grid {
        grid-template-columns: 1fr;
    }

    .presets {
        justify-content: center;
    }

    .preset-btn {
        font-size: 0.85rem;
        padding: 8px 12px;
    }

    .cheat-grid {
        grid-template-columns: 1fr;
    }

    .execution-item {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}

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

    .subtitle {
        font-size: 0.95rem;
    }

    #cron-input {
        font-size: 1.1rem;
        padding: 12px 15px;
    }
}
