/* Dashboard Specific Styles */

/* Statistics Grid */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.stat {
    text-align: center;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: 1px solid #ddd;
}

.stat h3 {
    margin: 0;
    font-size: 2.5em;
    color: #667eea;
    font-weight: bold;
}

.stat p {
    margin: 10px 0 0 0;
    color: #666;
    font-weight: 500;
}

/* Scheduler Card */
.scheduler-card {
    border: 2px solid #007bff;
    border-radius: 8px;
    padding: 20px;
    background: #f0f8ff;
}

.scheduler-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
}

/* Status indicators for scheduler */
.status-active {
    color: #28a745;
    font-weight: bold;
}

.status-stopped {
    color: #dc3545;
    font-weight: bold;
}

.status-running {
    color: #007bff;
    font-weight: bold;
}

/* Trip table specific styles */
#tripsTable {
    cursor: pointer;
}

#tripsTable tr.selected {
    background-color: #e3f2fd;
}

#tripsTable tbody tr:hover {
    background-color: #f5f5f5;
}

/* Action buttons grid */
.action-buttons-grid {
    margin-bottom: 20px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    max-width: 800px;
}

/* Refresh button */
.refresh-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #667eea;
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: transform 0.3s;
}

.refresh-btn:hover {
    transform: scale(1.1);
}

/* Modal styles (for trip management) */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    overflow: auto;
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease-out;
}

.large-modal {
    max-width: 1000px;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 40px;
    border-radius: 8px 8px 0 0;
    position: relative;
}

.modal-header h2 {
    margin: 0;
    font-size: 28px;
}

.modal-subtitle {
    margin-top: 8px;
    font-size: 16px;
    opacity: 0.9;
}

.modal-body {
    padding: 40px;
    max-height: 70vh;
    overflow-y: auto;
}

.modal-footer {
    background: white;
    padding: 24px 40px;
    border-top: 1px solid #e5e7eb;
    border-radius: 0 0 16px 16px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.close {
    position: absolute;
    right: 30px;
    top: 30px;
    color: white;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.3s;
}

.close:hover {
    opacity: 0.8;
}

/* Form sections */
.form-section {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 25px;
}

.section-header {
    margin-bottom: 20px;
}

.section-header h3 {
    margin: 0;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #e0f2fe;
    font-size: 20px;
}

/* Check windows */
#checkWindowsList {
    margin-bottom: 15px;
}

/* Removed .check-window-item - now handled in main.css table layout */

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

/* Settings grid */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.setting-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    transition: border-color 0.3s;
}

.setting-item:hover {
    border-color: #667eea;
}

.radio-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    gap: 12px;
}

.radio-label input[type="radio"] {
    margin-top: 2px;
}

.setting-info strong {
    display: block;
    margin-bottom: 4px;
    color: #333;
}

.setting-info small {
    color: #666;
    font-size: 13px;
}

/* Responsive design */
@media (max-width: 768px) {
    .action-buttons-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .stats {
        grid-template-columns: 1fr;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: 2% auto;
    }
    
    .modal-header {
        padding: 20px;
    }
    
    .modal-body {
        padding: 20px;
    }
}

/* Scheduler Update Animation */
.scheduler-updating {
    animation: schedulerFlash 0.3s ease-out;
}

@keyframes schedulerFlash {
    0% { 
        opacity: 1;
        background-color: transparent;
    }
    50% { 
        opacity: 0.7;
        background-color: rgba(0, 123, 255, 0.1); /* Light blue flash */
    }
    100% { 
        opacity: 1;
        background-color: transparent;
    }
}

/* Force repaint for scheduler elements */
#scheduler-status, 
#scheduler-runs, 
#scheduler-next, 
#scheduler-last,
#scheduler-countdown {
    will-change: contents;
    /* Ensure text updates are visible */
    min-height: 1.2em;
    display: inline-block;
}