/* XP Calculator Styles */

.xp-calculator-container {
    max-width: 100%;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 12px;
    padding-bottom: 40px;
    overflow: hidden;
}


/* Header */

.xp-calculator-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #046BD2;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.1);
}

.xp-back-button,
.xp-reset-button {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 16px;
    font-weight: 400;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    transition: opacity 0.2s;
}

.xp-back-button:active,
.xp-reset-button:active {
    opacity: 0.6;
}

.xp-back-button svg {
    color: #ffffff;
}

.xp-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.xp-header-title {
    font-size: 17px;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    flex: 1;
}

.xp-language-flags {
    display: flex;
    align-items: center;
    gap: 6px;
}

.xp-flag-btn {
    background: #ADD8E6;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    padding: 4px 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
    min-width: 50px;
    height: 28px;
}

.xp-flag-btn:hover {
    border-color: rgba(255, 255, 255, 0.5);
    background: #87CEEB;
}

.xp-flag-btn.xp-flag-active {
    border-color: rgba(255, 255, 255, 0.5);
    background: #ff0000;
}

.xp-flag-btn.xp-flag-active:hover {
    background: #cc0000;
}

.xp-flag-btn .flag-icon {
    font-size: 16px;
    line-height: 1;
}

.xp-flag-btn .flag-text {
    font-size: 12px;
    font-weight: 600;
    color: #ffffff;
    line-height: 1;
}


/* Main Content */

.xp-calculator-main {
    padding: 24px 20px;
}


/* Section */

.xp-section {
    margin-bottom: 32px;
}

.xp-section-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}


/* Route Input */

.xp-input-wrapper {
    position: relative;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #D1D5DB;
    padding: 16px;
    display: flex;
    align-items: center;
}

.xp-route-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #1a1a1a !important;
    font-size: 17px;
    font-weight: 400;
    outline: none;
    padding: 0;
    font-family: inherit;
}

.xp-route-input:focus {
    color: #1a1a1a !important;
}

.xp-route-input::placeholder {
    color: #6B7280;
}

.xp-input-icon {
    color: #046BD2;
    margin-left: 12px;
    display: flex;
    align-items: center;
}

.xp-helper-text {
    font-size: 13px;
    color: #6B7280;
    margin-top: 8px;
    margin-bottom: 0;
    padding-left: 4px;
}


/* Airport Suggestions */

.xp-suggestions-container {
    position: relative;
    margin-top: 8px;
    z-index: 1000;
}

.xp-suggestions-list {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #D1D5DB;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.xp-suggestion-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #E5E7EB;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.xp-suggestion-item:last-child {
    border-bottom: none;
}

.xp-suggestion-item:hover,
.xp-suggestion-item.xp-suggestion-active {
    background-color: #F3F4F6;
}

.xp-suggestion-iata {
    font-size: 16px;
    font-weight: 600;
    color: #046BD2;
    min-width: 50px;
}

.xp-suggestion-name {
    font-size: 15px;
    color: #1a1a1a;
    flex: 1;
}

.xp-suggestion-city {
    font-size: 13px;
    color: #6B7280;
}


/* Checkbox */

.xp-checkbox-wrapper {
    margin-top: 12px;
    position: relative;
}

.xp-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.xp-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #046BD2;
    margin: 0;
}

.xp-checkbox-text {
    font-size: 15px;
    color: #1a1a1a;
    font-weight: 400;
    user-select: none;
}


/* Tooltip */

.xp-tooltip {
    position: absolute;
    bottom: 100%;
    left: 0;
    margin-bottom: 8px;
    background: #ffffff;
    color: #1a1a1a;
    font-size: 13px;
    padding: 10px 14px;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 1000;
    border: 1px solid #D1D5DB;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-width: 280px;
    white-space: normal;
    line-height: 1.4;
}

.xp-checkbox-wrapper:hover .xp-tooltip {
    opacity: 1;
    visibility: visible;
}


/* Tooltip arrow */

.xp-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 20px;
    border: 6px solid transparent;
    border-top-color: #ffffff;
}


/* Total XP Cards */

.xp-total-section {
    margin-bottom: 32px;
}

.xp-total-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.xp-total-card {
    background: #ffffff;
    border: 1px solid #D1D5DB;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s;
}

.xp-total-card.selected {
    background: #046BD2;
    border-color: #046BD2;
}

.xp-total-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.xp-total-left {
    flex: 1;
}

.xp-total-label {
    font-size: 11px;
    font-weight: 600;
    color: #6B7280;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.xp-total-card.selected .xp-total-label {
    color: #ffffff;
}

.xp-total-value {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.xp-total-value span:first-child {
    font-size: 32px;
    font-weight: 700;
    color: #046BD2;
    line-height: 1;
}

.xp-total-card.selected .xp-total-value span:first-child {
    color: #ffffff;
}

.xp-unit {
    font-size: 16px;
    font-weight: 600;
    color: #6B7280;
}

.xp-total-card.selected .xp-unit {
    color: #ffffff;
}

.xp-total-icon {
    color: #D1D5DB;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    font-size: 24px;
}

.xp-total-card.selected .xp-total-icon {
    color: #ffffff;
}


/* Responsive adjustments for Total XP Grid */

@media (max-width: 480px) {
    .xp-total-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .xp-total-value span:first-child {
        font-size: 32px;
    }
}


/* Details Section */

.xp-details-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.xp-detail-item {
    background: #ffffff;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid #D1D5DB;
    overflow: hidden;
    min-width: 0;
}

.xp-detail-icon {
    color: #046BD2;
    flex-shrink: 0;
    font-size: 20px;
    display: flex;
    align-items: center;
}

.xp-detail-content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.xp-detail-route {
    font-size: 16px;
    font-weight: 500;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.xp-detail-info {
    font-size: 13px;
    color: #6B7280;
}

.xp-detail-xp {
    font-size: 16px;
    font-weight: 600;
    color: #046BD2;
}

.xp-detail-xp-values {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    flex-shrink: 0;
    min-width: 0;
}

.xp-detail-xp-column {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
}

.xp-detail-xp-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    width: 100%;
    min-width: 0;
    overflow: hidden;
}

.xp-detail-xp-label {
    color: #1a1a1a;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.xp-detail-xp-value {
    color: #046BD2;
    font-weight: 600;
    min-width: 30px;
    text-align: right;
    margin-left: auto;
}


/* Calculate Button */

.xp-calculate-button {
    width: 100%;
    background: #046BD2;
    border: none;
    border-radius: 14px;
    color: #ffffff;
    font-size: 17px;
    font-weight: 600;
    padding: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
    margin-bottom: 16px;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
    font-family: inherit;
    box-shadow: 0 2px 10px rgba(0, 122, 255, 0.3);
}

.xp-calculate-button:active {
    opacity: 0.8;
    transform: scale(0.98);
}

.xp-calculate-button i {
    color: #ffffff;
    font-size: 18px;
}


/* Debug Section */

.xp-debug-section {
    margin-bottom: 32px;
}

.xp-debug-output {
    display: flex;
    flex-direction: column;
    gap: 12px;
}


/* Disclaimer */

.xp-disclaimer {
    font-size: 12px;
    color: #6B7280;
    text-align: center;
    margin: 0;
    padding: 0 20px;
    line-height: 1.5;
}


/* Responsive adjustments */

@media (min-width: 768px) {
    .xp-calculator-container {
        max-width: 100%;
        margin: 0;
    }
}

@media (max-width: 480px) {
    .xp-header-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .xp-header-title {
        font-size: 16px;
    }
    .xp-language-flags {
        align-self: flex-start;
    }
    .xp-flag-btn {
        min-width: 45px;
        height: 26px;
        padding: 3px 6px;
        gap: 4px;
    }
    .xp-flag-btn .flag-icon {
        font-size: 14px;
    }
    .xp-flag-btn .flag-text {
        font-size: 11px;
    }
    /* Detail items mobile layout */
    .xp-detail-item {
        flex-wrap: wrap;
        align-items: flex-start;
    }
    .xp-detail-icon {
        align-self: flex-start;
        margin-top: 2px;
        flex-shrink: 0;
        width: 32px;
        /* Fixed width for icon */
    }
    .xp-detail-content {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 4px;
        flex-basis: calc(100% - 44px);
        /* 100% minus icon width (32px) + gap (12px) */
        max-width: calc(100% - 44px);
    }
    .xp-detail-xp-values {
        flex: 0 0 100%;
        width: calc(100% - 44px);
        margin-top: 12px;
        margin-left: 44px;
        /* Icon width (32px) + gap (12px) to align with content */
    }
}