/**
 * GRK Flight Status Styles
 * WCAG 2.1 AA Compliant - Modern Cohesive Widget Design
 */

/* ============================================
   Base Container - The Unified Widget
   ============================================ */
.grk-flight-status-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    color: #000000 !important;
    background: #ffffff !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

.grk-flight-status-wrapper *,
.grk-flight-status-wrapper *::before,
.grk-flight-status-wrapper *::after {
    box-sizing: border-box;
}

/* ============================================
   Screen Reader Only
   ============================================ */
.grk-flight-status-wrapper .grk-sr-only,
.grk-flight-status-wrapper table.grk-flight-table caption {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ============================================
   Search Box (hidden by default, optional)
   ============================================ */
.grk-flight-status-wrapper .grk-search-box {
    width: 100%;
    background-color: #f5f5f5 !important;
    padding: 20px !important;
    margin: 0 !important;
    border-bottom: 1px solid #e0e0e0 !important;
}

.grk-flight-status-wrapper .grk-search-input {
    width: 100% !important;
    font-size: 16px !important;
    padding: 12px 15px !important;
    border: 2px solid #767676 !important;
    border-radius: 4px !important;
    background-color: #ffffff !important;
    color: #000000 !important;
}

.grk-flight-status-wrapper .grk-search-input:focus {
    outline: 3px solid #0055a4 !important;
    outline-offset: 2px !important;
    border-color: #0055a4 !important;
}

/* ============================================
   Navigation Bar - Seamless with Table
   ============================================ */
.grk-flight-status-wrapper .grk-nav-wrapper {
    display: flex !important;
    flex-wrap: wrap !important;
    background: #f5f5f5 !important;
    padding: 15px !important;
    margin: 0 !important;
    gap: 8px !important;
    border: none !important;
    align-items: center !important;
    border-bottom: none !important;
}

.grk-flight-status-wrapper .grk-nav-group {
    display: inline-flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 0 !important;
    margin: 0 !important;
}

/* ============================================
   Navigation Buttons - Icons Stacked Above Text
   ============================================ */
.grk-flight-status-wrapper .grk-nav-btn,
.grk-flight-status-wrapper button.grk-nav-btn {
    display: inline-flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    padding: 10px 20px !important;
    margin: 0 !important;
    font-family: inherit !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
    text-decoration: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    border: none !important;
    border-radius: 4px !important;
    background-color: transparent !important;
    color: #000000 !important;
    cursor: pointer !important;
    min-height: 44px !important;
    min-width: 100px !important;
    white-space: nowrap !important;
    transition: background-color 0.15s ease, color 0.15s ease !important;
}

/* Icon above text */
.grk-flight-status-wrapper .grk-nav-btn i,
.grk-flight-status-wrapper .grk-nav-btn .fa,
.grk-flight-status-wrapper .grk-nav-btn .fas,
.grk-flight-status-wrapper .grk-nav-btn .far,
.grk-flight-status-wrapper .grk-nav-btn [class*="fa-"] {
    display: block !important;
    font-size: 16px !important;
    line-height: 1 !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
}

.grk-flight-status-wrapper .grk-nav-btn:hover {
    background-color: #000000 !important;
    color: #ffffff !important;
}

.grk-flight-status-wrapper .grk-nav-btn:focus {
    outline: 3px solid #0055a4 !important;
    outline-offset: 2px !important;
    z-index: 10 !important;
    position: relative !important;
}

.grk-flight-status-wrapper .grk-nav-btn:focus-visible {
    outline: 3px solid #0055a4 !important;
    outline-offset: 2px !important;
}

.grk-flight-status-wrapper .grk-nav-btn.grk-active {
    background-color: #000000 !important;
    color: #ffffff !important;
    font-weight: 600 !important;
}

.grk-flight-status-wrapper .grk-nav-btn.grk-active i,
.grk-flight-status-wrapper .grk-nav-btn.grk-active [class*="fa-"] {
    color: #ffffff !important;
}

/* ============================================
   Tables Container - No Gap with Nav
   ============================================ */
.grk-flight-status-wrapper .grk-tables-wrapper {
    margin: 0 !important;
    padding: 0 !important;
    margin-top: -1px !important;
}

/* ============================================
   Flight Table - Clean Modern Design
   ============================================ */
.grk-flight-status-wrapper table.grk-flight-table {
    width: 100% !important;
    border-collapse: collapse !important;
    border-spacing: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    background-color: #ffffff !important;
    border: none !important;
}

/* Header Row - Connects to Nav Bar */
.grk-flight-status-wrapper table.grk-flight-table thead {
    background-color: #000000 !important;
}

.grk-flight-status-wrapper table.grk-flight-table thead tr {
    background-color: #000000 !important;
}

.grk-flight-status-wrapper table.grk-flight-table thead th {
    background-color: #000000 !important;
    color: #ffffff !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    padding: 14px 15px !important;
    text-align: left !important;
    border: none !important;
    vertical-align: middle !important;
}

/* Data Rows - Light Grey Borders */
.grk-flight-status-wrapper table.grk-flight-table tbody {
    background-color: #ffffff !important;
}

.grk-flight-status-wrapper table.grk-flight-table tbody tr {
    background-color: #ffffff !important;
    border-bottom: 1px solid #e5e5e5 !important;
}

.grk-flight-status-wrapper table.grk-flight-table tbody tr:nth-child(even) {
    background-color: #fafafa !important;
}

.grk-flight-status-wrapper table.grk-flight-table tbody tr:last-child {
    border-bottom: none !important;
}

.grk-flight-status-wrapper table.grk-flight-table tbody tr:hover {
    background-color: #f0f0f0 !important;
}

/* Focus state for keyboard navigation */
.grk-flight-status-wrapper table.grk-flight-table tbody tr:focus {
    outline: 3px solid #0055a4 !important;
    outline-offset: -3px !important;
    background-color: #e8f4fc !important;
}

.grk-flight-status-wrapper table.grk-flight-table tbody tr:focus-visible {
    outline: 3px solid #0055a4 !important;
    outline-offset: -3px !important;
    background-color: #e8f4fc !important;
}

/* Table Cells - Black Text */
.grk-flight-status-wrapper table.grk-flight-table tbody td {
    color: #000000 !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    padding: 16px 15px !important;
    text-align: left !important;
    vertical-align: middle !important;
    border: none !important;
    line-height: 1.4 !important;
}

.grk-flight-status-wrapper table.grk-flight-table tbody td * {
    color: #000000 !important;
}

/* Airline Cell */
.grk-flight-status-wrapper .grk-airline-cell {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 12px !important;
}

.grk-flight-status-wrapper .grk-airline-logo {
    width: 32px !important;
    height: auto !important;
    max-height: 24px !important;
    object-fit: contain !important;
    flex-shrink: 0 !important;
}

.grk-flight-status-wrapper .grk-airline-name {
    color: #000000 !important;
    font-weight: 500 !important;
}

/* Status */
.grk-flight-status-wrapper .grk-status {
    color: #000000 !important;
    font-weight: 500 !important;
}

/* Column Alignment */
.grk-flight-status-wrapper .grk-col-gate,
.grk-flight-status-wrapper .grk-col-claim,
.grk-flight-status-wrapper table.grk-flight-table thead th.grk-col-gate,
.grk-flight-status-wrapper table.grk-flight-table thead th.grk-col-claim,
.grk-flight-status-wrapper table.grk-flight-table tbody td.grk-col-gate,
.grk-flight-status-wrapper table.grk-flight-table tbody td.grk-col-claim {
    text-align: center !important;
}

/* No Data */
.grk-flight-status-wrapper .grk-no-flights {
    text-align: center !important;
    padding: 40px 20px !important;
    color: #666666 !important;
    font-style: italic !important;
}

/* ============================================
   Mobile Responsive
   ============================================ */
@media screen and (max-width: 768px) {
    .grk-flight-status-wrapper .grk-nav-wrapper {
        flex-direction: column !important;
        padding: 10px !important;
        gap: 8px !important;
    }
    
    .grk-flight-status-wrapper .grk-nav-group {
        width: 100% !important;
    }
    
    .grk-flight-status-wrapper .grk-nav-btn {
        flex: 1 !important;
        padding: 14px 12px !important;
        font-size: 14px !important;
    }
    
    .grk-flight-status-wrapper .grk-tables-wrapper {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    .grk-flight-status-wrapper table.grk-flight-table {
        min-width: 600px !important;
    }
    
    .grk-flight-status-wrapper table.grk-flight-table thead th,
    .grk-flight-status-wrapper table.grk-flight-table tbody td {
        padding: 12px 10px !important;
        font-size: 13px !important;
    }
    
    .grk-flight-status-wrapper .grk-airline-logo {
        width: 24px !important;
    }
}

@media screen and (max-width: 480px) {
    .grk-flight-status-wrapper .grk-nav-btn {
        padding: 12px 10px !important;
        font-size: 13px !important;
        gap: 6px !important;
    }
    
    .grk-flight-status-wrapper .grk-nav-btn i {
        font-size: 12px !important;
    }
}

/* ============================================
   High Contrast & Reduced Motion
   ============================================ */
@media (prefers-contrast: high) {
    .grk-flight-status-wrapper table.grk-flight-table tbody tr {
        border-bottom: 2px solid #000000 !important;
    }
    
    .grk-flight-status-wrapper .grk-nav-btn {
        border: 2px solid #000000 !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .grk-flight-status-wrapper .grk-nav-btn {
        transition: none !important;
    }
}

/* ============================================
   Print
   ============================================ */
@media print {
    .grk-flight-status-wrapper .grk-search-box,
    .grk-flight-status-wrapper .grk-nav-wrapper {
        display: none !important;
    }
    
    .grk-flight-status-wrapper {
        box-shadow: none !important;
        border: 1px solid #000 !important;
    }
    
    .grk-flight-status-wrapper table.grk-flight-table thead th {
        background-color: #000 !important;
        color: #fff !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}

/* ============================================
   Search Form Variant (if used separately)
   ============================================ */
.grk-flight-search-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

.grk-flight-search-wrapper .grk-search-form {
    background-color: #f5f5f5 !important;
    padding: 20px !important;
    margin-bottom: 0 !important;
    border-radius: 8px 8px 0 0 !important;
}

.grk-flight-search-wrapper .grk-btn {
    padding: 12px 20px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    border: none !important;
    border-radius: 4px !important;
    background-color: #000000 !important;
    color: #ffffff !important;
    cursor: pointer !important;
    min-height: 44px !important;
}

.grk-flight-search-wrapper .grk-btn:hover {
    background-color: #333333 !important;
}

.grk-flight-search-wrapper .grk-btn:focus {
    outline: 3px solid #0055a4 !important;
    outline-offset: 2px !important;
}
