:root {
    /* Main background: Airy, modern light gray-blue */
    --bg: #f8fafc; 
    
    /* Card background: Pure white */
    --card: #ffffff; 
    
    /* Primary Aero Blue (#3f6ac9) */
    --mint: #3f6ac9; 
    
    /* Deep Navy for secondary depth and "Confirm" action */
    --violet: #1e293b; 
    
    /* Text: High contrast charcoal */
    --text-high: #0f172a; 
    
    /* Muted text: Slate gray */
    --text-low: #64748b; 
    
    /* Subtle blue-tinted border */
    --border: #e2e8f0; 
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background-color: var(--bg);
    color: var(--text-high);
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.swap-overlay {
    min-height: 100vh;
    /* Soft blue gradient instead of dark violet radial */
    background: radial-gradient(circle at 50% 0%, rgba(63, 106, 201, 0.05), transparent 50%);
}

/* --- HEADER --- */
.swap-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 5%;
    background: white;
    border-bottom: 1px solid var(--border);
}

.btn-back { color: var(--text-low); text-decoration: none; font-size: 0.9rem; font-weight: 700; transition: 0.3s; }
.btn-back:hover { color: var(--mint); }

.match-score { display: flex; align-items: center; gap: 15px; }
.match-score span { font-weight: 800; font-size: 0.85rem; color: var(--text-high); text-transform: uppercase; letter-spacing: 1px; }

.score-circle { position: relative; width: 50px; height: 50px; }
.circular-chart { display: block; margin: 0 auto; max-width: 100%; max-height: 100%; }
.circle-bg { fill: none; stroke: #f1f5f9; stroke-width: 3; }
.circle { fill: none; stroke: var(--mint); stroke-width: 3; stroke-linecap: round; transition: 0.3s; }
.percentage { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 0.75rem; font-weight: 800; color: var(--mint); }

.header-actions { display: flex; gap: 20px; color: var(--text-low); }

/* --- COMPARISON WORKSPACE --- */
.swap-workspace {
    max-width: 1100px;
    margin: 60px auto;
    padding: 0 5%;
}

.comparison-grid {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 50px;
}

.ticket-side { flex: 1; }
.side-label { text-align: center; font-size: 0.75rem; font-weight: 800; color: var(--text-low); text-transform: uppercase; margin-bottom: 20px; letter-spacing: 1px; }

.swap-ticket-box {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 28px;
    padding: 30px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.03);
}

/* Owned Ticket Style */
.your-ticket { 
    background: #f8fafc;
    border-color: #e2e8f0;
    opacity: 0.9; 
}

/* Match Ticket Style */
.match-ticket { 
    border-color: var(--mint); 
    box-shadow: 0 20px 40px rgba(63, 106, 201, 0.1); 
}

.t-head { display: flex; justify-content: space-between; margin-bottom: 30px; font-weight: 800; font-size: 0.85rem; }
.status { color: var(--text-low); text-transform: uppercase; }
.status.highlight { color: var(--mint); background: rgba(63, 106, 201, 0.1); padding: 4px 12px; border-radius: 6px; }

.t-route { display: flex; align-items: center; justify-content: space-between; margin-bottom: 40px; }
.airport { font-size: 2.4rem; font-weight: 900; line-height: 1; color: var(--violet); }
.airport small { display: block; font-size: 0.75rem; color: var(--text-low); text-transform: uppercase; margin-top: 5px; font-weight: 700; }

.plane-path { flex: 1; text-align: center; position: relative; }
.plane-path::after { 
    content: ""; position: absolute; top: 50%; left: 10%; right: 10%; height: 2px; 
    background-image: linear-gradient(to right, #cbd5e1 50%, rgba(255,255,255,0) 0%);
    background-position: bottom;
    background-size: 10px 1px;
    background-repeat: repeat-x;
}
.plane-path i { position: relative; z-index: 1; background: var(--card); padding: 0 10px; color: var(--mint); }
.your-ticket .plane-path i { background: #f8fafc; color: var(--text-low); }

.t-details { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--border); padding-top: 20px; }
.det span { display: block; font-size: 0.65rem; color: var(--text-low); margin-bottom: 4px; font-weight: 700; text-transform: uppercase; }
.det strong { font-size: 0.95rem; color: var(--text-high); }

/* --- CENTER CONNECTOR --- */
.swap-connector { display: flex; align-items: center; }
.exchange-icon {
    width: 60px; height: 60px;
    background: var(--mint);
    color: white;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
    box-shadow: 0 10px 20px rgba(63, 106, 201, 0.3);
    z-index: 5;
}

/* --- SUMMARY CARD --- */
.trade-summary { display: flex; justify-content: center; }
.summary-card {
    background: var(--card);
    width: 100%;
    max-width: 500px;
    border-radius: 24px;
    padding: 40px;
    border: 1px solid var(--border);
    box-shadow: 0 30px 60px rgba(15, 23, 42, 0.08);
}

.summary-card h3 { margin-bottom: 30px; font-size: 1.25rem; font-weight: 800; color: var(--text-high); }
.summary-line { display: flex; justify-content: space-between; margin-bottom: 15px; font-size: 0.95rem; color: var(--text-low); font-weight: 600; }
.summary-line.total { color: var(--text-high); font-weight: 900; font-size: 1.3rem; margin-top: 20px; }
.summary-line .val.free { color: #10b981; font-weight: 800; font-size: 0.75rem; text-transform: uppercase; }

hr { border: none; border-top: 2px dashed var(--border); margin: 20px 0; }

.btn-confirm-swap {
    width: 100%;
    background: var(--violet);
    color: white;
    border: none;
    padding: 20px;
    border-radius: 16px;
    font-weight: 800;
    font-size: 1.1rem;
    cursor: pointer;
    margin-top: 20px;
    transition: 0.3s;
}
.btn-confirm-swap:hover { background: var(--mint); transform: translateY(-3px); box-shadow: 0 10px 30px rgba(63, 106, 201, 0.2); }

.security-note { text-align: center; font-size: 0.8rem; color: var(--text-low); margin-top: 25px; font-weight: 600; }
.security-note i { color: #10b981; margin-right: 6px; }

@media (max-width: 900px) {
    .comparison-grid { flex-direction: column; }
    .swap-connector { transform: rotate(90deg); margin: 20px 0; }
    .swap-ticket-box { padding: 25px; }
}