/* ========================================
   Country Transition — Flight Animation
   ======================================== */

/* ── Overlay container ── */
#kavo-country-transition {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: all;
}

/* ── Backdrop ── */
.kct__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 20, 30, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.4s ease;
}

#kavo-country-transition.kct--in .kct__backdrop {
    opacity: 1;
}

/* ── Card ── */
.kct__card {
    position: relative;
    z-index: 1;
    background: #ffffff;
    border-radius: 28px;
    padding: 40px 44px 36px;
    text-align: center;
    width: min(400px, calc(100vw - 40px));
    box-shadow:
        0 32px 80px rgba(0, 0, 0, 0.22),
        0 4px 16px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: scale(0.88) translateY(24px);
    transition:
        opacity 0.4s ease 0.1s,
        transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s;
}

#kavo-country-transition.kct--in .kct__card {
    opacity: 1;
    transform: scale(1) translateY(0);
}

/* ── Heading ── */
.kct__heading {
    font-size: 1rem;
    color: #6B7280;
    font-weight: 500;
    margin: 0 0 12px;
    letter-spacing: 0.01em;
}

/* ── Destination ── */
.kct__dest {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 40px;
}

.kct__dest-name {
    font-size: 2.25rem;
    font-weight: 800;
    color: #111827;
    letter-spacing: -0.02em;
    line-height: 1.1;
    background: linear-gradient(135deg, #111827 0%, #374151 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ── Flight row ── */
.kct__flight-row {
    display: flex;
    align-items: center;
    gap: 0;
    height: 64px;
}

/* ── Pins ── */
.kct__pin {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 24px;
}

.kct__pin-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #E5E7EB;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

.kct__pin-dot--to {
    background: #0F766E;
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.1);
    animation: kct-pulse-dot 2s infinite;
}

@keyframes kct-pulse-dot {
    0% { box-shadow: 0 0 0 0 rgba(15, 118, 110, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(15, 118, 110, 0); }
    100% { box-shadow: 0 0 0 0 rgba(15, 118, 110, 0); }
}

/* ── Track (dashed line + plane) ── */
.kct__track {
    flex: 1;
    position: relative;
    height: 24px;
    margin: 0 6px;
    display: flex;
    align-items: center;
}

.kct__track-line {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 0;
    right: 0;
    height: 2px;
    background-image: repeating-linear-gradient(
        to right,
        #E5E7EB 0px,
        #E5E7EB 6px,
        transparent 6px,
        transparent 12px
    );
    background-size: 12px 2px;
    animation: kct-dash-move 0.5s linear infinite;
}

@keyframes kct-dash-move {
    from { background-position: 0 0; }
    to   { background-position: -12px 0; }
}

/* ── Plane ── */
.kct__plane {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    padding: 0 8px;
    z-index: 10;
    
    /* Starting point for animation */
    left: 0;
    animation: kct-fly 2s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.55s both;
}

.kct__plane-svg-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    transform: rotate(90deg); /* Make the plane point to the right */
    filter: drop-shadow(0 4px 6px rgba(15, 118, 110, 0.2));
}

.kct__plane-svg-wrapper svg {
    width: 100%;
    height: 100%;
    display: block;
}

@keyframes kct-fly {
    0%   { left: -16px; opacity: 0; transform: translateY(-50%) scale(0.6); }
    10%  { opacity: 1;  transform: translateY(-50%) scale(1); }
    85%  { opacity: 1; }
    100% { left: calc(100% - 16px); opacity: 0; transform: translateY(-50%) scale(0.8); }
}

/* ── Welcome Toast & Backdrop ── */
.kct__toast-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    opacity: 0;
    transition: opacity 0.6s cubic-bezier(0.32, 0.72, 0, 1);
    pointer-events: all;
}

.kct__toast-backdrop--in {
    opacity: 1;
}

.kct__toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -40%) scale(0.9);
    z-index: 9999;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 28px;
    padding: 32px 24px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
    width: calc(100vw - 40px);
    max-width: 420px;
    box-shadow:
        0 30px 60px rgba(0, 0, 0, 0.12),
        0 12px 24px rgba(0, 0, 0, 0.08),
        0 0 0 1px rgba(0, 0, 0, 0.02);
    opacity: 0;
    transition:
        opacity 0.4s cubic-bezier(0.2, 0, 0, 1),
        transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: all;
}

.kct__toast--in {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.kct__toast--out {
    opacity: 0;
    transform: translate(-50%, -45%) scale(0.92);
    transition:
        opacity 0.3s ease-in,
        transform 0.4s cubic-bezier(0.32, 0, 0.67, 0);
}

.kct__toast-header-icon {
    position: absolute;
    top: -24px;
    left: 50%;
    transform: translateX(-50%);
    width: 48px;
    height: 48px;
    background: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 16px rgba(15, 118, 110, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.8);
    z-index: 2;
}

.kct__smiley {
    width: 28px;
    height: 28px;
    color: #0F766E;
    animation: kct-smiley-bounce 2s cubic-bezier(0.28, 0.84, 0.42, 1) infinite;
    transform-origin: bottom center;
}

@keyframes kct-smiley-bounce {
    0%, 100% { transform: scale(1) translateY(0); }
    10% { transform: scale(1.1, 0.9) translateY(0); }
    30% { transform: scale(0.9, 1.1) translateY(-6px); }
    50% { transform: scale(1.05, 0.95) translateY(0); }
    60% { transform: scale(1) translateY(0); }
}

.kct__toast-content {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
}

.kct__toast-icon {
    font-size: 2.5rem;
    line-height: 1;
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    background: #F0FDFA;
    color: #0F766E;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kct__toast-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
}

.kct__toast-title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
}

.kct__toast-text {
    margin: 0;
    font-size: 0.9375rem;
    color: #4B5563;
    line-height: 1.5;
}

.kct__toast-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    color: #9CA3AF;
    font-size: 1.5rem;
    line-height: 1;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
    transition: all 0.2s;
}

.kct__toast-close:hover {
    background: #F3F4F6;
    color: #111827;
}

/* ── Desktop ── */
@media (min-width: 768px) {
    .kct__card {
        padding: 48px 60px 44px;
    }
    .kct__toast {
        padding: 32px;
        gap: 20px;
    }
    .kct__toast-close {
        top: 20px;
        right: 20px;
    }
}
