/* ===== Theme Toggle Switch ===== */
.theme-toggle-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.theme-icon {
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: var(--transition);
}

.theme-toggle-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem 0;
    border-top: 1px solid #1f2937;
    margin-top: 1rem;
}

.theme-label {
    font-size: 0.85rem;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    user-select: none;
}

.theme-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}

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

.theme-switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #374151;
    border-radius: 28px;
    transition: 0.4s;
}

.theme-switch .slider::before {
    content: '';
    position: absolute;
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background: #f0f6fc;
    border-radius: 50%;
    transition: 0.4s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.theme-switch input:checked+.slider {
    background: #58a6ff;
}

.theme-switch input:checked+.slider::before {
    transform: translateX(24px);
    background: #ffffff;
}

/* ===== Light Mode Overrides ===== */
body.light-mode {
    --bg-color: #f0f2f5;
    --panel-bg: rgba(255, 255, 255, 0.85);
    --border-color: rgba(209, 213, 219, 0.8);
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --accent-color: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-glow: rgba(37, 99, 235, 0.2);
    --modal-bg: #ffffff;
    --modal-border: #e5e7eb;
    --row-green-border: rgba(46, 160, 67, 0.6);
    --row-red-border: rgba(248, 81, 73, 0.6);

    background-color: var(--bg-color);
    background-image: radial-gradient(circle at top right, rgba(37, 99, 235, 0.05), transparent 40%),
        radial-gradient(circle at bottom left, rgba(46, 160, 67, 0.05), transparent 40%);
    color: var(--text-primary);
}

body.light-mode .glass-header,
body.light-mode .glass-panel {
    background: var(--panel-bg);
    border-color: var(--border-color);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

body.light-mode th {
    background: #f8fafc;
    color: #2563eb;
}

body.light-mode tbody tr {
    background: #ffffff;
}

body.light-mode tbody tr:hover {
    background: #f1f5f9;
}

body.light-mode td {
    color: #1f2937;
    border-bottom-color: rgba(0, 0, 0, 0.06);
}

body.light-mode .table-responsive {
    background-color: #ffffff;
    border-color: var(--border-color);
}

body.light-mode .form-group input,
body.light-mode .form-group select {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #1f2937;
}

body.light-mode .form-group input:focus,
body.light-mode .form-group select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

body.light-mode .submit-btn {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

body.light-mode .submit-btn:hover {
    background: #1d4ed8;
}

body.light-mode .action-btn.highlight {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}

body.light-mode .action-btn.outline {
    border-color: #d1d5db;
    color: #374151;
}

body.light-mode .action-btn.outline:hover {
    background: rgba(0, 0, 0, 0.04);
    border-color: #9ca3af;
}

body.light-mode .modal-content {
    background: var(--modal-bg);
    border-color: var(--modal-border);
}

body.light-mode .new-about-modal {
    background: #ffffff;
    border-color: #e5e7eb;
}

body.light-mode .add-asset-modal-content {
    background: #ffffff;
    border-color: #e5e7eb;
}

body.light-mode .toast {
    background: rgba(255, 255, 255, 0.95);
    border-color: var(--row-green-border);
    color: #1f2937;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

body.light-mode .toast.error {
    border-color: var(--row-red-border);
}

body.light-mode .total-balance-inline {
    background: rgba(37, 99, 235, 0.08);
    border-color: #2563eb;
}

body.light-mode .balance-value {
    color: #2563eb;
}

body.light-mode .amount-bar-fill {
    background: linear-gradient(90deg, #2563eb, #60a5fa);
}

body.light-mode .search-box input {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #1f2937;
}

body.light-mode .about-footer {
    border-top-color: #e5e7eb;
    color: #9ca3af;
}

body.light-mode .theme-toggle-section {
    border-top-color: #e5e7eb;
}

body.light-mode .theme-label {
    color: #6b7280;
}

body.light-mode .floating-slogan-badge {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    border-color: rgba(0, 0, 0, 0.1);
}

/* Light mode overrides for new components */
body.light-mode .suggest-dropdown {
    background: #ffffff;
    border-color: #d1d5db;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}

body.light-mode .suggest-item {
    color: #1f2937;
}

body.light-mode .suggest-item:hover {
    background: rgba(37, 99, 235, 0.05);
}

body.light-mode .suggest-symbol {
    color: #1f2937;
}

body.light-mode .suggest-name {
    color: #4b5563;
}

body.light-mode .coin-api-info-box {
    background: rgba(37, 99, 235, 0.03);
    border-color: rgba(37, 99, 235, 0.15);
}

body.light-mode #infoCoinText {
    color: #1f2937;
}

body.light-mode .manual-fields-section {
    background: rgba(0, 0, 0, 0.01);
    border-color: #d1d5db;
}

body.light-mode .manual-fields-title {
    color: #d29922;
}

body.light-mode .coin-table-logo-fallback {
    background: #f3f4f6;
    color: #6b7280;
    border-color: #d1d5db;
}

body.light-mode .asset-fullname {
    color: #6b7280;
}

/* Portfolio table column width optimizations */
#portfolioTable th:nth-child(1),
#portfolioTable td:nth-child(1) {
    min-width: 180px;
}

#portfolioTable th:nth-child(2),
#portfolioTable td:nth-child(2) {
    min-width: 160px;
}

#portfolioTable th:nth-child(3),
#portfolioTable td:nth-child(3),
#portfolioTable th:nth-child(4),
#portfolioTable td:nth-child(4) {
    min-width: 120px;
}

#portfolioTable th:nth-child(5),
#portfolioTable td:nth-child(5) {
    min-width: 180px;
}

#portfolioTable th:nth-child(6),
#portfolioTable td:nth-child(6) {
    min-width: 90px;
    text-align: center;
}

#portfolioTable th:nth-child(7),
#portfolioTable td:nth-child(7) {
    min-width: 90px;
    text-align: center;
}
/* Light mode support */
body.light-mode .watchlist-add-form input {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.15);
}

/* Column specific widths for Watchlist to keep it clean */
#watchlistTable th, #watchlistTable td {
    padding: 1rem;
}

#watchlistTable th:nth-child(1),
#watchlistTable td:nth-child(1) {
    min-width: 150px;
}

#watchlistTable th:nth-child(2),
#watchlistTable td:nth-child(2) {
    min-width: 150px;
    font-weight: 600;
}

#watchlistTable th:nth-child(3),
#watchlistTable td:nth-child(3) {
    min-width: 150px;
    text-align: center;
}


