/* TNT Upgrades - Exchange Protocol Styles (Restored V1) */

/* Container */
.tnt-upgrades-wrapper {
    background: #0c0c0c;
    border: 1px solid rgba(197, 160, 89, 0.3);
    border-top: 3px solid var(--tnt-gold);
    border-radius: 4px;
    margin: 3rem 0;
    overflow: hidden;
    font-family: 'Merriweather', serif;
    box-shadow: 0 15px 40px -10px rgba(0,0,0,0.8);
}

/* Header */
.tnt-upgrades-header {
    background: linear-gradient(90deg, #111 0%, #1a1a1a 100%);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(197, 160, 89, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tnt-upgrades-header h3 {
    margin: 0;
    color: var(--tnt-gold);
    font-family: 'Beleren', 'Cinzel', serif;
    font-size: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.icon-gold {
    color: var(--tnt-gold);
    width: 1.5rem;
    height: 1.5rem;
}

/* Body Layout */
.tnt-upgrades-body {
    display: flex;
    flex-wrap: wrap;
    background: linear-gradient(180deg, rgba(255,255,255,0.01) 0%, rgba(0,0,0,0) 100%);
}

.tnt-swaps-list {
    flex: 3;
    min-width: 60%;
    padding: 1.5rem;
    border-right: 1px solid rgba(255,255,255,0.1);
}

.tnt-upgrades-sidebar {
    flex: 1;
    min-width: 250px;
    padding: 1.5rem;
    background: rgba(0,0,0,0.2);
}

/* --- SWAP ROW --- */
.tnt-swap-row {
    margin-bottom: 2rem;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 4px;
    overflow: hidden;
}

.swap-visuals {
    display: flex;
    align-items: stretch;
    height: 80px;
    position: relative;
}

.swap-card {
    flex: 1;
    position: relative;
    overflow: hidden;
    cursor: help;
    transition: filter 0.3s;
    background-color: #1a1a1a;
}

.swap-card:hover {
    filter: brightness(1.2);
}

.card-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center 25%;
    transition: transform 0.5s;
}

.swap-card:hover .card-bg {
    transform: scale(1.05);
}

.card-bg.grayscale {
    filter: grayscale(100%);
    opacity: 0.6;
}

.card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.4) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-left: 1rem;
    z-index: 2;
    pointer-events: none;
}

/* Badges */
.badge-in, .badge-out {
    font-family: 'Beleren', sans-serif;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 4px;
    padding: 2px 6px;
    border-radius: 2px;
    width: fit-content;
}

.badge-in {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.4);
}

.badge-out {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.card-name {
    font-family: 'Beleren', sans-serif;
    color: #fff;
    font-size: 1rem;
    text-shadow: 0 2px 4px rgba(0,0,0,1);
    line-height: 1.1;
}

/* Connector Arrow */
.swap-connector {
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #111;
    color: #6b7280;
    border-left: 1px solid rgba(255,255,255,0.1);
    border-right: 1px solid rgba(255,255,255,0.1);
    z-index: 5;
}

/* Reasoning Accordion */
.swap-reasoning {
    border-top: 1px solid rgba(255,255,255,0.05);
}

.reasoning-toggle {
    width: 100%;
    background: #151515;
    border: none;
    padding: 0.75rem 1rem;
    text-align: left;
    color: #9ca3af;
    font-family: 'Beleren', sans-serif;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.2s, color 0.2s;
}

.reasoning-toggle:hover {
    background: #1a1a1a;
    color: var(--tnt-gold);
}

.toggle-icon {
    margin-left: auto;
    width: 1rem;
    height: 1rem;
    transition: transform 0.3s;
}

.reasoning-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0, 1, 0, 1);
    background: rgba(255,255,255,0.02);
}

.reasoning-content p {
    padding: 1rem;
    margin: 0;
    font-size: 0.9rem;
    color: #d1d5db;
    line-height: 1.6;
    border-left: 2px solid var(--tnt-gold);
}

/* Active State */
.swap-reasoning.active .toggle-icon {
    transform: rotate(180deg);
}

.swap-reasoning.active .reasoning-content {
    max-height: 500px;
    transition: max-height 0.4s ease-in-out;
}

/* --- SIDEBAR --- */
.tnt-sidebar-box {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cost-label {
    font-family: 'Beleren', sans-serif;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: #9ca3af;
 display: flex;
}

.cost-value {
    font-family: 'Beleren', serif;
    font-size: 2.5rem;
    color: #42c947;
    line-height: 1;
    text-shadow: 0 0 20px rgba(34, 197, 94, 0.2);
    margin-bottom: 0.5rem;
     display: center;
}

.tnt-btn-upgrade-buy {
   display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid var(--tnt-gold);
    background: linear-gradient(135deg, #c5a059 0%, #b8860b 100%);
    color: #000 !important;
    padding: 0.8rem;
    border-radius: 4px;
    text-decoration: none;
    font-family: 'Beleren', sans-serif;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.8rem;
    transition: background 0.2s;
}

.tnt-btn-upgrade-buy:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.tnt-btn-upgrade-wny {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #111;
    border: 1px solid var(--tnt-gold);
    color: var(--tnt-gold) !important;
    padding: 0.8rem;
    border-radius: 4px;
    text-decoration: none;
    font-family: 'Beleren', sans-serif;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.8rem;
    transition: background 0.2s;
}

.tnt-btn-upgrade-wny:hover {
    background: rgba(197, 160, 89, 0.1);
}

.sub-text {
    font-size: 0.6rem;
    opacity: 0.8;
    margin-top: 2px;
}

/* --- TOOLTIP --- */
#tnt-upgrade-tooltip {
    position: fixed;
    z-index: 99999;
    pointer-events: none;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.2s ease, transform 0.2s ease;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.8), 0 0 20px rgba(197, 160, 89, 0.2);
    border: 1px solid var(--tnt-gold);
    width: 240px;
    height: auto;
    background: #000;
}

#tnt-upgrade-tooltip.visible {
    opacity: 1;
    transform: scale(1);
}

#tnt-upgrade-tooltip img {
    width: 100%;
    height: auto;
    display: block;
}

/* Mobile Fixes */
@media (max-width: 768px) {
    .tnt-upgrades-body {
        flex-direction: column;
    }
    
    .tnt-swaps-list {
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        padding: 1rem;
    }
    
    .swap-visuals {
        flex-direction: column;
        height: auto;
    }
    
    .swap-card {
        height: 80px;
        flex: none; 
        width: 100%;
        margin-bottom: 0;
    }
    
    .card-overlay {
        padding-left: 1rem;
    }
    
    .swap-connector {
        width: 100%;
        height: 30px;
        border: none;
        border-top: 1px solid rgba(255,255,255,0.1);
        border-bottom: 1px solid rgba(255,255,255,0.1);
        background: #111;
    }
    
    .swap-connector svg {
        transform: rotate(90deg);
    }
    
    .tnt-upgrades-sidebar {
        padding: 1.5rem 1rem;
    }
    
    #tnt-upgrade-tooltip {
        display: none !important;
    }
}