/* Time Alerts Module Specific Styles */

/* Form Layout */
.form-columns {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-column {
    flex: 1;
    min-width: 0;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

/* Recurrence Options */
.form-fieldset {
    margin: 20px 0;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 15px;
}

.form-fieldset legend {
    font-weight: 600;
    padding: 0 10px;
    color: var(--primary-color);
}

.recurrence-toggle {
    margin-bottom: 15px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 8px;
    width: auto;
}

.recurrence-details {
    padding-top: 15px;
    border-top: 1px solid var(--border-color-light);
}

.day-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

.day-checkbox-label {
    display: inline-flex;
    align-items: center;
    margin-right: 15px;
    margin-bottom: 10px;
    cursor: pointer;
}

.day-checkbox-label input[type="checkbox"] {
    margin-right: 5px;
    width: auto;
}

.interval-input {
    display: flex;
    align-items: center;
    gap: 10px;
}

#recurrence-interval {
    width: 80px;
}

#interval-unit {
    color: var(--text-secondary);
}

/* Filter Bar */
#filterBar {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}

.filter-row:last-child {
    margin-bottom: 0;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-group.search-group {
    flex: 2;
}

.filter-group input,
.filter-group select {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.filter-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    justify-content: flex-end;
}

/* Tags */
.tag {
    display: inline-block;
    background: #e2e8f0;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    margin-right: 4px;
    margin-bottom: 4px;
}

.tag.priority-1 {
    background: #bfdbfe;
    color: #1e40af;
}

.tag.priority-2 {
    background: #fde68a;
    color: #854d0e;
}

.tag.priority-3 {
    background: #fecaca;
    color: #991b1b;
}

/* Status colors */
.status-scheduled {
    color: #1d4ed8;
    font-weight: 500;
}

.status-completed {
    color: #16a34a;
    font-weight: 500;
}

.status-failed {
    color: #dc2626;
    font-weight: 500;
}

/* Action buttons in table */
.action-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.action-btn:hover {
    background-color: #f1f5f9;
}

.action-btn.edit {
    color: #3b82f6;
}

.action-btn.delete {
    color: #ef4444;
}

.action-btn.process {
    color: #10b981;
}

.actions-cell {
    display: flex;
    gap: 5px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 25px;
    border-radius: 8px;
    width: 80%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.close {
    float: right;
    font-size: 24px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

/* Detail View */
.detail-rows {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.detail-item {
    margin-bottom: 15px;
}

.detail-label {
    font-weight: 500;
    color: #666;
    font-size: 13px;
    display: block;
    margin-bottom: 3px;
}

.detail-value {
    font-size: 15px;
}

pre {
    background-color: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
    overflow-x: auto;
    border: 1px solid #eee;
}

/* Recurring indicator */
.recurring-icon {
    display: inline-block;
    margin-right: 5px;
    font-size: 12px;
    color: #3b82f6;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Section container */
.section-container {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.section-container h2 {
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--primary-color);
    font-size: 18px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .form-columns {
        flex-direction: column;
    }
    
    .filter-group {
        min-width: 100%;
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
    }
    
    .day-checkboxes {
        flex-direction: column;
        gap: 5px;
    }
}