.nav-link {
    @apply dark:text-binance-gray text-gray-500 hover:text-binance-yellow transition-colors py-2 px-1 border-b-2 border-transparent;
}

.nav-link.active {
    @apply text-binance-yellow border-binance-yellow;
}

.btn-primary {
    @apply bg-binance-yellow text-binance-dark font-medium px-4 py-2 rounded-lg hover:bg-binance-yellow-hover transition-all duration-200 transform hover:scale-105;
}

.stat-card {
    @apply dark:bg-binance-dark-2 bg-white rounded-xl p-5 dark:border-binance-dark-3 border-gray-200 border transition-all duration-200 hover:border-binance-yellow hover:border-opacity-30;
}

.card {
    @apply dark:bg-binance-dark-2 bg-white rounded-xl p-5 dark:border-binance-dark-3 border-gray-200 border transition-colors duration-300;
}

.mini-widget {
    @apply dark:bg-binance-dark-2 bg-white rounded-lg p-4 dark:border-binance-dark-3 border-gray-200 border transition-all duration-200 hover:border-binance-yellow hover:border-opacity-50;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #181a20;
    border-top-color: #f0b90b;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.light .spinner {
    border-color: #e5e7eb;
    border-top-color: #f0b90b;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-card, .card, .mini-widget {
    animation: fadeIn 0.3s ease-out;
}

.stat-card:nth-child(2) { animation-delay: 0.1s; }
.stat-card:nth-child(3) { animation-delay: 0.2s; }
.stat-card:nth-child(4) { animation-delay: 0.3s; }

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.dark ::-webkit-scrollbar-track {
    background: #0b0e11;
}

.light ::-webkit-scrollbar-track {
    background: #f3f4f6;
}

.dark ::-webkit-scrollbar-thumb {
    background: #1e2329;
    border-radius: 4px;
}

.light ::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2b3139;
}

.light ::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

table {
    border-collapse: separate;
    border-spacing: 0;
}

tbody tr {
    animation: fadeIn 0.2s ease-out;
}

tbody tr:nth-child(1) { animation-delay: 0.05s; }
tbody tr:nth-child(2) { animation-delay: 0.1s; }
tbody tr:nth-child(3) { animation-delay: 0.15s; }
tbody tr:nth-child(4) { animation-delay: 0.2s; }
tbody tr:nth-child(5) { animation-delay: 0.25s; }

@media (max-width: 640px) {
    .stat-card {
        @apply p-4;
    }
    
    .stat-card p.text-2xl {
        @apply text-xl;
    }
    
    table {
        font-size: 0.875rem;
    }
    
    th, td {
        @apply px-2 py-2;
    }
}

.rotating {
    animation: spin 1s linear infinite;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

input, button, select, textarea {
    font-family: inherit;
}

@supports (-webkit-touch-callout: none) {
    body {
        min-height: -webkit-fill-available;
    }
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #1e2329;
    transition: 0.3s;
    border-radius: 24px;
}

.light .toggle-slider {
    background-color: #d1d5db;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: #848e9c;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #f0b90b;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
    background-color: #0b0e11;
}

.theme-btn {
    @apply dark:bg-binance-dark-3 bg-gray-100 transition-all duration-200;
}

.pnl-period-btn {
    @apply px-3 py-1.5 text-sm rounded-lg dark:bg-binance-dark-3 bg-gray-100 dark:text-binance-gray text-gray-600 transition-all duration-200;
}

.pnl-period-btn:hover {
    @apply dark:bg-binance-dark bg-gray-200;
}

.pnl-period-btn.active {
    @apply bg-binance-yellow text-binance-dark font-medium;
}

.risk-badge {
    @apply px-2 py-1 rounded text-xs font-medium;
}

.risk-badge.risk-safe {
    @apply bg-binance-green bg-opacity-20 text-binance-green;
}

.risk-badge.risk-warning {
    @apply bg-binance-yellow bg-opacity-20 text-binance-yellow;
}

.risk-badge.risk-danger {
    @apply bg-binance-red bg-opacity-20 text-binance-red animate-pulse;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

#pnl-popup > div {
    animation: slideUp 0.3s ease-out;
}

#pnl-popup-content .emoji {
    font-size: 4rem;
    margin-bottom: 1rem;
}

#pnl-popup-content .pnl-value {
    font-size: 2rem;
    font-weight: bold;
    margin: 0.5rem 0;
}

#pnl-popup-content .pnl-positive {
    color: #0ecb81;
}

#pnl-popup-content .pnl-negative {
    color: #f6465d;
}

#pnl-popup-content .pnl-neutral {
    color: #f0b90b;
}

#pnl-popup-content .message {
    font-size: 1.1rem;
    margin-top: 0.5rem;
}

.dark #pnl-popup-content .message {
    color: #848e9c;
}

.light #pnl-popup-content .message {
    color: #6b7280;
}
