/* Enhanced Settings Section Styles - Email Reminders */

/* Main Settings Section */
.settings-section {
    padding: 30px;
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border-top: 1px solid rgba(79, 172, 254, 0.1);
    position: relative;
    min-height: 500px;
}

.settings-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(79, 172, 254, 0.3), 
        transparent);
}

.settings-section h3 {
    color: #2c3e50;
    font-size: 1.4em;
    font-weight: 700;
    margin-bottom: 25px;
    text-align: center;
    position: relative;
}

.settings-section h3::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    border-radius: 2px;
}

/* Enhanced Settings Container */
.settings-container {
    max-width: 700px;
    margin: 0 auto;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 30px;
    border-radius: 20px;
    border: 2px solid rgba(79, 172, 254, 0.1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.settings-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, 
        transparent, 
        rgba(79, 172, 254, 0.03), 
        transparent);
    animation: settingsShimmer 6s infinite;
}

@keyframes settingsShimmer {
    0% { transform: translateX(-100%) translateY(-100%); }
    100% { transform: translateX(100%) translateY(100%); }
}

/* Settings Groups */
.settings-group {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
    border: 1px solid rgba(79, 172, 254, 0.1);
    position: relative;
    z-index: 1;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.settings-group:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: rgba(79, 172, 254, 0.2);
}

.settings-group h4 {
    color: #2c3e50;
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-group h4::before {
    content: attr(data-icon);
    font-size: 1.2em;
    opacity: 0.8;
}

.settings-group p {
    color: #6c757d;
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.5;
}

/* Enhanced Toggle Switches */
.toggle-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    padding: 15px;
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.05) 0%, rgba(0, 242, 254, 0.05) 100%);
    border-radius: 12px;
    border: 1px solid rgba(79, 172, 254, 0.1);
    transition: all 0.3s ease;
}

.toggle-container:hover {
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.08) 0%, rgba(0, 242, 254, 0.08) 100%);
    border-color: rgba(79, 172, 254, 0.2);
}

.toggle-label {
    flex: 1;
    margin-right: 15px;
}

.toggle-label-text {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
    font-size: 15px;
}

.toggle-label-desc {
    font-size: 13px;
    color: #6c757d;
    opacity: 0.9;
}

/* Custom Toggle Switch */
.toggle-switch {
    position: relative;
    width: 60px;
    height: 30px;
    background: #ccc;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.1);
}

.toggle-switch.active {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    box-shadow: 
        inset 0 2px 6px rgba(0, 0, 0, 0.1),
        0 0 20px rgba(79, 172, 254, 0.3);
}

.toggle-switch::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.toggle-switch.active::before {
    transform: translateX(30px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Enhanced Form Controls */
.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    align-items: end;
}

.form-field {
    flex: 1;
    position: relative;
}

.form-field label {
    display: block;
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-field input,
.form-field select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e6ed;
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.05);
}

.form-field input:focus,
.form-field select:focus {
    outline: none;
    border-color: #4facfe;
    background: #fff;
    box-shadow: 
        inset 0 2px 8px rgba(0, 0, 0, 0.05),
        0 0 0 3px rgba(79, 172, 254, 0.1);
    transform: translateY(-1px);
}

.form-field.disabled input,
.form-field.disabled select,
.form-field.disabled label {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Enhanced Save Button */
.settings-save-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 16px 30px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    width: 100%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 25px;
}

.settings-save-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.3), 
        transparent);
    transition: left 0.5s ease;
}

.settings-save-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(40, 167, 69, 0.4);
}

.settings-save-btn:hover::before {
    left: 100%;
}

.settings-save-btn:active {
    transform: translateY(-1px);
}

.settings-save-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Success/Error Messages */
.settings-message {
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 600;
    position: relative;
    overflow: hidden;
    animation: messageSlideIn 0.4s ease-out;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.settings-message.success {
    background: linear-gradient(135deg, #c6f6d5 0%, #9ae6b4 100%);
    color: #2d7738;
    border: 2px solid #68d391;
}

.settings-message.error {
    background: linear-gradient(135deg, #fed7d7 0%, #feb2b2 100%);
    color: #c53030;
    border: 2px solid #fc8181;
}

.settings-message.warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
    border: 2px solid #f39c12;
}

.settings-message::before {
    content: '✅ ';
    font-size: 16px;
    margin-right: 8px;
}

.settings-message.error::before {
    content: '⚠️ ';
}

.settings-message.warning::before {
    content: '⚠️ ';
}


 /* Reminder History Section */
.reminder-history {
    display: none; /* Hide by default until JavaScript determines visibility */
    background: linear-gradient(135deg, #e6f3ff 0%, #cce7ff 100%);
    border-radius: 15px;
    padding: 20px;
    margin-top: 25px;
    border: 1px solid rgba(79, 172, 254, 0.2);
}

.reminder-history h5 {
    color: #2c3e50;
    font-size: 1em;
    font-weight: 600;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.reminder-history h5::before {
    content: '📧';
    font-size: 1.1em;
}

.history-item {
    background: white;
    padding: 12px 15px;
    border-radius: 10px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid #4facfe;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.history-item:last-child {
    margin-bottom: 0;
}

.history-item-type {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.history-item-date {
    font-size: 12px;
    color: #6c757d;
}

.history-empty {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 20px;
    font-size: 14px;
}

/* Loading States */
.settings-loading {
    display: none;
    text-align: center;
    color: #4facfe;
    padding: 30px;
    font-size: 16px;
    font-weight: 600;
}

.settings-loading::before {
    content: '';
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(79, 172, 254, 0.2);
    border-top-color: #4facfe;
    border-radius: 50%;
    animation: settingsSpinning 1s linear infinite;
    margin-right: 12px;
    vertical-align: middle;
}

@keyframes settingsSpinning {
    to { transform: rotate(360deg); }
}

/* Enhanced Mobile Responsive Design */
@media (max-width: 768px) {
    .settings-section {
        padding: 20px 15px;
    }
    
    .settings-container {
        padding: 20px 15px;
        margin: 0 10px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .toggle-container {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
        text-align: center;
    }
    
    .toggle-label {
        margin-right: 0;
    }
    
    .toggle-switch {
        align-self: center;
    }
    
    .settings-group {
        padding: 20px 15px;
    }
}

@media (max-width: 480px) {
    .settings-section {
        padding: 15px 10px;
    }
    
    .settings-container {
        padding: 15px 12px;
    }
    
    .settings-group {
        padding: 15px 12px;
    }
    
    .form-field input,
    .form-field select {
        padding: 14px 16px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

/* Enhanced Accessibility */
.form-field input:focus,
.form-field select:focus,
.settings-save-btn:focus,
.toggle-switch:focus {
    outline: 3px solid rgba(79, 172, 254, 0.6);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .settings-container,
    .settings-group {
        border: 3px solid #000;
        background: #fff;
    }
    
    .settings-save-btn,
    .toggle-switch {
        border: 3px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .settings-group,
    .settings-save-btn,
    .form-field input,
    .form-field select,
    .toggle-switch,
    .settings-message {
        transition: none;
        animation: none;
    }
    
    .settings-container::before {
        animation: none;
    }
}

/* ============================================================================ */
/* 🆕 CRON STATUS MONITORING STYLES */
/* ============================================================================ */

.cron-status-section {
    margin: 30px 0;
    padding: 25px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    border: 1px solid #dee2e6;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.cron-status-header {
    margin-bottom: 25px;
}

.cron-status-header h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.3em;
    font-weight: 600;
}

.system-info {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.status-badge {
    padding: 8px 15px;
    border-radius: 25px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-badge.error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-badge.warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
    border: 1px solid #ffeaa7;
}

.status-badge.info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.cron-jobs-status {
    display: grid;
    gap: 20px;
    margin-bottom: 25px;
}

.cron-job-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cron-job-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.job-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.job-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #333;
    font-size: 1.1em;
}

.job-schedule {
    font-size: 0.85em;
    color: #666;
    font-weight: normal;
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 6px;
    margin-left: 10px;
}

.job-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.job-status.running {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
    animation: pulse 2s infinite;
}

.job-status.active {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
}

.job-status.inactive {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

.job-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.job-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.stat-label {
    font-weight: 600;
    color: #555;
    font-size: 0.9em;
}

.stat-value {
    color: #333;
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
}

.job-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 10px;
}

.stat-item {
    text-align: center;
    padding: 15px 10px;
    border-radius: 10px;
    background: white;
    border: 2px solid #f0f0f0;
    transition: transform 0.2s ease;
}

.stat-item:hover {
    transform: translateY(-1px);
}

.stat-item.success {
    border-color: #28a745;
}

.stat-item.total {
    border-color: #17a2b8;
}

.stat-item.error {
    border-color: #dc3545;
}

.stat-number {
    display: block;
    font-size: 1.8em;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-item.success .stat-number {
    color: #28a745;
}

.stat-item.total .stat-number {
    color: #17a2b8;
}

.stat-item.error .stat-number {
    color: #dc3545;
}

.stat-text {
    font-size: 0.8em;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.last-error {
    background: #fff5f5;
    border: 1px solid #feb2b2;
    border-radius: 8px;
    padding: 12px;
    margin-top: 10px;
}

.last-error strong {
    color: #c53030;
}

.cron-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
}

.cron-actions .btn {
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.cron-actions .btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
}

.cron-actions .btn-secondary:hover {
    background: linear-gradient(135deg, #5a6268 0%, #495057 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.cron-actions .btn-outline {
    background: transparent;
    color: #4facfe;
    border: 2px solid #4facfe;
}

.cron-actions .btn-outline:hover {
    background: #4facfe;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.3);
}

/* Responsive design for mobile */
@media (max-width: 768px) {
    .system-info {
        flex-direction: column;
        gap: 10px;
    }
    
    .job-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .job-stats {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .cron-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .cron-actions .btn {
        text-align: center;
    }
}

/* Loading state animation */
.cron-status-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    color: #666;
}

.cron-status-loading::before {
    content: "🔄";
    animation: spin 1s linear infinite;
    margin-right: 10px;
    font-size: 1.2em;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
