/* =========================================
   1. ZMIENNE I FONTY (PALETA 1 + KAKOFIND)
   ========================================= */
:root {
    /* Paleta 1 */
    --bg-dark: #050505;       /* Główne tło */
    --card-bg: #121212;       /* Karty */
    --card-hover: #1E1E1E;    /* Hover */
    --border: #2C2C2C;        /* Linie */
    --text-muted: #808080;    /* Tekst pomocniczy */
    
    --red-primary: #E60000;   /* Przyciski, Logo */
    --red-hover: #FF1A1A;     /* Hover, Badges */
    --red-dark: #8A0000;      /* Active state */
    --error: #FF4081;         /* Błędy */
    
    /* Dodatkowe */
    --text-white: #ffffff;
    --success-green: #00E676;
    --support-blue: #2979FF;  /* Kolor Supportu */
    --gold: #FFD700;
    --silver: #E0E0E0;
    --bronze: #CD7F32;
    
    /* Fonty */
    --font-heading: 'Poppins', sans-serif;
    --font-ui: 'Inter', sans-serif;
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Poppins:wght@400;600;700;800;900&display=swap');

/* =========================================
   2. GLOBALNE USTAWIENIA & ANIMACJE
   ========================================= */
body {
    background-color: var(--bg-dark);
    color: var(--text-white);
    margin: 0;
    font-family: var(--font-ui);
    overflow-x: hidden;
}

main#app {
    padding-top: 140px; 
    padding-bottom: 100px;
    min-height: 100vh;
    transition: opacity 0.8s ease;
}

/* Animacja Scroll Reveal */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
}
.reveal-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

h1, h2, h3, h4, strong { color: #fff !important; font-family: var(--font-heading) !important; }
.text-red { color: var(--red-primary) !important; }
.text-green { color: var(--success-green) !important; }

/* Tło ambientowe */
.ambient-glow {
    position: fixed; width: 600px; height: 600px; 
    background: radial-gradient(circle, rgba(230,0,0,0.08) 0%, transparent 70%);
    pointer-events: none; z-index: 0;
}
.glow-top-left { top: -250px; left: -200px; }
.glow-bottom-right { bottom: -250px; right: -200px; }

/* =========================================
   3. LOADER (SPEED BAR)
   ========================================= */
.loader-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--bg-dark); z-index: 9999;
    display: flex; justify-content: center; align-items: center;
    transition: opacity 0.5s ease-out, visibility 0.5s;
}
.loader-overlay.hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.loader-content-speed { width: 100%; max-width: 500px; padding: 0 40px; display: flex; flex-direction: column; align-items: center; }
.loader-brand-simple { width: 60px; height: auto; margin-bottom: 30px; animation: fadePulse 1s infinite alternate; }

.speed-bar-track {
    width: 100%; height: 6px; background: #1a1a1a; border-radius: 10px;
    position: relative; overflow: hidden; box-shadow: 0 0 20px rgba(0,0,0,0.5);
}
.speed-bar-glow {
    position: absolute; top: 0; left: 0; height: 100%; background: var(--red-primary);
    width: 0%; border-radius: 10px; box-shadow: 0 0 15px var(--red-primary);
    animation: speedLoad 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.loader-status {
    width: 100%; display: flex; justify-content: space-between;
    margin-top: 10px; font-family: 'Inter', monospace; font-size: 0.75rem; color: #555; font-weight: 600;
}

@keyframes speedLoad { 0% { width: 0%; } 40% { width: 70%; } 100% { width: 100%; } }
@keyframes fadePulse { from { opacity: 0.6; transform: scale(0.95); } to { opacity: 1; transform: scale(1.05); } }

/* =========================================
   4. HEADER
   ========================================= */
.dashboard-header { display: flex; justify-content: center; margin-bottom: 20px; padding: 40px 20px; }
.header-container {
    display: flex; justify-content: space-between; align-items: center;
    width: 100%; max-width: 1100px; padding-bottom: 25px; border-bottom: 1px solid var(--border);
}
.brand-box { display: flex; align-items: center; gap: 15px; }
.brand-logo { width: 45px; height: auto; filter: drop-shadow(0 0 10px rgba(230,0,0,0.3)); }
.brand-text h1 { font-size: 1.8rem; font-weight: 800; margin: 0; line-height: 1; letter-spacing: -0.5px; }
.brand-sub { font-size: 0.7rem; color: var(--text-muted); letter-spacing: 2px; font-weight: 600; text-transform: uppercase; margin-top: 4px; }
.header-stat { text-align: right; font-size: 0.75rem; color: var(--text-muted); display: flex; flex-direction: column; gap: 2px; }

/* =========================================
   5. PODIUM TOP 3 (KARTY) - ZMNIEJSZONE
   ========================================= */
.top3-section { max-width: 1050px; /* Zmniejszono z 1200 */ margin: 0 auto 60px; padding: 0 20px; }
.podium-container { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 20px; /* Zmniejszono gap */ align-items: start; }

.podium-card {
    background: var(--card-bg); border: 1px solid var(--border); border-radius: 16px;
    padding: 25px 15px; /* Zmniejszono padding */ text-align: center; position: relative; 
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex; flex-direction: column;
}
.podium-card:hover { 
    transform: translateY(-8px); border-color: #444; 
    box-shadow: 0 15px 30px rgba(0,0,0,0.4); background-color: var(--card-hover);
}

.rank-1 {
    background: linear-gradient(180deg, #1a0505 0%, var(--card-bg) 100%);
    border: 2px solid var(--red-primary); padding-bottom: 30px;
    box-shadow: 0 0 50px rgba(230,0,0,0.15); transform: scale(1.02); /* Zmniejszono skalę */ z-index: 5;
}
.rank-1:hover { transform: scale(1.04) translateY(-8px); }

.podium-img-wrapper {
    width: 60px; height: 60px; margin: 0 auto 12px; 
    background: #000; border-radius: 50%; border: 1px solid #333;
    display: flex; align-items: center; justify-content: center; 
}
.rank-1 .podium-img-wrapper { width: 80px; height: 80px; border-color: var(--red-primary); box-shadow: 0 0 20px rgba(230,0,0,0.2); }
.podium-img-wrapper img { width: 100%; height: 100%; object-fit: contain; }

.crown-icon { font-size: 1.8rem; color: var(--gold); margin-bottom: 8px; display: block; }
.rank-badge {
    position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
    padding: 4px 12px; border-radius: 20px; font-weight: 800; font-size: 0.65rem; 
    text-transform: uppercase; letter-spacing: 1px; color: #000; font-family: var(--font-heading);
}
.gold { background: var(--gold); } .silver { background: var(--silver); } .bronze { background: var(--bronze); }

/* Meta Dane */
.meta-stats-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; justify-content: center; }

/* TRUST PILL */
.trust-pill { display: inline-block; font-size: 0.65rem; font-weight: 700; padding: 3px 8px; border-radius: 6px; background: #000; color: var(--text-muted); border: 1px solid #333; }
.trust-high { color: var(--success-green); border-color: rgba(0, 230, 118, 0.2); background: rgba(0, 230, 118, 0.05); }

/* SUPPORT PILL - NOWOŚĆ */
.support-pill {
    display: inline-block; font-size: 0.65rem; font-weight: 700; padding: 3px 8px; border-radius: 6px;
    background: rgba(41, 121, 255, 0.05); color: var(--support-blue); border: 1px solid rgba(41, 121, 255, 0.2);
}

.exchange-badge {
    font-size: 0.65rem; font-weight: 700; background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border); padding: 3px 8px; border-radius: 6px;
    color: #ccc; display: flex; align-items: center; gap: 5px;
}
.exchange-badge strong { color: var(--success-green) !important; }

/* Badges & Ceny */
.marketing-badge { display: inline-block; font-size: 0.6rem; padding: 3px 8px; border-radius: 5px; margin-bottom: 10px; font-weight: 600; border: 1px solid transparent; }
.red-glow { background: rgba(230, 0, 0, 0.1); color: #ff4d4d; border-color: rgba(230,0,0,0.3); }
.purple-glow { background: rgba(157, 0, 255, 0.1); color: #d480ff; border-color: rgba(157, 0, 255, 0.3); }
.blue-glow { background: rgba(0, 140, 255, 0.1); color: #66b3ff; border-color: rgba(0, 140, 255, 0.3); }

.price-block { margin: 8px 0; }
.highlight-block { background: rgba(255,255,255,0.03); padding: 12px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.05); }
.price-row { display: flex; flex-direction: column; align-items: center; line-height: 1; }
.old-price { font-size: 0.8rem; color: #666; text-decoration: line-through; margin-bottom: 2px; height: 16px; visibility: hidden; }
.new-price { font-size: 1.6rem; font-weight: 800; color: #fff; }
.big-price { font-size: 2.2rem; color: var(--red-primary); text-shadow: 0 0 30px rgba(230,0,0,0.2); }
.coupon-tag { font-size: 0.6rem; background: var(--success-green); color: #000; padding: 2px 6px; border-radius: 4px; display: inline-block; margin-bottom: 6px; font-weight: 700; }
.shipping-line { display: block; font-size: 0.7rem; color: var(--text-muted); margin-top: 6px; font-weight: 500; }
.avg-calc { font-size: 0.75rem; color: var(--text-muted); margin-top: 8px; font-family: 'Inter', monospace; margin-bottom: 12px; }

/* PRZYCISKI - NOWY UKŁAD */
.card-actions-group {
    display: flex; gap: 8px; justify-content: center; width: 100%; margin-top: 10px;
}

.btn-payment-toggle {
    flex: 1; 
    background: rgba(255,255,255,0.05); 
    border: 1px solid #333; 
    color: #ccc; 
    padding: 8px; 
    border-radius: 8px; 
    cursor: pointer; 
    font-size: 0.7rem; 
    font-weight: 600;
    transition: 0.3s;
    display: flex; align-items: center; justify-content: center; gap: 6px;
    font-family: var(--font-ui);
}
.btn-payment-toggle:hover { background: #fff; color: #000; border-color: #fff; }

/* Mały przycisk akcji */
.btn-compact {
    flex: 1.5;
    display: flex; align-items: center; justify-content: center;
    padding: 8px; border-radius: 8px; text-decoration: none;
    font-weight: 700; font-size: 0.75rem; transition: 0.3s;
}
.btn-outline { border: 1px solid #444; color: #fff; background: transparent; }
.btn-outline:hover { background: #fff; color:#000; }
.btn-primary { background: var(--red-primary); color: #fff; border: none; }
.btn-primary:hover { background: var(--red-hover); box-shadow: 0 0 25px rgba(230,0,0,0.4); }

/* --- SEKCJA PŁATNOŚCI (DROPDOWN) --- */
.payment-dropdown-content {
    display: none; 
    background: #080808; 
    border: 1px solid #222;
    border-radius: 12px;
    margin-top: 12px;
    padding: 12px;
    width: 100%;
    box-sizing: border-box;
    text-align: left;
    animation: fadeInSlide 0.3s ease-out;
}

@keyframes fadeInSlide {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.pay-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 6px 0; border-bottom: 1px solid #1a1a1a;
    font-size: 0.7rem;
}
.pay-row:last-child { border-bottom: none; }

.pay-info { display: flex; align-items: center; gap: 8px; color: #ccc; font-weight: 500; }
.pay-info i { width: 20px; text-align: center; color: #888; } 

.pay-cost { text-align: right; display: flex; flex-direction: column; align-items: flex-end; }
.fee-tag { font-size: 0.6rem; margin-bottom: 2px; }
.total-cost { font-weight: 700; color: #fff; font-size: 0.75rem; }

/* Kolory opłat */
.cost-low { color: var(--success-green); }
.cost-mid { color: var(--gold); }
.cost-high { color: var(--error); }

/* =========================================
   6. PANEL STEROWANIA
   ========================================= */
.controls-container { margin: 0 auto 80px; padding: 0 20px; display: flex; justify-content: center; }
.glass-panel {
    background: var(--card-bg); border: 1px solid var(--border); padding: 30px 40px;
    border-radius: 20px; width: 100%; max-width: 800px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

.control-row { width: 100%; }
.control-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.control-header label { font-size: 0.9rem; color: #fff; font-weight: 700; letter-spacing: 1px; }
.weight-display { background: #000; padding: 6px 14px; border-radius: 8px; border: 1px solid #333; }
#weightVal { font-size: 1.2rem; font-weight: 800; color: var(--red-primary); }
.unit { font-size: 0.8rem; color: #666; margin-left: 2px; font-weight: 600; }

.slider-wrapper { position: relative; padding: 20px 0 30px; }
.custom-range {
    -webkit-appearance: none; width: 100%; height: 6px; background: #222; border-radius: 3px; outline: none;
    background-image: linear-gradient(90deg, var(--red-primary), var(--red-primary));
    background-size: 0% 100%; background-repeat: no-repeat; cursor: pointer;
}
.custom-range::-webkit-slider-thumb {
    -webkit-appearance: none; height: 22px; width: 22px; border-radius: 50%;
    background: #fff; border: 3px solid var(--red-primary); cursor: pointer;
    box-shadow: 0 0 15px rgba(230,0,0,0.6); transition: transform 0.2s; margin-top: -8px;
}
.custom-range::-webkit-slider-thumb:hover { transform: scale(1.2); }

.slider-ticks-precise { position: relative; width: 100%; height: 20px; margin-top: 10px; }
.slider-ticks-precise span {
    position: absolute; top: 0; transform: translateX(-50%);
    font-size: 0.75rem; color: var(--text-muted); font-family: 'Inter', sans-serif; font-weight: 600; white-space: nowrap;
}
.slider-ticks-precise span::before { content: ''; position: absolute; top: -8px; left: 50%; transform: translateX(-50%); width: 1px; height: 5px; background: #444; }

.divider { height: 1px; background: #222; margin: 10px 0 25px; width: 100%; }
.actions-row { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }

.currency-box { display: flex; align-items: center; gap: 10px; }
.currency-tabs { display: flex; background: #000; border-radius: 8px; padding: 4px; border: 1px solid #333; }
.curr-btn {
    background: transparent; border: none; color: #888; padding: 6px 12px; border-radius: 6px;
    cursor: pointer; font-family: var(--font-ui); font-size: 0.8rem; font-weight: 600; transition: 0.3s;
}
.curr-btn.active { background: var(--red-dark); color: #fff; box-shadow: 0 2px 10px rgba(138, 0, 0, 0.3); }
.curr-btn:hover:not(.active) { color: #fff; background: rgba(255,255,255,0.05); }

.control-label { margin-right: 5px; color: #888; font-size: 0.85rem; font-weight: 600; }
.rate-disclaimer { width: 100%; text-align: center; font-size: 0.65rem; color: #555; margin-top: 15px; font-style: italic; }

.toggle-wrapper {
    display: flex; align-items: center; gap: 12px; cursor: pointer;
    background: #000; padding: 8px 16px; border-radius: 30px; border: 1px solid #333; transition: all 0.3s;
}
.toggle-wrapper:hover { border-color: #555; background: #161616; }
.toggle-switch { width: 36px; height: 20px; background: #333; border-radius: 20px; position: relative; transition: 0.3s; }
.toggle-knob { width: 16px; height: 16px; background: #fff; border-radius: 50%; position: absolute; top: 2px; left: 2px; transition: 0.3s; }
.toggle-wrapper.active .toggle-switch { background: var(--success-green); }
.toggle-wrapper.active .toggle-knob { transform: translateX(16px); }
.toggle-label { font-size: 0.85rem; font-weight: 600; color: #ccc; user-select: none; }

.sort-box { display: flex; align-items: center; }
.sort-dropdown {
    background: #000; color: #fff; border: 1px solid #333; padding: 8px 12px;
    border-radius: 8px; outline: none; cursor: pointer; font-family: var(--font-ui); font-size: 0.85rem; transition: border 0.3s;
}
.sort-dropdown:hover { border-color: #555; }

/* =========================================
   7. LISTA AGENTÓW (GRID + HOVER FIX)
   ========================================= */
.agents-list-section { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.list-header-simple { margin-bottom: 25px; border-bottom: 1px solid var(--border); padding-bottom: 15px; }
.list-header-simple h3 { margin: 0; font-size: 1.1rem; color: var(--text-muted) !important; font-family: var(--font-heading); }

.list-item {
    display: grid;
    grid-template-columns: 70px 1.2fr 2.5fr 1fr 140px; 
    gap: 25px; align-items: center;
    background: var(--card-bg); border: 1px solid var(--border);
    border-radius: 16px; padding: 25px; margin-bottom: 20px;
    position: relative; z-index: 1;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), background-color 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.list-item:hover {
    background: var(--card-hover); border-color: #444444;
    transform: translateY(-6px); box-shadow: 0 15px 40px rgba(0,0,0,0.5); z-index: 10;
}

.list-logo { width: 60px; border-radius: 10px; }
.list-name { display: flex; flex-direction: column; }
.list-name h4 { margin: 0 0 6px 0; font-size: 1.15rem; font-weight: 700; transition: color 0.3s; }
.list-item:hover .list-name h4 { color: var(--red-primary); }

.list-item .meta-stats-row { justify-content: flex-start; margin-bottom: 0; gap: 8px; }

.item-cost-info { font-size: 0.65rem; color: #666; margin-top: 6px; font-weight: 500; }

.warning-note { 
    font-size: 0.65rem; color: #fff; margin-top: 6px; display: inline-block; font-weight: 800; 
    background: var(--error); padding: 3px 8px; border-radius: 4px;
    border: 1px solid rgba(255, 64, 129, 0.3); text-transform: uppercase;
    animation: pulse-danger 2s infinite;
}
@keyframes pulse-danger {
    0% { box-shadow: 0 0 0 0 rgba(255, 64, 129, 0.7); }
    70% { box-shadow: 0 0 0 6px rgba(255, 64, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 64, 129, 0); }
}

.shipping-details-col { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.shipping-row {
    display: flex; justify-content: space-between; align-items: center;
    background: rgba(255,255,255,0.03); padding: 8px 12px; border-radius: 8px;
    font-size: 0.85rem; border: 1px solid transparent; transition: background 0.2s;
}
.shipping-row:hover { background: rgba(255,255,255,0.06); border-color: #333; }

.ship-name { color: #ccc; flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 500; }
.line-rank { font-size: 0.7rem; color: #555; font-weight: 800; margin-right: 8px; }

.ship-pricing { display: flex; align-items: center; gap: 10px; text-align: right; }
.price-group { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.row-new-price { font-weight: 700; color: #fff; font-size: 0.95rem; }
.row-old-price { font-size: 0.7rem; color: #555; text-decoration: line-through; }
.row-coupon {
    font-size: 0.65rem; color: var(--success-green); background: rgba(0, 230, 118, 0.1);
    padding: 2px 6px; border-radius: 4px; border: 1px solid rgba(0, 230, 118, 0.2); font-weight: 600;
}

.list-stat { text-align: right; }
.price-col strong { font-size: 1.5rem; display: block; font-weight: 800; }

.action-col { text-align: right; }
.btn-sm {
    display: flex; width: 100%; height: 45px; align-items: center; justify-content: center;
    border: 1px solid #444; border-radius: 10px; color: #fff; text-decoration: none; font-size: 0.9rem; font-weight: 600;
    transition: all 0.2s ease-in-out; background: transparent;
}
/* INTERAKTYWNY HOVER DLA PRZYCISKU OPŁATY */
.btn-fees-interactive:hover { 
    background: #fff !important; 
    color: #000 !important; 
    border-color: #fff !important;
    box-shadow: 0 0 15px rgba(255,255,255,0.4);
    transform: translateY(-2px);
}
.btn-sm:hover:not(.btn-fees-interactive) {
    background: #fff; color: #000; border-color: #fff;
}

/* RWD */
@media (max-width: 900px) {
    .header-container { flex-direction: column; align-items: flex-start; gap: 15px; }
    .header-stat { text-align: left; }
    .podium-container { grid-template-columns: 1fr; gap: 50px; }
    .rank-1 { order: -1; }
    .list-item { 
        grid-template-columns: 1fr; 
        grid-template-areas: "header" "shipping" "price" "action"; 
        gap: 20px; 
    }
    .list-name { grid-area: header; text-align: center; }
    .meta-stats-row { justify-content: center; }
    .shipping-details-col { grid-area: shipping; }
    .list-stat { grid-area: price; text-align: center !important; }
    .action-col { grid-area: action; }
    .row-coupon { display: none; }
    .actions-row { flex-direction: column; gap: 15px; align-items: stretch; }
    .toggle-wrapper, .sort-box, .sort-dropdown, .currency-box { width: 100%; justify-content: center; }
}