/* Gracery Flight Info Plugin Styles */

/* Original styles preserved for compatibility */
.gracery-flight-info {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Japanese Airport Board Styles */
.gracery-flight-info.japanese-board {
    font-family: "Hiragino Kaku Gothic ProN", "ヒラギノ角ゴ ProN W3", Meiryo, "メイリオ", Osaka, "MS PGothic", sans-serif;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 2px solid #1976d2;
    border-radius: 12px;
    padding: 0;
    margin: 20px 0;
    box-shadow: 0 8px 24px rgba(25, 118, 210, 0.15);
    overflow: hidden;
}

/* Board Header */
.flight-board-header {
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    color: white;
    padding: 20px;
    position: relative;
}

.board-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.board-title h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.current-datetime {
    font-size: 14px;
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 12px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

/* Tab Navigation */
.flight-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
}

.tab-button {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.tab-button.active {
    background: white;
    color: #1976d2;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.tab-button:hover:not(.active) {
    background: rgba(255, 255, 255, 0.3);
}

/* Info Notice */
.info-notice {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.notice-international,
.international-toggle {
    background: #ff9800;
    color: white;
    padding: 5px 15px;
    border-radius: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.international-toggle:hover {
    background: #f57c00;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.3);
}

.international-toggle:active {
    transform: translateY(0);
}

.international-toggle.active {
    /* background: #4caf50; */
}

.international-toggle.active:hover {
    background: #45a049;
}

/* Flight Board Content */
.flight-board-content {
    background: white;
    min-height: 600px;
    max-height: 800px; /* Adjusted max-height */
    display: flex;
    flex-direction: column;
}

.tab-content {
    display: none;
    flex: 1;
    height: 100%;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
}

/* Flight Board Table */
.flight-board-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
    display: flex;
    flex-direction: column;
    height: 100%;
    flex: 1;
}

.flight-board-table thead, .flight-board-table tfoot {
    background: #455a64;
    color: white;
    display: block;
    flex-shrink: 0;
}

.flight-board-table tbody {
    display: block;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 400px;
    max-height: 500px;
    scrollbar-width: thin;
    scrollbar-color: #1976d2 #f0f0f0;
}

/* Custom scrollbar for webkit browsers */
.flight-board-table tbody::-webkit-scrollbar {
    width: 8px;
}

.flight-board-table tbody::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 4px;
}

.flight-board-table tbody::-webkit-scrollbar-thumb {
    background: #1976d2;
    border-radius: 4px;
}

.flight-board-table tbody::-webkit-scrollbar-thumb:hover {
    background: #1565c0;
}

.flight-board-table thead tr,
.flight-board-table tbody tr,
.flight-board-table tfoot tr {
    display: table;
    width: 100%;
    table-layout: fixed;
}

.flight-board-table th {
    padding: 15px 12px;
    text-align: center;
    font-weight: 600;
    border-right: 1px solid #90a4ae;
}

.flight-board-table th:last-child {
    border-right: none;
}

.airline-logo-image {
    max-height: 40px;
    max-width: 100px;
    object-fit: contain;
    vertical-align:middle;
}
/* Flight Rows */
.flight-row {
    border-bottom: 1px solid #e0e0e0;
    transition: background-color 0.2s ease;
}

.flight-row:hover {
    background-color: #f5f5f5;
}

.flight-row:nth-child(even) {
    background-color: #fafafa;
}

.flight-board-table td {
    padding: 15px 12px;
    text-align: center;
    vertical-align: middle;
    border-right: 1px solid #e0e0e0;
}

.flight-board-table td:last-child {
    border-right: none;
}

/* Sortable column styles */
.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: background-color 0.2s ease;
}

.sortable:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.sort-indicator {
    display: inline-block;
    margin-left: 8px;
    font-size: 12px;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.sort-indicator:before {
    content: "↕";
}

.sortable.asc .sort-indicator:before {
    content: "↑";
    opacity: 1;
}

.sortable.desc .sort-indicator:before {
    content: "↓";
    opacity: 1;
}

.sortable:hover .sort-indicator {
    opacity: 1;
}

/* Time styling */
.scheduled-time {
    font-weight: 700;
    color: #1976d2;
    font-size: 16px;
}

.actual-time {
    font-weight: 600;
    color: #d32f2f;
    font-size: 14px;
}

/* Destination styling */
.destination-name {
    font-weight: 600;
    color: #424242;
    text-align: left;
    padding-left: 10px;
}

/* Flight number styling */
.flight-code {
    font-weight: 700;
    color: #1976d2;
    font-size: 14px;
    background: #e3f2fd;
    padding: 0px 10px;
    margin:3px;
    border-radius: 4px;
    display: inline-block;
    min-width: 60px;
}

/* Airline styling */
.airline-logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

.airline-name {
    font-weight: 600;
    color: #666;
    font-size: 12px;
}

/* Status styling */
.status-text {
    padding: 5px 12px;
    border-radius: 15px;
    font-weight: 600;
    font-size: 12px;
    display: inline-block;
    min-width: 60px;
}


/* Status colors - Japanese style */
.flight-row .status-text {
    background: #4caf50;
    color: white;
}

.flight-row .status-text.status-landed {
    background: linear-gradient(135deg, #42a5f5 0%, #1976d2 100%);
    color: white;
}
.flight-row .status-text.status-cancelled {
    background: #e57373;
    color: white;
}


.flight-row .status-text.status-landed {
    background: linear-gradient(135deg, #42a5f5 0%, #1976d2 100%);
    color: white;
}
.flight-row .status-text.status-delayed {
    background: linear-gradient(135deg, #ffca28 0%, #ffb300 100%);
    color: white;
}
/* No flights message */
.no-flights {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 40px !important;
    background: #f9f9f9;
}

/* Scroll Indicators */
.scroll-indicators {
    background: #37474f;
    color: white;
    padding: 10px;
    text-align: center;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.scroll-arrow {
    font-size: 18px;
    font-weight: bold;
    animation: bounce 2s infinite;
}

.scroll-up {
    animation-delay: 0s;
}

.scroll-down {
    animation-delay: 1s;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-5px);
    }
    60% {
        transform: translateY(-3px);
    }
}

/* Refresh Section */
.refresh-section {
    background: #37474f;
    padding: 15px;
    text-align: center;
}

.japanese-refresh {
    background: #ff9800;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
}

.japanese-refresh:hover {
    background: #f57c00;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 152, 0, 0.4);
}

.japanese-refresh:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Loading state */
.gracery-flight-info.loading {
    opacity: 0.7;
    pointer-events: none;
}

.gracery-flight-info.loading::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

/* Responsive design */
@media (max-width: 768px) {
    .flight-board-table {
        font-size: 12px;
    }
    
    .flight-board-table th,
    .flight-board-table td {
        padding: 8px 6px;
    }
    
    .board-title {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .board-title h2 {
        font-size: 18px;
    }
    
    .flight-tabs {
        justify-content: center;
    }
    
    .tab-button {
        padding: 8px 20px;
        font-size: 14px;
    }
    
    .destination-name {
        text-align: center;
        padding-left: 0;
    }
}

.flight-info-title {
    margin: 0 0 20px 0;
    padding: 0 0 10px 0;
    border-bottom: 2px solid #0073aa;
    color: #23282d;
    font-size: 1.3em;
    font-weight: 600;
}

.flight-section {
    margin-bottom: 25px;
}

.flight-section:last-child {
    margin-bottom: 0;
}

.flight-section h4 {
    margin: 0 0 15px 0;
    padding: 8px 12px;
    background: #f1f1f1;
    border-left: 4px solid #0073aa;
    font-size: 1.1em;
    font-weight: 600;
    color: #23282d;
}

.flight-section.arrivals h4 {
    border-left-color: #46b450;
    background: #f0f8f0;
}

.flight-section.departures h4 {
    border-left-color: #dc3232;
    background: #fdf0f0;
}

.flight-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.flight-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #fafafa;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.flight-item:hover {
    background: #f5f5f5;
    border-color: #0073aa;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.flight-item.arrival {
    border-left: 4px solid #46b450;
}

.flight-item.departure {
    border-left: 4px solid #dc3232;
}

.flight-number {
    font-weight: 700;
    font-size: 1.1em;
    color: #0073aa;
    min-width: 80px;
    max-width: 150px;
}

.flight-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    margin-left: 15px;
}

.flight-details span {
    font-size: 0.9em;
    color: #666;
}

.flight-details .from,
.flight-details .to {
    font-weight: 500;
    color: #23282d;
}

.flight-details .time {
    font-style: italic;
}

.status {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-on-time {
    background: #46b450;
    color: white;
}

.status-delayed {
    background: #ffb900;
    color: white;
}

.status-boarding {
    background: #0073aa;
    color: white;
}

.status-arrived {
    background: #666;
    color: white;
}

.status-departed {
    background: #666;
    color: white;
}

.status-cancelled {
    background: #dc3232;
    color: white;
}

/* Widget specific styles */
.widget .gracery-flight-info {
    margin: 10px 0;
    padding: 15px;
    font-size: 0.9em;
}

.widget .flight-info-title {
    font-size: 1.1em;
    margin-bottom: 15px;
}

.widget .flight-section h4 {
    font-size: 1em;
    margin-bottom: 10px;
    padding: 6px 10px;
}

.widget .flight-item {
    padding: 8px 12px;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.widget .flight-details {
    margin-left: 0;
    width: 100%;
}

.widget .flight-number {
    min-width: auto;
    margin-bottom: 5px;
}

/* Responsive design */
@media (max-width: 768px) {
    .gracery-flight-info {
        padding: 15px;
        margin: 15px 0;
    }
    
    .flight-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .flight-details {
        margin-left: 0;
        width: 100%;
    }
    
    .flight-number {
        min-width: auto;
    }
}

/* Admin styles */
.gracery-flight-info-admin {
    max-width: 600px;
}

.gracery-flight-info-admin .form-table th {
    width: 200px;
}

.gracery-flight-info-admin .description {
    font-style: italic;
    color: #666;
}

/* Refresh functionality styles */
.flight-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #0073aa;
}

.flight-info-header .flight-info-title {
    margin: 0;
    padding: 0;
    border: none;
    flex: 1;
}

.flight-refresh-btn {
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.flight-refresh-btn:hover {
    background: #005a87;
}

.flight-refresh-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.gracery-flight-info.loading {
    opacity: 0.7;
    pointer-events: none;
}

.flight-last-updated {
    font-size: 12px;
    color: #666;
    text-align: right;
    margin-top: 10px;
    font-style: italic;
}

/* Enhanced flight item styles for API data */
.flight-item {
    border: 1px solid #e1e1e1;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 12px;
    background: #fafafa;
    transition: box-shadow 0.2s ease;
}

.flight-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.flight-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e1e1e1;
}

.flight-header .flight-number {
    font-size: 1.2em;
    font-weight: 700;
    color: #23282d;
}

.flight-item .airline {
    font-weight: 600;
    color: #0073aa;
    font-size: 0.9em;
}

.flight-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.route {
    font-weight: 500;
    color: #23282d;
}

.timing {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.timing .time {
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.9em;
}

.timing .scheduled {
    background: #f0f6fc;
    color: #0969da;
}

.timing .estimated-time {
    background: #fff8dc;
    color: #dc3232;
    font-weight: 500;
}

.timing .actual-time {
    background: #f0f8f0;
    color: #46b450;
    font-weight: 600;
}

.flight-info {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.flight-item .terminal,
.flight-item .gate {
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.85em;
    color: #495057;
    border: 1px solid #dee2e6;
}


th.gate, td.gate {
    width:100px;
}
ul.flight-block li{
    height:50px; 
    white-space:nowrap;
}

td.status {
    text-align:center;
    vertical-align: middle;
}

/* hide scrollbar */
.flight-board-table tbody {
    scrollbar-width: none; /* Firefox */
}


/* Status colors for different flight statuses */
.status-scheduled { color: #0073aa; }
.status-active { color: #46b450; }
.status-landed { color: #46b450; }
.status-cancelled { color: #dc3232; }
.status-incident { color: #ff8c00; }
.status-diverted { color: #ff8c00; }
.status-unknown { color: #666; }

/* International mode styling */
.japanese-board.international-mode {
    border: 2px solid #ff9800;
}

.japanese-board.international-mode .flight-board-header {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
}

.japanese-board.international-mode .board-title h2::after {
    content: " (国際線)";
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.8em;
}

.international-flight {
    background: rgba(255, 152, 0, 0.05);
    border-left: 3px solid #ff9800;
}

/* Highlight current time row */
.highlight-current-time {
    background: linear-gradient(90deg, rgba(25, 118, 210, 0.1) 0%, rgba(25, 118, 210, 0.2) 50%, rgba(25, 118, 210, 0.1) 100%);
    animation: highlightFade 3s ease-in-out;
    border-left: 4px solid #1976d2;
}

@keyframes highlightFade {
    0% {
        background: linear-gradient(90deg, rgba(25, 118, 210, 0.3) 0%, rgba(25, 118, 210, 0.4) 50%, rgba(25, 118, 210, 0.3) 100%);
    }
    100% {
        background: linear-gradient(90deg, rgba(25, 118, 210, 0.1) 0%, rgba(25, 118, 210, 0.2) 50%, rgba(25, 118, 210, 0.1) 100%);
    }
}

.international-flight:hover {
    background: rgba(255, 152, 0, 0.1);
}

/* Animation for flight row filtering */
.flight-row {
    transition: all 0.3s ease;
}

.flight-row.filtered-out {
    opacity: 0;
    transform: translateX(-20px);
    height: 0;
    padding: 0;
    border: none;
}

/* No flights message styling */
.no-flights {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
    background: rgba(255, 255, 255, 0.1);
}