/* Arlo Automations - Additional Styles */

/* Container */
.automations-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
    min-height: calc(100vh - 60px);
}

.automations-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.automations-header h1 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Automations List */
.automations-list {
    display: grid;
    gap: 16px;
}

.empty-automations {
    text-align: center;
    padding: 60px 24px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 2px dashed var(--border-color);
}

.empty-automations p {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

/* Automation Card */
.automation-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.automation-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.automation-card.paused {
    opacity: 0.7;
}

.automation-card.error {
    border-color: var(--error-color);
}

.automation-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

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

.automation-title h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.automation-actions {
    display: flex;
    gap: 4px;
}

.automation-actions .icon-btn {
    width: 32px;
    height: 32px;
    padding: 6px;
}

.automation-actions .icon-btn.danger:hover {
    color: var(--error-color);
}

.automation-body {
    margin-bottom: 12px;
}

.automation-prompt {
    color: var(--text-secondary);
    font-style: italic;
    margin: 0 0 8px 0;
    font-size: 14px;
}

.automation-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.trigger-type {
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: 4px;
}

.cron-badge, .time-badge {
    font-size: 12px;
    font-family: monospace;
    background: var(--primary-color);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
}

.automation-footer {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-tertiary);
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

/* Status Badges */
.status-badge {
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 12px;
    text-transform: uppercase;
}

.status-badge.active {
    background: #dcfce7;
    color: #166534;
}

.status-badge.paused {
    background: #fef3c7;
    color: #92400e;
}

.status-badge.disabled {
    background: #f3f4f6;
    color: #6b7280;
}

.status-badge.error {
    background: #fee2e2;
    color: #991b1b;
}

.status-badge.completed {
    background: #dcfce7;
    color: #166534;
}

.status-badge.failed, .status-badge.timeout {
    background: #fee2e2;
    color: #991b1b;
}

.status-badge.running, .status-badge.pending {
    background: #dbeafe;
    color: #1e40af;
}

/* Modal - Large */
.modal-large {
    max-width: 600px;
    width: 95%;
}

.modal-body {
    max-height: 60vh;
    overflow-y: auto;
}

.form-divider {
    margin: 20px 0;
    border: none;
    border-top: 1px solid var(--border-color);
}

/* Form Enhancements */
.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.form-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.form-hint code {
    background: var(--bg-tertiary);
    padding: 2px 4px;
    border-radius: 3px;
    font-family: monospace;
}

/* Quick Schedules */
.quick-schedules {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.quick-schedules .btn {
    font-size: 12px;
    padding: 4px 12px;
}

/* Cron Preview */
.cron-preview {
    margin-top: 8px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    font-size: 13px;
}

.cron-preview .valid {
    color: #166534;
    font-weight: 500;
}

.cron-preview .invalid {
    color: #991b1b;
}

.cron-preview ul {
    margin: 8px 0 0 0;
    padding-left: 20px;
}

.cron-preview li {
    color: var(--text-secondary);
}

/* Parse Suggestion */
.suggestion-box {
    background: var(--bg-tertiary);
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    padding: 12px;
    margin-top: 8px;
}

.suggestion-box p {
    margin: 0 0 8px 0;
    font-weight: 500;
}

.suggestion-box ul {
    margin: 0 0 12px 0;
    padding-left: 20px;
}

/* Executions Table */
.executions-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.executions-table th,
.executions-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.executions-table th {
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
}

.executions-table tr:hover {
    background: var(--bg-tertiary);
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    padding: 0;
    font-size: inherit;
}

.btn-link:hover {
    text-decoration: underline;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 24px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    animation: slideIn 0.3s ease;
    z-index: 1001;
}

.toast-success {
    background: #166534;
}

.toast-error {
    background: #991b1b;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Loading State */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

/* Dark Theme Overrides */
[data-theme="dark"] .status-badge.active {
    background: #064e3b;
    color: #6ee7b7;
}

[data-theme="dark"] .status-badge.paused {
    background: #78350f;
    color: #fcd34d;
}

[data-theme="dark"] .status-badge.error,
[data-theme="dark"] .status-badge.failed {
    background: #7f1d1d;
    color: #fca5a5;
}

[data-theme="dark"] .status-badge.running,
[data-theme="dark"] .status-badge.pending {
    background: #1e3a5f;
    color: #93c5fd;
}

[data-theme="dark"] .cron-preview .valid {
    color: #6ee7b7;
}

[data-theme="dark"] .cron-preview .invalid {
    color: #fca5a5;
}

/* Responsive */
@media (max-width: 768px) {
    .automations-container {
        padding: 16px;
    }

    .automations-header {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }

    .automation-header {
        flex-direction: column;
        gap: 12px;
    }

    .automation-actions {
        align-self: flex-end;
    }

    .automation-footer {
        flex-wrap: wrap;
    }

    .quick-schedules {
        flex-direction: column;
    }
}
