/* Recurring Events CSS */

/* Recurrence Rule Builder */
.fca-recurrence-rule-builder {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.fca-recurrence-rule-builder h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.fca-recurrence-frequency {
    margin-bottom: 20px;
}

.fca-recurrence-frequency label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #495057;
}

.fca-recurrence-frequency select {
    width: 100%;
    max-width: 300px;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background-color: white;
    font-size: 14px;
}

.fca-recurrence-interval {
    margin-bottom: 20px;
}

.fca-recurrence-interval label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #495057;
}

.fca-recurrence-interval input {
    width: 80px;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

.fca-recurrence-weekdays {
    margin-bottom: 20px;
}

.fca-recurrence-weekdays label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #495057;
}

.fca-weekday-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.fca-weekday-checkbox {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.fca-weekday-checkbox:hover {
    border-color: #007cba;
}

.fca-weekday-checkbox input[type="checkbox"] {
    margin: 0;
}

.fca-weekday-checkbox.checked {
    background: #007cba;
    color: white;
    border-color: #007cba;
}

.fca-recurrence-end {
    margin-bottom: 20px;
}

.fca-recurrence-end label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #495057;
}

.fca-recurrence-end-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.fca-recurrence-end-option {
    display: flex;
    align-items: center;
    gap: 10px;
}

.fca-recurrence-end-option input[type="radio"] {
    margin: 0;
}

.fca-recurrence-end-option input[type="date"] {
    padding: 6px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

.fca-recurrence-end-option input[type="number"] {
    width: 80px;
    padding: 6px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

/* Recurrence Summary */
.fca-recurrence-summary {
    background: #e7f3ff;
    border: 1px solid #b6d4fe;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
}

.fca-recurrence-summary h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #0d6efd;
    font-size: 14px;
    font-weight: 600;
}

.fca-recurrence-summary p {
    margin: 0;
    color: #084298;
}

/* Recurrence Instance Manager */
.fca-recurrence-instance-manager {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.fca-recurrence-instance-manager h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.fca-recurrence-instances-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    margin-bottom: 15px;
}

.fca-recurrence-instance {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    border-bottom: 1px solid #dee2e6;
    transition: background-color 0.2s;
}

.fca-recurrence-instance:last-child {
    border-bottom: none;
}

.fca-recurrence-instance:hover {
    background-color: #f8f9fa;
}

.fca-recurrence-instance-date {
    font-weight: 500;
    color: #333;
}

.fca-recurrence-instance-time {
    color: #6c757d;
    font-size: 13px;
}

.fca-recurrence-instance-actions {
    display: flex;
    gap: 8px;
}

.fca-recurrence-instance-action {
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
}

.fca-recurrence-instance-action.edit {
    background: #0d6efd;
    color: white;
    border: none;
}

.fca-recurrence-instance-action.edit:hover {
    background: #0b5ed7;
}

.fca-recurrence-instance-action.cancel {
    background: #dc3545;
    color: white;
    border: none;
}

.fca-recurrence-instance-action.cancel:hover {
    background: #bb2d3b;
}

.fca-recurrence-instance-action.reschedule {
    background: #ffc107;
    color: #212529;
    border: none;
}

.fca-recurrence-instance-action.reschedule:hover {
    background: #ffca2c;
}

/* Override Editor */
.fca-recurrence-override-editor {
    background: #fff3cd;
    border: 1px solid #ffecb5;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
}

.fca-recurrence-override-editor h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #856404;
    font-size: 14px;
    font-weight: 600;
}

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

.fca-recurrence-override-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.fca-recurrence-override-field label {
    font-size: 13px;
    font-weight: 500;
    color: #856404;
}

.fca-recurrence-override-field input,
.fca-recurrence-override-field textarea {
    padding: 6px 12px;
    border: 1px solid #ffecb5;
    border-radius: 4px;
    font-size: 14px;
}

.fca-recurrence-override-field textarea {
    min-height: 80px;
    resize: vertical;
}

.fca-recurrence-override-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.fca-recurrence-override-save {
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.fca-recurrence-override-save:hover {
    background: #218838;
}

.fca-recurrence-override-cancel {
    background: #6c757d;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.fca-recurrence-override-cancel:hover {
    background: #5c636a;
}

/* Recurrence Toggle */
.fca-recurrence-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
}

.fca-recurrence-toggle label {
    font-weight: 500;
    color: #333;
    cursor: pointer;
}

.fca-recurrence-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
}

/* Loading States */
.fca-recurrence-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    color: #6c757d;
    font-style: italic;
}

.fca-recurrence-loading::after {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-left: 10px;
    border: 2px solid #dee2e6;
    border-top-color: #007cba;
    border-radius: 50%;
    animation: fca-spin 1s linear infinite;
}

@keyframes fca-spin {
    to { transform: rotate(360deg); }
}

/* Error States */
.fca-recurrence-error {
    background: #f8d7da;
    border: 1px solid #f5c2c7;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
    color: #842029;
    font-size: 14px;
}

.fca-recurrence-error h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #842029;
    font-size: 14px;
    font-weight: 600;
}

/* Empty States */
.fca-recurrence-empty {
    text-align: center;
    padding: 30px;
    color: #6c757d;
    font-style: italic;
    border: 1px dashed #dee2e6;
    border-radius: 6px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .fca-recurrence-rule-builder,
    .fca-recurrence-instance-manager {
        padding: 15px;
    }
    
    .fca-weekday-checkboxes {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .fca-recurrence-override-fields {
        grid-template-columns: 1fr;
    }
    
    .fca-recurrence-instance {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .fca-recurrence-instance-actions {
        align-self: flex-end;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .fca-recurrence-rule-builder {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .fca-recurrence-rule-builder h3 {
        color: #e2e8f0;
    }
    
    .fca-recurrence-frequency label,
    .fca-recurrence-interval label,
    .fca-recurrence-weekdays label,
    .fca-recurrence-end label {
        color: #cbd5e0;
    }
    
    .fca-recurrence-frequency select,
    .fca-recurrence-interval input,
    .fca-recurrence-end-option input[type="date"],
    .fca-recurrence-end-option input[type="number"] {
        background: #4a5568;
        border-color: #718096;
        color: #e2e8f0;
    }
    
    .fca-weekday-checkbox {
        background: #4a5568;
        border-color: #718096;
        color: #e2e8f0;
    }
    
    .fca-weekday-checkbox.checked {
        background: #007cba;
        border-color: #007cba;
    }
    
    .fca-recurrence-summary {
        background: #1a365d;
        border-color: #2d3748;
    }
    
    .fca-recurrence-summary h4 {
        color: #90cdf4;
    }
    
    .fca-recurrence-summary p {
        color: #cbd5e0;
    }
    
    .fca-recurrence-instance-manager {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .fca-recurrence-instance-manager h3 {
        color: #e2e8f0;
    }
    
    .fca-recurrence-instance {
        border-color: #4a5568;
    }
    
    .fca-recurrence-instance:hover {
        background-color: #4a5568;
    }
    
    .fca-recurrence-instance-date {
        color: #e2e8f0;
    }
    
    .fca-recurrence-instance-time {
        color: #a0aec0;
    }
    
    .fca-recurrence-override-editor {
        background: #44337a;
        border-color: #553c9a;
    }
    
    .fca-recurrence-override-editor h4 {
        color: #d6bcfa;
    }
    
    .fca-recurrence-override-field label {
        color: #d6bcfa;
    }
    
    .fca-recurrence-override-field input,
    .fca-recurrence-override-field textarea {
        background: #4a5568;
        border-color: #553c9a;
        color: #e2e8f0;
    }
    
    .fca-recurrence-toggle {
        background: #2d3748;
    }
    
    .fca-recurrence-toggle label {
        color: #e2e8f0;
    }
    
    .fca-recurrence-error {
        background: #742a2a;
        border-color: #9b2c2c;
        color: #feb2b2;
    }
    
    .fca-recurrence-error h4 {
        color: #feb2b2;
    }
    
    .fca-recurrence-empty {
        border-color: #4a5568;
        color: #a0aec0;
    }
}