:root {
    --primary-color: #f0b90b;
    --primary-hover: #d9a307;
    --secondary-color: #181a20;
    --background-color: #0b0e11;
    --card-background: #1e2329;
    --text-primary: #eaecef;
    --text-secondary: #848e9c;
    --success-color: #0ecb81;
    --danger-color: #f6465d;
    --warning-color: #fcd535;
    --border-color: #2b3139;
    --input-bg: rgba(30, 35, 41, 0.6);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Global Typography */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 14px;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: inherit;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.01em;
}

p, span, label, td, th, input, select, button {
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-primary);
}

small {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.app-container {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--background-color) 0%, #1a1f2e 100%);
    display: flex;
    flex-direction: column;
}

/* Header Styles */
.app-header {
    background: linear-gradient(135deg, var(--card-background) 0%, rgba(30, 35, 41, 0.95) 100%);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

/* Sağ blok: Telegram + metrikler aynı hizada yatay */
.header-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* Header actions for logout button */
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: transparent;
    border-radius: 12px;
    box-shadow: none;
    transition: transform 0.3s ease;
}

.logo svg {
    display: block;
    width: 40px;
    height: 40px;
}

.logo:hover {
    transform: scale(1.05);
}

.brand h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
    line-height: 1.2;
}

.brand .tagline {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
    font-weight: 500;
}



.live-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(14, 203, 129, 0.1);
    border-radius: 20px;
    border: 1px solid rgba(14, 203, 129, 0.3);
    transition: all 0.3s ease;
}

.live-indicator:hover {
    background: rgba(14, 203, 129, 0.15);
}

.live-dot {
    width: 8px;
    height: 8px;
    background: var(--success-color);
    border-radius: 50%;
    animation: pulse 2s infinite;
    box-shadow: 0 0 8px rgba(14, 203, 129, 0.6);
}

.live-indicator span:last-child {
    font-size: 0.85rem;
    color: var(--success-color);
    font-weight: 600;
}

/* Main Content */
main {
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 24px;
    width: 100%;
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Tab Navigation */
.tab-navigation {
    display: flex;
    gap: 4px;
    background: linear-gradient(135deg, var(--card-background) 0%, rgba(30, 35, 41, 0.8) 100%);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 6px;
    box-shadow: var(--shadow-sm);
}

.tab-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 20px;
    background: transparent;
    border: none;
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.tab-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(240, 185, 11, 0.1), transparent);
    transition: left 0.6s;
}

.tab-button:hover::before {
    left: 100%;
}

.tab-button:hover {
    color: var(--text-primary);
    background: rgba(240, 185, 11, 0.1);
    transform: translateY(-1px);
}

.tab-button.active {
    color: var(--secondary-color);
    background: linear-gradient(135deg, var(--primary-color) 0%, #e5a808 100%);
    box-shadow: 0 4px 12px rgba(240, 185, 11, 0.4);
    font-weight: 600;
}

.tab-button.active:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(240, 185, 11, 0.5);
}

.tab-button svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Tab Content */
.tab-content {
    position: relative;
}

.tab-panel {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.tab-panel.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Token Details Table specific styles - Optimized for 31 columns */
#tokenDetailsTable {
    font-size: 0.75rem;
    min-width: 2400px; /* Increased width for better readability of all 31 columns */
}

#tokenDetailsTable th {
    font-size: 0.7rem;
    padding: 6px 4px;
    white-space: nowrap;
    font-weight: 600;
    background-color: rgba(24, 26, 32, 0.8);
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 2px solid var(--border-color);
}

#tokenDetailsTable td {
    font-size: 0.75rem;
    padding: 6px 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-bottom: 1px solid rgba(43, 49, 57, 0.6);
    line-height: 1.3;
}

#tokenDetailsTable .token-info {
    min-width: 0;
    max-width: 100px;
}

#tokenDetailsTable .token-info > div {
    min-width: 0;
}

#tokenDetailsTable .token-info > div > div:first-child {
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

#tokenDetailsTable .token-info small {
    font-size: 0.65rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-secondary);
}

#tokenDetailsTable .token-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Column width optimization for all 31 columns - Increased sizes */
#tokenDetailsTable th:nth-child(1), #tokenDetailsTable td:nth-child(1) {
    min-width: 120px;
    max-width: 150px;
    position: sticky;
    left: 0;
    z-index: 5;
    background-color: var(--card-background);
}

#tokenDetailsTable th:nth-child(2), #tokenDetailsTable td:nth-child(2) {
    min-width: 70px;
    max-width: 100px;
}

#tokenDetailsTable th:nth-child(3), #tokenDetailsTable td:nth-child(3) {
    min-width: 90px;
    max-width: 120px;
}

#tokenDetailsTable th:nth-child(4), #tokenDetailsTable td:nth-child(4) {
    min-width: 80px;
    max-width: 100px;
}

#tokenDetailsTable th:nth-child(5), #tokenDetailsTable td:nth-child(5) {
    min-width: 80px;
    max-width: 100px;
}

#tokenDetailsTable th:nth-child(6), #tokenDetailsTable td:nth-child(6) {
    min-width: 90px;
    max-width: 120px;
}

#tokenDetailsTable th:nth-child(7), #tokenDetailsTable td:nth-child(7),
#tokenDetailsTable th:nth-child(8), #tokenDetailsTable td:nth-child(8) {
    min-width: 100px;
    max-width: 130px;
}

#tokenDetailsTable th:nth-child(n+9):nth-child(-n+12), #tokenDetailsTable td:nth-child(n+9):nth-child(-n+12) {
    min-width: 80px;
    max-width: 110px;
}

#tokenDetailsTable th:nth-child(n+13):nth-child(-n+18), #tokenDetailsTable td:nth-child(n+13):nth-child(-n+18) {
    min-width: 70px;
    max-width: 100px;
}

#tokenDetailsTable th:nth-child(n+19):nth-child(-n+24), #tokenDetailsTable td:nth-child(n+19):nth-child(-n+24) {
    min-width: 80px;
    max-width: 110px;
}

#tokenDetailsTable th:nth-child(n+25):nth-child(-n+31), #tokenDetailsTable td:nth-child(n+25):nth-child(-n+31) {
    min-width: 70px;
    max-width: 100px;
}

/* Price and percentage columns styling */
#tokenDetailsTable td.price {
    font-size: 0.7rem;
    font-weight: 500;
    font-family: 'Inter', monospace;
}

#tokenDetailsTable td.positive {
    color: var(--success-color);
    font-weight: 600;
}

#tokenDetailsTable td.negative {
    color: var(--danger-color);
    font-weight: 600;
}

/* Enhanced scrolling for token details table */
#tokenDetailsTable .table-container {
    overflow-x: auto;
    overflow-y: visible;
    max-height: 75vh; /* Increased from 70vh */
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--border-color);
    border-radius: 0 0 16px 16px;
}

#tokenDetailsTable .table-container::-webkit-scrollbar {
    height: 12px; /* Increased scrollbar size */
}

#tokenDetailsTable .table-container::-webkit-scrollbar-track {
    background: var(--border-color);
    border-radius: 6px;
}

#tokenDetailsTable .table-container::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 6px;
    border: 2px solid var(--border-color);
}

#tokenDetailsTable .table-container::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

/* Responsive design for token details table */
@media (max-width: 1200px) {
    #tokenDetailsTable {
        min-width: 2000px; /* Increased from 1800px */
        font-size: 0.7rem;
    }
    
    #tokenDetailsTable th {
        font-size: 0.65rem;
        padding: 5px 3px;
    }
    
    #tokenDetailsTable td {
        font-size: 0.7rem;
        padding: 5px 3px;
    }
    
    #tokenDetailsTable .token-info {
        max-width: 100px; /* Increased from 90px */
    }
    
    #tokenDetailsTable .token-icon {
        width: 14px;
        height: 14px;
    }
    
    #tokenDetailsTable .table-container {
        max-height: 70vh; /* Slightly reduced for smaller screens */
    }
}

@media (max-width: 768px) {
    .tab-navigation {
        flex-direction: column;
        gap: 2px;
    }
    
    .tab-button {
        padding: 12px 16px;
        font-size: 0.9rem;
    }
    
    .tab-button svg {
        width: 14px;
        height: 14px;
    }
    
    #tokenDetailsTable {
        min-width: 1800px; /* Increased from 1600px */
    }
    
    #tokenDetailsTable th,
    #tokenDetailsTable td {
        font-size: 0.65rem;
        padding: 4px 2px;
    }
    
    #tokenDetailsTable .token-info {
        max-width: 90px; /* Increased from 80px */
    }
    
    #tokenDetailsTable .token-icon {
        width: 12px;
        height: 12px;
    }
    
    #tokenDetailsTable .token-info > div > div:first-child {
        font-size: 0.7rem;
    }
    
    #tokenDetailsTable .token-info small {
        font-size: 0.6rem;
    }
    
    #tokenDetailsTable .table-container {
        max-height: 65vh; /* Further reduced for mobile */
    }
}

@media (max-width: 480px) {
    .tab-button {
        padding: 10px 12px;
        font-size: 0.85rem;
    }
    
    .tab-button svg {
        width: 12px;
        height: 12px;
    }
    
    #tokenDetailsTable {
        min-width: 1600px; /* Increased from 1400px */
    }
    
    #tokenDetailsTable th,
    #tokenDetailsTable td {
        font-size: 0.6rem;
        padding: 3px 2px;
    }
    
    #tokenDetailsTable .token-info {
        max-width: 80px; /* Increased from 70px */
    }
    
    #tokenDetailsTable .token-icon {
        width: 10px;
        height: 10px;
    }
    
    #tokenDetailsTable .table-container {
        max-height: 60vh; /* Mobile-optimized height */
    }
}

/* Controls Section */
.controls-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    padding: 20px 24px;
    background: linear-gradient(135deg, var(--card-background) 0%, rgba(30, 35, 41, 0.8) 100%);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    flex-wrap: wrap;
}

.controls-left {
    display: flex;
    gap: 16px;
    align-items: center;
    flex: 1;
    min-width: 300px;
}

.controls-right {
    display: flex;
    gap: 16px;
    align-items: center;
}

/* Telegram panel in header */
.telegram-panel {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 12px;
    background: rgba(24, 26, 32, 0.95);
    border-radius: 10px;
    border: 1px solid rgba(240, 185, 11, 0.18);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    min-width: 220px;
}

.telegram-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
}

.telegram-input {
    padding: 6px 8px;
    background: var(--input-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.8rem;
    outline: none;
    transition: all 0.25s ease;
}

.telegram-input::placeholder {
    color: var(--text-secondary);
}

.telegram-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(240, 185, 11, 0.12);
    background: rgba(30, 35, 41, 0.95);
}

.btn-telegram {
    padding: 6px 10px;
    font-size: 0.75rem;
    border-radius: 8px;
    background: linear-gradient(90deg, #229ED9, #0b6291);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
}

.btn-telegram:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.5);
}

.btn-logout {
    padding: 10px 16px;
    font-size: 0.85rem;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--danger-color), #e53e3e);
    color: #ffffff;
    border: 1px solid rgba(246, 70, 93, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(246, 70, 93, 0.3);
    transition: all 0.3s ease;
    font-weight: 600;
}

.btn-logout:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(246, 70, 93, 0.4);
    background: linear-gradient(135deg, #e53e3e, #dc2626);
}

.telegram-status {
    font-size: 0.7rem;
    color: var(--text-secondary);
    min-height: 12px;
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 400px;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 14px;
    color: var(--text-secondary);
    pointer-events: none;
    z-index: 1;
}

.search-input {
    width: 100%;
    padding: 12px 40px 12px 42px;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.3s ease;
    outline: none;
}

.search-input:focus {
    border-color: var(--primary-color);
    background: rgba(30, 35, 41, 0.8);
    box-shadow: 0 0 0 3px rgba(240, 185, 11, 0.1);
}

.search-input::placeholder {
    color: var(--text-secondary);
}

.clear-btn {
    position: absolute;
    right: 10px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    z-index: 1;
}

.clear-btn:hover {
    background: rgba(132, 142, 156, 0.2);
    color: var(--text-primary);
}

.filter-group {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

/* Hacim filtrelerini mevcut select/input tasarımıyla hizala */
.filter-input {
    padding: 12px 16px;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s ease;
    min-width: 160px;
    height: 40px;
    appearance: textfield;
}

.filter-input::placeholder {
    color: var(--text-secondary);
}

.filter-input::-webkit-outer-spin-button,
.filter-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.filter-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(240, 185, 11, 0.1);
    background: rgba(30, 35, 41, 0.9);
}

.filter-select {
    padding: 12px 16px;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    min-width: 180px;
}

.filter-select:hover {
    border-color: var(--primary-color);
}

.filter-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(240, 185, 11, 0.1);
}

.last-update {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.update-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.update-time {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 600;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--secondary-color);
    box-shadow: 0 4px 12px rgba(240, 185, 11, 0.3);
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(240, 185, 11, 0.4);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary svg {
    transition: transform 0.3s ease;
}

.btn-primary:hover:not(:disabled) svg {
    transform: rotate(180deg);
}

.loading-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary-color);
    font-size: 0.9rem;
}

.spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Stats Container */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.stat-card {
    background: linear-gradient(135deg, var(--card-background) 0%, rgba(30, 35, 41, 0.8) 100%);
    padding: 24px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(240, 185, 11, 0.05), transparent);
    transition: left 0.6s;
}

.stat-card:hover::before {
    left: 100%;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-card-primary {
    border-left: 4px solid var(--primary-color);
}

.stat-card-success {
    border-left: 4px solid var(--success-color);
}

.stat-card-info {
    border-left: 4px solid var(--warning-color);
}

.stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: var(--secondary-color);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

.stat-card-primary .stat-icon {
    color: var(--primary-color);
    background: rgba(240, 185, 11, 0.1);
}

.stat-card-success .stat-icon {
    color: var(--success-color);
    background: rgba(14, 203, 129, 0.1);
}

.stat-card-info .stat-icon {
    color: var(--warning-color);
    background: rgba(252, 213, 53, 0.1);
}

.stat-icon svg {
    width: 28px;
    height: 28px;
}

.stat-content {
    flex: 1;
}

.stat-content h3 {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.stat-content span {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    display: block;
}

/* Table Wrapper */
.table-wrapper {
    background: linear-gradient(135deg, var(--card-background) 0%, rgba(30, 35, 41, 0.8) 100%);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.table-header-section {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(24, 26, 32, 0.5);
    gap: 16px;
}

.table-header-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 6px 0;
}

.table-title-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.scroll-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.8;
    animation: scrollHintPulse 2s ease-in-out infinite alternate;
}

.scroll-hint svg {
    color: var(--primary-color);
    flex-shrink: 0;
}

@keyframes scrollHintPulse {
    0% {
        opacity: 0.5;
        transform: translateX(0);
    }
    100% {
        opacity: 0.8;
        transform: translateX(2px);
    }
}

.table-info {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.table-info span {
    color: var(--primary-color);
    font-weight: 600;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
    border-radius: 8px;
}

.btn-secondary {
    background-color: var(--text-secondary);
    color: var(--secondary-color);
}

.btn-secondary:hover {
    background-color: var(--text-primary);
    color: var(--secondary-color);
}

/* Full Screen Modal for Token Details */
.token-details-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    background: var(--background-color);
}

.token-details-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
}

.token-details-content {
    position: relative;
    width: 100vw;
    height: 100vh;
    background: var(--background-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.token-details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: linear-gradient(135deg, var(--card-background) 0%, rgba(30, 35, 41, 0.95) 100%);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    flex-shrink: 0;
}

.token-details-header h2 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0;
}

.token-details-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.token-details-table-container {
    flex: 1;
    overflow: auto;
    padding: 20px 30px;
    background: var(--background-color);
}

/* Full Screen Table Styles */
#tokenDetailsTableFullScreen {
    font-size: 0.8rem;
    min-width: 2800px; /* Even larger for full screen */
    background: var(--card-background);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

#tokenDetailsTableFullScreen th {
    font-size: 0.75rem;
    padding: 12px 8px;
    white-space: nowrap;
    font-weight: 600;
    background: linear-gradient(135deg, var(--card-background) 0%, rgba(30, 35, 41, 0.8) 100%);
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-primary);
}

#tokenDetailsTableFullScreen td {
    font-size: 0.8rem;
    padding: 10px 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-bottom: 1px solid rgba(43, 49, 57, 0.6);
    line-height: 1.4;
}

#tokenDetailsTableFullScreen .token-info {
    min-width: 0;
    max-width: 140px;
}

#tokenDetailsTableFullScreen .token-info > div > div:first-child {
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

#tokenDetailsTableFullScreen .token-info small {
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-secondary);
}

#tokenDetailsTableFullScreen .token-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Column widths for full screen - even more generous */
#tokenDetailsTableFullScreen th:nth-child(1),
#tokenDetailsTableFullScreen td:nth-child(1) {
    min-width: 140px;
    max-width: 180px;
    position: sticky;
    left: 0;
    z-index: 5;
    background: linear-gradient(135deg, var(--card-background) 0%, rgba(30, 35, 41, 0.95) 100%);
    border-right: 2px solid var(--border-color);
}

#tokenDetailsTableFullScreen th:nth-child(2),
#tokenDetailsTableFullScreen td:nth-child(2) {
    min-width: 80px;
    max-width: 120px;
}

#tokenDetailsTableFullScreen th:nth-child(3),
#tokenDetailsTableFullScreen td:nth-child(3) {
    min-width: 100px;
    max-width: 140px;
}

#tokenDetailsTableFullScreen th:nth-child(4),
#tokenDetailsTableFullScreen td:nth-child(4) {
    min-width: 90px;
    max-width: 120px;
}

#tokenDetailsTableFullScreen th:nth-child(5),
#tokenDetailsTableFullScreen td:nth-child(5) {
    min-width: 90px;
    max-width: 120px;
}

#tokenDetailsTableFullScreen th:nth-child(6),
#tokenDetailsTableFullScreen td:nth-child(6) {
    min-width: 110px;
    max-width: 140px;
}

#tokenDetailsTableFullScreen th:nth-child(n+7):nth-child(-n+10),
#tokenDetailsTableFullScreen td:nth-child(n+7):nth-child(-n+10) {
    min-width: 120px;
    max-width: 150px;
}

#tokenDetailsTableFullScreen th:nth-child(n+11):nth-child(-n+15),
#tokenDetailsTableFullScreen td:nth-child(n+11):nth-child(-n+15) {
    min-width: 90px;
    max-width: 130px;
}

#tokenDetailsTableFullScreen th:nth-child(n+16):nth-child(-n+20),
#tokenDetailsTableFullScreen td:nth-child(n+16):nth-child(-n+20) {
    min-width: 80px;
    max-width: 120px;
}

#tokenDetailsTableFullScreen th:nth-child(n+21):nth-child(-n+25),
#tokenDetailsTableFullScreen td:nth-child(n+21):nth-child(-n+25) {
    min-width: 90px;
    max-width: 130px;
}

#tokenDetailsTableFullScreen th:nth-child(n+26):nth-child(-n+31),
#tokenDetailsTableFullScreen td:nth-child(n+26):nth-child(-n+31) {
    min-width: 80px;
    max-width: 120px;
}

/* Full screen table scrolling */
.token-details-table-container::-webkit-scrollbar {
    width: 16px;
    height: 16px;
}

.token-details-table-container::-webkit-scrollbar-track {
    background: var(--border-color);
    border-radius: 8px;
}

.token-details-table-container::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 8px;
    border: 3px solid var(--border-color);
}

.token-details-table-container::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

/* Row hover effects for full screen */
#tokenDetailsTableFullScreen tbody tr:hover {
    background-color: rgba(240, 185, 11, 0.08);
}

.table-container {
    overflow-x: auto;
    overflow-y: visible;
    max-height: 70vh;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--border-color);
    position: relative;
}

.table-container::-webkit-scrollbar {
    height: 12px;
}

.table-container::-webkit-scrollbar-track {
    background: var(--border-color);
    border-radius: 6px;
}

.table-container::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 6px;
    border: 2px solid var(--border-color);
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

/* Sticky header for better table navigation */
.table-container table thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: linear-gradient(135deg, var(--card-background) 0%, rgba(30, 35, 41, 0.95) 100%);
}

/* First column sticky for better row identification */
.table-container table tbody td:first-child {
    position: sticky;
    left: 0;
    z-index: 5;
    background: linear-gradient(135deg, var(--card-background) 0%, rgba(30, 35, 41, 0.95) 100%);
    border-right: 1px solid var(--border-color);
}

/* Enhanced table border radius for scrollable content */
.table-wrapper {
    border-radius: 16px;
    overflow: hidden;
}

.table-wrapper .table-container {
    border-radius: 0 0 16px 16px;
}

table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

/* Optimize column widths */
th:nth-child(1), td:nth-child(1) {
    min-width: 120px;
    max-width: 180px;
}

th:nth-child(2), td:nth-child(2) {
    min-width: 70px;
    max-width: 100px;
}

th:nth-child(3), td:nth-child(3),
th:nth-child(4), td:nth-child(4) {
    min-width: 90px;
    max-width: 130px;
}

th:nth-child(5), td:nth-child(5),
th:nth-child(6), td:nth-child(6) {
    min-width: 80px;
    max-width: 110px;
}

th:nth-child(7), td:nth-child(7),
th:nth-child(8), td:nth-child(8) {
    min-width: 100px;
    max-width: 140px;
}

th:nth-child(9), td:nth-child(9) {
    min-width: 90px;
    max-width: 130px;
}

th:nth-child(10), td:nth-child(10) {
    min-width: 90px;
    max-width: 110px;
}

thead {
    background-color: rgba(24, 26, 32, 0.6);
}

th {
    padding: 10px 8px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sortable {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.3s ease;
    position: relative;
}

.sortable:hover {
    background-color: rgba(240, 185, 11, 0.1);
}

.sortable.active {
    background-color: rgba(240, 185, 11, 0.15);
    color: var(--primary-color);
}

td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

tbody tr {
    transition: background-color 0.2s ease;
}

tbody tr:hover {
    background-color: rgba(240, 185, 11, 0.05);
}

tbody tr:last-child td {
    border-bottom: none;
}

.no-data {
    text-align: center;
    padding: 60px 20px !important;
    color: var(--text-secondary);
}

.no-data-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.no-data-content svg {
    color: var(--text-secondary);
    opacity: 0.5;
}

.no-data-content p {
    font-size: 1rem;
    margin: 0;
}

.token-info {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.token-info > div {
    min-width: 0;
    flex: 1;
}

.token-info > div > div:first-child {
    font-size: 0.95rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.token-info small {
    font-size: 0.8rem;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.token-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-color);
    flex-shrink: 0;
}

.price {
    font-weight: 600;
    font-family: 'Inter', monospace;
    font-size: 0.95rem;
    white-space: nowrap;
}

td strong {
    font-size: 0.95rem;
    font-weight: 600;
}

.positive {
    color: var(--success-color);
    font-weight: 600;
}

.negative {
    color: var(--danger-color);
    font-weight: 600;
}

.neutral {
    color: var(--text-secondary);
}

.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: inline-block;
    white-space: nowrap;
}

.status-arbitrage {
    background-color: rgba(14, 203, 129, 0.2);
    color: var(--success-color);
    border: 1px solid rgba(14, 203, 129, 0.3);
}

.status-no-arbitrage {
    background-color: rgba(132, 142, 156, 0.2);
    color: var(--text-secondary);
    border: 1px solid rgba(132, 142, 156, 0.3);
}

.status-error {
    background-color: rgba(246, 70, 93, 0.2);
    color: var(--danger-color);
    border: 1px solid rgba(246, 70, 93, 0.3);
}

/* Bitget-specific styles */
#bitgetTable .price {
    font-family: 'Inter', monospace;
    font-weight: 600;
    color: #6a5acd; /* Bitget-specific color */
}

#bitgetTable .positive {
    color: #4CAF50;
    font-weight: 600;
}

#bitgetTable .negative {
    color: #f44336;
    font-weight: 600;
}

#bitgetTable .status-arbitrage {
    background-color: rgba(106, 90, 205, 0.2);
    color: #6a5acd;
    border: 1px solid rgba(106, 90, 205, 0.3);
}

#bitgetTable .status-no-arbitrage {
    background-color: rgba(132, 142, 156, 0.2);
    color: var(--text-secondary);
    border: 1px solid rgba(132, 142, 156, 0.3);
}

/* OKX-specific styles */
#okxTable .price {
    font-family: 'Inter', monospace;
    font-weight: 600;
    color: #ff6b6b; /* OKX-specific color */
}

#okxTable .positive {
    color: #51cf66;
    font-weight: 600;
}

#okxTable .negative {
    color: #ff6b6b;
    font-weight: 600;
}

#okxTable .status-arbitrage {
    background-color: rgba(255, 107, 107, 0.2);
    color: #ff6b6b;
    border: 1px solid rgba(255, 107, 107, 0.3);
}

#okxTable .status-no-arbitrage {
    background-color: rgba(132, 142, 156, 0.2);
    color: var(--text-secondary);
    border: 1px solid rgba(132, 142, 156, 0.3);
}

/* Error Container */
.error-container {
    background-color: rgba(246, 70, 93, 0.1);
    border: 1px solid var(--danger-color);
    border-radius: 12px;
    padding: 20px 24px;
    margin-top: 24px;
}

.error-message h3 {
    color: var(--danger-color);
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.error-message p {
    color: var(--text-primary);
    margin: 0;
}

/* Footer */
.app-footer {
    background: linear-gradient(135deg, var(--card-background) 0%, rgba(30, 35, 41, 0.95) 100%);
    border-top: 1px solid var(--border-color);
    margin-top: auto;
    padding: 32px 24px 24px;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
}

.footer-info p {
    margin: 0 0 8px 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

.footer-note {
    font-size: 0.85rem !important;
    opacity: 0.8;
    font-style: italic;
}

/* Animations */
@keyframes pulse {
    0%, 100% { 
        opacity: 1;
        transform: scale(1);
    }
    50% { 
        opacity: 0.7;
        transform: scale(1.1);
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .header-content {
        flex-wrap: wrap;
    }
    
    .controls-section {
        flex-direction: column;
        align-items: stretch;
    }
    
    .controls-left,
    .controls-right {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .search-box {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    main {
        padding: 20px 16px;
    }
    
    .header-content {
        padding: 16px;
    }
    
    .brand h1 {
        font-size: 1.5rem;
    }
    
    
    .stats-container {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .stat-content span {
        font-size: 1.75rem;
    }
    
    .controls-section {
        padding: 16px;
    }
    
    .controls-left {
        flex-direction: column;
        min-width: auto;
    }
    
    .search-box {
        width: 100%;
    }
    
    .filter-select {
        width: 100%;
    }
    
    .controls-right {
        flex-direction: column;
        width: 100%;
    }
    
    .last-update {
        align-items: flex-start;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        min-width: 900px;
    }
    
    th, td {
        padding: 8px 6px;
        font-size: 0.75rem;
    }
    
    .token-icon {
        width: 20px;
        height: 20px;
    }
    
    .token-info > div > div:first-child {
        font-size: 0.75rem;
    }
    
    .token-info small {
        font-size: 0.65rem;
    }
    
    .status-badge {
        padding: 3px 6px;
        font-size: 0.65rem;
    }
    
    .table-header-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .logo {
        width: 40px;
        height: 40px;
    }
    
    .logo svg {
        width: 32px;
        height: 32px;
    }
    
    .brand h1 {
        font-size: 1.3rem;
    }
    
    .brand .tagline {
        font-size: 0.8rem;
    }
    
}

/* Settings Modal (Telegram + Hacim) */
.settings-modal {
    position: fixed;
    inset: 0;
    z-index: 999;
    display: none;
}

.settings-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
}

.settings-content {
    position: relative;
    max-width: 520px;
    margin: 60px auto;
    background: radial-gradient(circle at top, rgba(240, 185, 11, 0.06), transparent) var(--card-background);
    border-radius: 18px;
    border: 1px solid rgba(240, 185, 11, 0.22);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6);
    padding: 20px 22px 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.settings-header h2 {
    font-size: 1.1rem;
    color: var(--primary-color);
    margin: 0;
}

.settings-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 22px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.settings-close:hover {
    background: rgba(132, 142, 156, 0.18);
    color: var(--text-primary);
}

.settings-section {
    padding: 8px 0 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.settings-section h3 {
    font-size: 0.9rem;
    color: var(--text-primary);
    margin: 4px 0 0;
}

.settings-description {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0;
}

.settings-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.settings-row label {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.settings-input {
    padding: 8px 10px;
    background: var(--input-bg);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.85rem;
    outline: none;
    transition: all 0.25s ease;
}

.settings-input::placeholder {
    color: var(--text-secondary);
}

.settings-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(240, 185, 11, 0.14);
    background: rgba(30, 35, 41, 0.96);
}

.btn-telegram.send-full {
    margin-top: 6px;
    width: 100%;
    justify-content: center;
}

.settings-footer {
    display: flex;
    justify-content: flex-end;
    padding-top: 8px;
}
