/* Email Scheduler Styles */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.5;
}

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

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #ddd;
}

header h1 {
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
}

#status-bar {
    display: flex;
    gap: 15px;
}

.status-indicator {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 4px;
    background-color: #e8e8e8;
}

.status-indicator.ok {
    background-color: #d4edda;
    color: #155724;
}

.status-indicator.error {
    background-color: #f8d7da;
    color: #721c24;
}

.status-indicator.warning {
    background-color: #fff3cd;
    color: #856404;
}

/* Warning Banner */
.warning-banner {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 12px 20px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-weight: 500;
}

.warning-banner a {
    color: #721c24;
    font-weight: 700;
}

.warning-banner.hidden {
    display: none;
}

/* Section */
.table-section {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    padding: 20px;
}

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

.section-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

.section-actions {
    display: flex;
    gap: 10px;
}

/* Buttons */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, opacity 0.2s;
}

.btn:hover {
    opacity: 0.9;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-success {
    background-color: #27ae60;
    color: white;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-small {
    padding: 4px 10px;
    font-size: 12px;
}

/* Table */
.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th, td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #555;
    white-space: nowrap;
}

tbody tr:hover {
    background-color: #f8f9fa;
}

/* Column widths */
.col-recurring { width: 80px; }
.col-interval { width: 100px; }
.col-datetime { width: 180px; }
.col-subject { width: 200px; }
.col-body { min-width: 200px; }
.col-recipients { width: 200px; }
.col-sender { width: 200px; }
.col-actions { width: 80px; }
.col-status { width: 80px; }
.col-error { min-width: 150px; }

/* Editable cells */
td[contenteditable="true"] {
    cursor: text;
    border: 1px solid transparent;
    border-radius: 3px;
}

td[contenteditable="true"]:focus {
    outline: none;
    border-color: #3498db;
    background-color: #fff;
}

/* Unsaved changes highlight */
td.modified,
tr.modified td {
    background-color: #fffde7 !important;
}

tr.new-row td {
    background-color: #fffde7 !important;
}

/* Input elements in cells */
td input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

td input[type="number"] {
    width: 80px;
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 14px;
}

td input[type="datetime-local"] {
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 14px;
}

td select {
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 14px;
    min-width: 150px;
}

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.sent {
    background-color: #d4edda;
    color: #155724;
}

.status-badge.error {
    background-color: #f8d7da;
    color: #721c24;
}

/* Table hint */
.table-hint {
    margin-top: 10px;
    font-size: 12px;
    color: #888;
}

/* Empty state */
.empty-row td {
    text-align: center;
    color: #888;
    font-style: italic;
    padding: 30px;
}

/* Responsive */
@media (max-width: 1200px) {
    .container {
        padding: 15px;
    }

    .col-body {
        min-width: 150px;
    }
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .section-actions {
        width: 100%;
    }

    .section-actions .btn {
        flex: 1;
    }
}
