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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #0a0e27 0%, #1a1f3a 100%);
    color: #e0e6f0;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px 20px;
    background: rgba(26, 31, 58, 0.5);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ff3366;
    transition: background 0.3s;
}

.status-dot.connected {
    background: #00ff88;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.debug-toggle, .alarm-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 13px;
}

.toggle-switch {
    width: 40px;
    height: 22px;
    background: #2a2f4a;
    border-radius: 11px;
    position: relative;
    transition: background 0.3s;
}

.toggle-switch.active {
    background: #667eea;
}

.toggle-slider {
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
}

.toggle-switch.active .toggle-slider {
    transform: translateX(18px);
}

.price-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.price-card {
    background: rgba(26, 31, 58, 0.8);
    border-radius: 12px;
    padding: 20px;
    backdrop-filter: blur(10px);
}

.coin-name {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 15px;
    color: #667eea;
}

.price-row {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px 12px;
    margin-bottom: 8px;
    border-radius: 6px;
    transition: all 0.3s;
}

.price-row.ask {
    background: rgba(255, 51, 102, 0.1);
}

.price-row.bid {
    background: rgba(0, 255, 136, 0.1);
}

.price-row.flash {
    animation: flash 0.3s ease-out;
}

@keyframes flash {
    0% { 
        background: rgba(255, 255, 255, 0.3); 
        transform: scale(1.02); 
    }
    100% { 
        opacity: 1; 
        transform: scale(1); 
    }
}

.price-label {
    display: none;
}

.price-value {
    font-size: 18px;
    font-weight: 600;
}

.price-value.ask {
    color: #ff3366;
}

.price-value.bid {
    color: #00ff88;
}

.debug-info {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 12px;
    opacity: 0.7;
    display: none;
}

.debug-info.visible {
    display: block;
}

.debug-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.arbitrage-alert {
    background: rgba(60, 65, 85, 0.9);
    border: 2px solid rgba(102, 126, 234, 0.6);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
    display: none;
}

.arbitrage-alert.visible {
    display: block;
}

.alert-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.alert-coin {
    color: #ffffff;
}

.alert-coin.xrp {
    color: #ffffff;
}

.alert-coin.wan {
    color: #667eea;
}

.alert-percentage {
    background: #ffffff;
    color: #ff3366;
    padding: 4px 12px;
    border-radius: 6px;
    font-weight: 700;
}

.alert-profit {
    font-size: 20px;
    color: #00ff88;
    font-weight: 600;
}

/* SWAP HISTORY COMPONENT */
.swap-history-section {
    background: rgba(26, 31, 58, 0.8);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: #667eea;
}

.swap-history-content {
    display: none;
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
}

.swap-history-content.visible {
    display: block;
}

/* Custom Scrollbar */
.swap-history-content::-webkit-scrollbar {
    width: 8px;
}

.swap-history-content::-webkit-scrollbar-track {
    background: rgba(42, 47, 74, 0.5);
    border-radius: 4px;
}

.swap-history-content::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

.swap-history-content::-webkit-scrollbar-thumb:hover {
    background: #00ff88;
}

.swap-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* SWAP HISTORY ROWS - YENİ TASARIM */
.swap-row {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 15px;
    align-items: center;
    padding: 14px 16px;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
    cursor: pointer;
    position: relative;
    border-left: 4px solid transparent;
}

.swap-row:hover {
    transform: translateX(3px);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

/* WAN alındı - Mavi tema */
.swap-row.wan {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.25) 0%, rgba(102, 126, 234, 0.1) 100%);
    border-left-color: #667eea;
}

.swap-row.wan:hover {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.35) 0%, rgba(102, 126, 234, 0.15) 100%);
}

/* XRP alındı - Yeşil tema */
.swap-row.xrp {
    background: linear-gradient(90deg, rgba(0, 255, 136, 0.15) 0%, rgba(0, 255, 136, 0.05) 100%);
    border-left-color: #00ff88;
}

.swap-row.xrp:hover {
    background: linear-gradient(90deg, rgba(0, 255, 136, 0.25) 0%, rgba(0, 255, 136, 0.1) 100%);
}

/* Zaman gösterimi */
.swap-time {
    font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    padding: 6px 10px;
    border-radius: 6px;
    transition: all 0.3s;
    letter-spacing: 0.5px;
}

.swap-time.time-fresh {
    color: #00ff88;
    background: rgba(0, 255, 136, 0.1);
}

.swap-time.time-recent {
    color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
}

.swap-time.time-old {
    color: #ff8c00;
    background: rgba(255, 140, 0, 0.1);
}

/* Miktar gösterimi */
.swap-amount {
    font-weight: 600;
    color: #e0e6f0;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

/* Alınan miktar */
.amount-received {
    font-size: 20px;
    font-weight: 700;
}

.swap-row.wan .amount-received {
    color: #667eea;
}

.swap-row.xrp .amount-received {
    color: #00ff88;
}

/* Verilen miktar */
.amount-given {
    font-size: 14px;
    font-weight: 400;
    color: rgba(224, 230, 240, 0.5);
}

/* Direction indicator */
.swap-row::before {
    content: '';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    opacity: 0.15;
}

.swap-row.wan::before {
    content: 'W';
    background: #667eea;
    color: white;
}

.swap-row.xrp::before {
    content: 'X';
    background: #00ff88;
    color: #0a0e27;
}

.settings-section {
    background: rgba(26, 31, 58, 0.8);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
}

.settings-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #667eea;
}

.slider-group {
    margin-bottom: 20px;
}

.slider-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
}

.slider-value {
    font-weight: 600;
    color: #00ff88;
}

input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #2a2f4a;
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    transition: all 0.3s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    background: #00ff88;
    transform: scale(1.2);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
}

/* WALLET BALANCES COMPONENT */
.wallet-balances-section {
    background: rgba(26, 31, 58, 0.8);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.wallet-balances-content {
    display: none;
}

.wallet-balances-content.visible {
    display: block;
}

.wallet-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wallet-item {
    background: rgba(42, 47, 74, 0.3);
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.2s;
}

.wallet-item:hover {
    background: rgba(42, 47, 74, 0.5);
    transform: translateX(3px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.wallet-name {
    font-size: 14px;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.wallet-address {
    font-size: 11px;
    font-family: 'Courier New', monospace;
    color: rgba(224, 230, 240, 0.5);
}

.wallet-tokens {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}

.token-balance {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.token-label {
    font-size: 11px;
    text-transform: uppercase;
    opacity: 0.6;
}

.token-amount {
    font-size: 18px;
    font-weight: 700;
}

.token-balance.wan .token-label {
    color: #667eea;
}

.token-balance.wan .token-amount {
    color: #667eea;
}

.token-balance.xrp .token-label {
    color: rgba(224, 230, 240, 0.6);
}

.token-balance.xrp .token-amount {
    color: #e0e6f0;
}

/* TABLET (428px - 1024px) */
@media (min-width: 428px) and (max-width: 1024px) {
    .price-value {
        font-size: 45px;
    }
    
    .coin-name {
        font-size: 24px;
    }
    
    .alert-title {
        font-size: 32px;
    }
    
    .alert-coin {
        font-size: 45px;
    }
    
    .alert-percentage {
        font-size: 60px;
    }
    
    .alert-profit {
        font-size: 30px;
    }
    
    .section-title {
        font-size: 18px;
    }
    
    .swap-row {
        padding: 16px 18px;
        grid-template-columns: 110px 1fr;
    }
    
    .swap-time {
        font-size: 16px;
    }
    
    .amount-received {
        font-size: 22px;
    }
    
    .amount-given {
        font-size: 15px;
    }
    
    .wallet-item {
        padding: 18px;
    }
    
    .wallet-name {
        font-size: 16px;
    }
    
    .wallet-address {
        font-size: 12px;
    }
    
    .token-amount {
        font-size: 30px;
    }
}

/* LAPTOP/DESKTOP (1024px+) */
@media (min-width: 1024px) {
    .container {
        max-width: 1200px;
    }
    
    .price-grid {
        gap: 30px;
    }
    
    .price-card {
        padding: 30px;
    }
    
    .coin-name {
        font-size: 32px;
        margin-bottom: 25px;
    }
    
    .price-value {
        font-size: 48px;
        font-weight: 700;
    }
    
    .price-label {
        font-size: 16px;
    }
    
    .price-row {
        padding: 15px 20px;
        margin-bottom: 15px;
    }
    
    .alert-title {
        font-size: 48px;
        gap: 15px;
    }
    
    .alert-coin {
        font-size: 48px;
    }
    
    .alert-percentage {
        font-size: 48px;
        padding: 8px 20px;
    }
    
    .alert-profit {
        font-size: 32px;
    }
    
    .arbitrage-alert {
        padding: 40px;
    }
    
    .swap-history-section {
        padding: 30px;
    }
    
    .section-title {
        font-size: 20px;
    }
    
    .swap-row {
        padding: 18px 20px;
        grid-template-columns: 120px 1fr;
    }
    
    .swap-time {
        font-size: 17px;
        padding: 8px 12px;
    }
    
    .amount-received {
        font-size: 24px;
    }
    
    .amount-given {
        font-size: 16px;
    }
    
    .swap-row::before {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
    
    .settings-section {
        padding: 30px;
    }
    
    .settings-title {
        font-size: 20px;
        margin-bottom: 30px;
    }
    
    .slider-label {
        font-size: 18px;
        margin-bottom: 15px;
    }
    
    .slider-value {
        font-size: 18px;
    }
    
    .wallet-balances-section {
        padding: 30px;
    }
    
    .wallet-item {
        padding: 20px;
    }
    
    .wallet-name {
        font-size: 18px;
    }
    
    .wallet-address {
        font-size: 13px;
    }
    
    .token-amount {
        font-size: 30px;
    }
    
    .token-label {
        font-size: 12px;
    }
}

/* MOBILE (max 428px) */
@media (max-width: 428px) {
    .price-grid {
        grid-template-columns: 1fr;
    }

    .header-controls {
        flex-direction: column;
        gap: 8px;
        align-items: flex-end;
    }

    .container {
        padding: 10px;
    }

    body {
        padding: 10px;
    }
    
    .swap-row {
        grid-template-columns: 80px 1fr;
        gap: 10px;
        padding: 10px;
    }
    
    .swap-time {
        font-size: 13px;
        padding: 4px 8px;
    }
    
    .amount-received {
        font-size: 18px;
    }
    
    .amount-given {
        font-size: 12px;
    }
    
    .wallet-item {
        padding: 12px;
    }
    
    .wallet-name {
        font-size: 13px;
    }
    
    .wallet-address {
        font-size: 10px;
    }
    
    .token-amount {
        font-size: 16px;
    }
    
    .token-label {
        font-size: 10px;
    }
}