/**
 * Smart Flight Board - CSS Styles
 * Version: 1.0.0
 */

.sfb-container {
    max-width: 1400px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.sfb-container h1 {
    text-align: center;
    color: #333333;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

.sfb-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-direction: row-reverse;
    justify-content: flex-start;
}

.sfb-control-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    flex: 1;
}

.sfb-container input,
.sfb-container select,
.sfb-container button {
    padding: 0.75rem;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.sfb-container input:focus,
.sfb-container select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

#sfb-searchInput {
    flex: 1;
    min-width: 200px;
}

.sfb-container button {
    background: #3498db;
    color: white;
    border: none;
    cursor: pointer;
    padding: 0.75rem 1.5rem;
}

.sfb-container button:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

.sfb-column-toggle {
    background: #f8f8f8;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    display: none;
}

.sfb-column-toggle.visible {
    display: block;
}

.sfb-column-toggle label {
    margin-right: 1rem;
    font-size: 0.9rem;
}

.sfb-stats {
    display: flex;
    background: #f8f8f8;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    flex-direction: row-reverse;
    justify-content: flex-start;
    align-items: center;
}

.sfb-container table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background: #ffffff;
}

.sfb-container th,
.sfb-container td {
    border: 1px solid #e0e0e0;
    padding: 0.75rem;
    text-align: center;
    font-weight: 600;
    font-size: 1.5rem;
}

.sfb-container th {
    background: #f2f2f2;
    cursor: move;
    user-select: none;
}

.sfb-container th:hover {
    background: #e0e0e0;
}

.sfb-container tr:hover {
    background: #e6f3ff;
}

.sfb-container tr:nth-child(even) {
    background: #f8f8f8;
}

.sfb-container tr:nth-child(even):hover {
    background: #e6f3ff;
}


.sfb-container tr.sfb-draggable {
    cursor: grab;
}

.sfb-container tr.sfb-draggable.dragging {
    cursor: grabbing;
}

.sfb-container th.dragging {
    cursor: grabbing;
}

/* Add drag-over style for column headers */
.sfb-container th.drag-over {
    border-left: 3px solid #3498db;
    background: #d0e7ff;
}

.sfb-container th.dragging {
    opacity: 0.7;
    background: #d0d0d0;
    cursor: grabbing;
}


#sfb-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-size: 1.1rem;
    padding: 1rem;
}

#sfb-error {
    background: #ffe6e6;
    color: #d63031;
    padding: 1rem;
    border-radius: 6px;
    margin: 1rem 0;
    text-align: center;
}

.sfb-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 1.5rem;
    height: 1.5rem;
    animation: sfb-spin 1s linear infinite;
}

.sfb-pagination {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    align-items: center;
    margin: 1.5rem 0;
}

.sfb-pagination button {
    background: #f38650;
    border: none;
    padding: 0.5rem 1rem;
}

.sfb-pagination button:hover:not(:disabled) {
    background: #e07b39;
}

.sfb-pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Status Colors */
.sfb-status-canceled {
    background: #e74c3c;
    color: white;
}

.sfb-status-landed {
    background: #2ecc71;
    color: white;
}

.sfb-status-delayed {
    background: #EB7663;
    color: white;
}

.sfb-status-departed {
    background: #3498db;
    color: white;
}

.sfb-status-final {
    background: #27ae60;
    color: white;
}

.sfb-status-landing {
    background: #219653;
    color: white;
}

.sfb-status-on-time {
    background: #6ab04c;
    color: white;
}

.sfb-status-not-final {
    background: yellow;
    color: black;
}

/* Time Status Colors */
.sfb-actual-time-late {
    background: #fcd6c7;
}

.sfb-actual-time-early {
    background: #c2ede3;
}

/* Flag Images */
.sfb-flag-img {
    width: 32px;
    height: 24px;
    object-fit: cover;
    border-radius: 2px;
}

/* Favorites Container */
.sfb-favorites-container {
    max-width: 1400px;
    margin: 1.5rem auto;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
}

.sfb-favorites-container h2 {
    text-align: center;
    color: #333333;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.sfb-drop-zone {
    border: 2px dashed #e0e0e0;
    padding: 1rem;
    text-align: center;
    font-size: 1rem;
    color: #333333;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.sfb-drop-zone.drag-over {
    border-color: #3498db;
    background: rgba(52, 152, 219, 0.1);
}

.sfb-delete-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
    cursor: pointer;
    border-radius: 4px;
}

.sfb-delete-btn:hover {
    background: #c0392b;
}

.sfb-refresh-status {
    background: #e8f5e8;
    color: #2d5a2d;
    padding: 0.5rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    text-align: center;
    font-size: 0.9rem;
    display: none;
}

.sfb-refresh-status.show {
    display: block;
}

/* Animations */
@keyframes sfb-spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .sfb-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .sfb-control-group {
        flex-direction: column;
    }
    
    .sfb-container input,
    .sfb-container select,
    .sfb-container button {
        width: 100%;
    }
    
    .sfb-container th,
    .sfb-container td {
        padding: 0.5rem;
        font-size: 0.85rem;
    }
    
    .sfb-container table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}