/* LTFM Weather Terminal - Widget Styles */

/* ===== BASE CONTAINER ===== */

.ltfm-widget-container {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: #fff;
    padding: 20px;
    border-radius: 8px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.ltfm-widget-title {
    margin-bottom: 15px;
    border-bottom: 2px solid rgba(135, 206, 235, 0.5);
    padding-bottom: 10px;
}

.ltfm-widget-title h3 {
    margin: 0;
    font-size: 18px;
    color: #87ceeb;
    font-weight: 600;
}

/* ===== DATE TABS ===== */

.ltfm-records-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(135, 206, 235, 0.3);
    flex-wrap: wrap;
}

.ltfm-records-tab-btn {
    padding: 6px 12px;
    background: rgba(135, 206, 235, 0.1);
    border: 1px solid rgba(135, 206, 235, 0.3);
    border-radius: 3px 3px 0 0;
    color: #87ceeb;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: none;
    line-height: 1.2;
}

.ltfm-records-tab-btn:hover {
    background: rgba(135, 206, 235, 0.2);
    color: #b0e0e6;
}

.ltfm-records-tab-btn.ltfm-records-tab-active {
    background: rgba(135, 206, 235, 0.3);
    border-color: #87ceeb;
    color: #b0e0e6;
    border-bottom: 2px solid #87ceeb;
}

/* ===== ROW 1: METAR 20% | AIRPORT STATION 30% | ISTANBUL AIRPORT 50% ===== */

.ltfm-weather-container {
    display: grid;
    grid-template-columns: 0.2fr 0.3fr 0.5fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* ===== SHARED BOX STYLES ===== */

.ltfm-weather-box,
.ltfm-station-box {
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #87ceeb;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.ltfm-box-header {
    border-bottom: 1px solid rgba(135, 206, 235, 0.3);
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.ltfm-box-header h4 {
    margin: 0;
    font-size: 14px;
    color: #87ceeb;
    font-weight: 600;
}

/* Records list */

.ltfm-records-list {
    max-height: 400px;
    overflow-y: auto;
    flex: 1;
}

/* Record rows */

.ltfm-record-item {
    display: flex;
    align-items: flex-start;
    font-size: 12px;
    margin-bottom: 2px;
    flex-wrap: wrap;
    gap: 2px;
}

.ltfm-record-item:last-child {
    margin-bottom: 0;
}

.ltfm-record-time {
    color: #87ceeb;
    font-weight: 600;
    font-size: 11px;
    flex-shrink: 0;
}

.ltfm-record-data {
    color: #e0e0e0;
    word-break: break-word;
    line-height: 1.4;
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
}

.ltfm-col {
    display: inline-block;
    min-width: 35px;
    font-size: 11px;
    padding: 1px 2px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
}

.ltfm-record-data strong {
    color: #fff;
    font-weight: 600;
}

/* ===== ROW 2: ISTANBUL STATIONS (FULL WIDTH, FIXED COLUMN HEADER) ===== */

.ltfm-istanbul-stations-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* One scroll area: the header stays on top, rows scroll underneath */
.ltfm-station-scroll {
    --ltfm-slot-width: 215px;
    max-height: 400px;
    overflow: auto;
    border-radius: 4px;
}

/* The station list grows with its content; the scroll area handles scrolling */
.ltfm-records-list.ltfm-station-records-list {
    max-height: none;
    overflow: visible;
    flex: none;
}

/* Fixed header: sticks to the top of the scroll area */
.ltfm-station-column-header {
    position: sticky;
    top: 0;
    z-index: 2;
    width: max-content;
    min-width: 100%;
    box-sizing: border-box;
    background: #203f74;
    padding-bottom: 6px;
    margin-bottom: 6px;
    border-bottom: 1px solid rgba(135, 206, 235, 0.3);
}

/* Header row and data rows share the same width, so columns line up */
.ltfm-station-column-header .ltfm-record-item,
.ltfm-records-list.ltfm-station-records-list .ltfm-record-item {
    flex-wrap: nowrap;
    width: max-content;
    min-width: 100%;
    align-items: center;
    margin-bottom: 4px;
}

.ltfm-station-row {
    flex-wrap: nowrap;
    align-items: center;
}

/* Fixed time column (header spacer and data rows) */
.ltfm-station-time {
    flex: 0 0 52px;
    width: 52px;
}

/* Fixed update column (header spacer and data rows) */
.ltfm-station-update {
    flex: 0 0 62px;
    width: 62px;
    color: #87ceeb;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

/* Station slots and header cells: same fixed width */
.ltfm-station-scroll .ltfm-station-slot,
.ltfm-station-scroll .ltfm-station-header-cell {
    flex: 0 0 var(--ltfm-slot-width);
    width: var(--ltfm-slot-width);
    min-width: var(--ltfm-slot-width);
    max-width: var(--ltfm-slot-width);
    box-sizing: border-box;
    margin-right: 6px;
    padding: 3px 6px;
    border-radius: 3px;
    white-space: nowrap;
}

.ltfm-station-scroll .ltfm-station-slot {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: rgba(0, 0, 0, 0.2);
}

.ltfm-station-scroll .ltfm-station-header-cell {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    background: rgba(135, 206, 235, 0.12);
    color: #87ceeb;
    font-size: 11px;
    font-weight: 600;
}

.ltfm-station-name {
    color: #87ceeb;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
}

.ltfm-station-slot .ltfm-col {
    min-width: 0;
    padding: 0;
    background: none;
}

/* ===== ROW 3: ISTANBUL AIRPORT WEST | ISTANBUL AIRPORT SOUTH ===== */

.ltfm-airport-west-south-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* ===== LOADING & ERROR ===== */

.ltfm-loading {
    text-align: center;
    padding: 20px;
    color: #87ceeb;
    font-size: 14px;
    display: none !important;
}

.ltfm-error {
    background: rgba(220, 53, 69, 0.2);
    border: 1px solid rgba(220, 53, 69, 0.5);
    color: #ff6b6b;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.ltfm-error p {
    margin: 0;
    font-size: 13px;
}

.ltfm-no-data {
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 14px;
}

/* ===== FOOTER ===== */

.ltfm-footer-info {
    display: flex;
    justify-content: center;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 12px;
    color: #b0e0e6;
    flex-wrap: wrap;
    gap: 10px;
}

.ltfm-tier-info {
    display: inline-block;
}

.ltfm-last-update {
    margin-left: 4px;
    color: #b0e0e6;
}

.ltfm-more-link {
    color: #87ceeb;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    padding: 6px 12px;
    border-radius: 3px;
    background: rgba(135, 206, 235, 0.1);
    display: inline-block;
}

.ltfm-more-link:hover {
    color: #fff;
    background: rgba(135, 206, 235, 0.2);
}

/* ===== SCROLLBAR ===== */

.ltfm-records-list::-webkit-scrollbar {
    width: 6px;
}

.ltfm-records-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.ltfm-records-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.ltfm-records-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ===== RESPONSIVE: TABLET (1024px and below) ===== */

@media (max-width: 1024px) {
    .ltfm-weather-container {
        grid-template-columns: 0.2fr 0.3fr 0.5fr;
        gap: 15px;
    }

    .ltfm-widget-container {
        padding: 15px;
    }

    .ltfm-record-item {
        font-size: 11px;
        margin-bottom: 1px;
    }

    .ltfm-col {
        min-width: 35px;
        font-size: 10px;
        padding: 1px 2px;
    }

    .ltfm-records-list {
        max-height: 350px;
    }

    .ltfm-airport-west-south-container {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }

    .ltfm-istanbul-stations-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .ltfm-station-scroll {
        max-height: 350px;
    }
}

/* ===== RESPONSIVE: MOBILE (768px and below, one column) ===== */

@media (max-width: 768px) {
    .ltfm-weather-container,
    .ltfm-airport-west-south-container,
    .ltfm-istanbul-stations-container {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }

    .ltfm-widget-container {
        padding: 15px;
    }

    .ltfm-widget-title h3 {
        font-size: 16px;
    }

    .ltfm-record-item {
        font-size: 11px;
        margin-bottom: 1px;
    }

    .ltfm-col {
        min-width: 35px;
        font-size: 10px;
        padding: 1px 2px;
    }

    .ltfm-records-list {
        max-height: 300px;
    }

    .ltfm-records-tab-btn {
        padding: 5px 10px;
        font-size: 10px;
    }

    .ltfm-footer-info {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }

    .ltfm-station-scroll {
        --ltfm-slot-width: 200px;
        max-height: 300px;
    }
}

/* ===== RESPONSIVE: SMALL MOBILE (480px and below) ===== */

@media (max-width: 480px) {
    .ltfm-weather-container,
    .ltfm-airport-west-south-container,
    .ltfm-istanbul-stations-container {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }

    .ltfm-widget-container {
        padding: 10px;
        font-size: 11px;
    }

    .ltfm-widget-title h3 {
        font-size: 14px;
    }

    .ltfm-record-item {
        font-size: 9px;
        padding: 5px 6px;
    }

    .ltfm-col {
        font-size: 9px;
        padding: 1px 2px;
        min-width: 30px;
    }

    .ltfm-records-list {
        max-height: 250px;
    }

    .ltfm-records-tab-btn {
        padding: 4px 8px;
        font-size: 9px;
    }

    .ltfm-footer-info {
        font-size: 10px;
        padding-top: 10px;
    }

    .ltfm-box-header h4 {
        font-size: 12px;
    }

    .ltfm-station-scroll {
        --ltfm-slot-width: 180px;
        max-height: 250px;
    }
}

/* ===== EXTERNAL LINKS WIDGET ===== */

.ltfm-external-links-widget {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: #fff;
    padding: 20px;
    border-radius: 8px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.ltfm-links-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.ltfm-links-column {
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ltfm-links-title {
    border-bottom: 2px solid rgba(135, 206, 235, 0.5);
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.ltfm-links-title h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #87ceeb;
}

.ltfm-links-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ltfm-links-list-horizontal {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
}

.ltfm-links-list li {
    margin: 0;
    padding: 0;
}

.ltfm-links-list-horizontal li {
    flex: 0 1 auto;
}

.ltfm-links-list a {
    display: inline-block;
    color: #87ceeb;
    text-decoration: none;
    font-size: 11px;
    padding: 6px 8px;
    border-radius: 3px;
    background: rgba(135, 206, 235, 0.1);
    transition: all 0.3s ease;
    word-break: break-word;
    white-space: nowrap;
}

.ltfm-links-list a:hover {
    background: rgba(135, 206, 235, 0.2);
    color: #b0e0e6;
    text-decoration: underline;
}

.ltfm-links-empty {
    font-size: 11px;
    color: #999;
    margin: 0;
}

/* Membership prompts */

.ltfm-links-prompt {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 4px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.ltfm-links-prompt .ltfm-prompt-text {
    color: #FFD700;
    font-size: 11px;
    flex: 1;
}

.ltfm-links-prompt .ltfm-signin-link,
.ltfm-links-prompt .ltfm-upgrade-link {
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.3s ease;
    display: inline-block;
}

.ltfm-links-prompt .ltfm-signin-link {
    background: rgba(135, 206, 235, 0.2);
    border: 1px solid #87ceeb;
    color: #87ceeb;
}

.ltfm-links-prompt .ltfm-signin-link:hover {
    background: rgba(135, 206, 235, 0.3);
    color: #b0e0e6;
}

.ltfm-links-prompt .ltfm-upgrade-link {
    background: rgba(255, 215, 0, 0.2);
    border: 1px solid #FFD700;
    color: #FFD700;
}

.ltfm-links-prompt .ltfm-upgrade-link:hover {
    background: rgba(255, 215, 0, 0.3);
    color: #FFA500;
    border-color: #FFA500;
}

/* Polymarket section */

.ltfm-polymarket-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    width: 100%;
}

.ltfm-polymarket-section {
    background: rgba(0, 0, 0, 0.3);
    padding: 12px;
    border-radius: 4px;
    border-left: 3px solid #87ceeb;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.ltfm-polymarket-label {
    font-size: 12px;
    font-weight: 600;
    color: #87ceeb;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(135, 206, 235, 0.3);
    flex-shrink: 0;
}

.ltfm-polymarket-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    list-style: none;
    margin: 0;
    padding: 0;
}

.ltfm-polymarket-list li {
    margin: 0;
    padding: 0;
}

.ltfm-polymarket-list a {
    display: block;
    color: #87ceeb;
    text-decoration: none;
    font-size: 11px;
    padding: 6px 8px;
    border-radius: 3px;
    background: rgba(135, 206, 235, 0.1);
    transition: all 0.3s ease;
    text-align: center;
    border: 1px solid rgba(135, 206, 235, 0.2);
}

.ltfm-polymarket-list a:hover {
    background: rgba(135, 206, 235, 0.2);
    color: #b0e0e6;
    border-color: rgba(135, 206, 235, 0.4);
    text-decoration: none;
}

/* External links responsive */

@media (min-width: 769px) and (max-width: 1024px) {
    .ltfm-links-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px;
    }

    .ltfm-links-column {
        padding: 12px;
    }

    .ltfm-links-title h3 {
        font-size: 13px;
    }

    .ltfm-links-list a {
        font-size: 10px;
        padding: 5px 6px;
    }

    .ltfm-links-list-horizontal {
        gap: 4px;
    }

    .ltfm-links-list-horizontal a {
        padding: 4px 6px;
        font-size: 9px;
    }

    .ltfm-polymarket-container {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .ltfm-polymarket-section {
        padding: 10px;
    }

    .ltfm-polymarket-label {
        font-size: 11px;
        margin-bottom: 8px;
        padding-bottom: 6px;
    }

    .ltfm-polymarket-list a {
        font-size: 10px;
        padding: 5px 6px;
    }
}

@media (max-width: 768px) {
    .ltfm-external-links-widget {
        padding: 15px;
    }

    .ltfm-links-grid {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }

    .ltfm-links-column {
        padding: 12px;
        gap: 10px;
    }

    .ltfm-links-title h3 {
        font-size: 12px;
    }

    .ltfm-links-list a {
        font-size: 10px;
        padding: 5px 6px;
    }

    .ltfm-links-list-horizontal {
        gap: 4px;
    }

    .ltfm-links-list-horizontal a {
        padding: 4px 6px;
        font-size: 9px;
        white-space: normal;
    }

    .ltfm-links-prompt {
        padding: 10px;
        gap: 6px;
    }

    .ltfm-links-prompt .ltfm-prompt-text {
        font-size: 10px;
    }

    .ltfm-links-prompt .ltfm-signin-link,
    .ltfm-links-prompt .ltfm-upgrade-link {
        padding: 4px 8px;
        font-size: 9px;
    }

    .ltfm-polymarket-container {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .ltfm-polymarket-section {
        padding: 10px;
    }

    .ltfm-polymarket-label {
        font-size: 11px;
        margin-bottom: 8px;
        padding-bottom: 6px;
    }

    .ltfm-polymarket-list a {
        font-size: 10px;
        padding: 5px 6px;
    }
}

@media (max-width: 480px) {
    .ltfm-external-links-widget {
        padding: 10px;
    }

    .ltfm-links-grid {
        gap: 10px;
    }

    .ltfm-links-column {
        padding: 10px;
        gap: 8px;
    }

    .ltfm-links-title h3 {
        font-size: 11px;
        margin-bottom: 5px;
    }

    .ltfm-links-list {
        gap: 4px;
    }

    .ltfm-links-list a {
        font-size: 9px;
        padding: 4px 5px;
    }

    .ltfm-links-list-horizontal {
        gap: 3px;
    }

    .ltfm-links-list-horizontal a {
        padding: 3px 5px;
        font-size: 8px;
        white-space: normal;
    }

    .ltfm-links-prompt {
        flex-direction: column;
        text-align: center;
        padding: 8px;
    }

    .ltfm-links-prompt .ltfm-signin-link,
    .ltfm-links-prompt .ltfm-upgrade-link {
        width: 100%;
    }

    .ltfm-polymarket-container {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .ltfm-polymarket-section {
        padding: 8px;
    }

    .ltfm-polymarket-label {
        font-size: 10px;
        margin-bottom: 6px;
        padding-bottom: 5px;
    }

    .ltfm-polymarket-list a {
        font-size: 9px;
        padding: 4px 5px;
    }
}