:root {
    --bg-dark: #0a0e17;
    --glass-bg: rgba(20, 25, 40, 0.4);
    --glass-border: rgba(255, 255, 255, 0.08);
    --neon-blue: #00d2ff;
    --neon-purple: #7b2cbf;
    --neon-green: #00e676;
    --neon-red: #ff3d00;
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --font-outfit: 'Outfit', sans-serif;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-outfit);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    padding-bottom: 3rem;
}

/* Background Animated Blobs */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    filter: blur(100px);
}
.blob {
    position: absolute;
    border-radius: 50%;
    opacity: 0.5;
    animation: float 20s infinite alternate;
}
.blob-1 {
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, rgba(0, 210, 255, 0.3) 0%, transparent 70%);
    top: -10%;
    left: -10%;
}
.blob-2 {
    width: 35vw;
    height: 35vw;
    background: radial-gradient(circle, rgba(123, 44, 191, 0.3) 0%, transparent 70%);
    bottom: -10%;
    right: -10%;
    animation-delay: -5s;
}
.blob-3 {
    width: 30vw;
    height: 30vw;
    background: radial-gradient(circle, rgba(0, 230, 118, 0.15) 0%, transparent 70%);
    top: 50%;
    left: 40%;
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 50px) scale(1.1); }
}

.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Glassmorphism utility */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* Header */
header.glass-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 100px;
    margin-bottom: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 800;
}
.logo i {
    color: #f7931a; /* BTC Orange */
    font-size: 2rem;
}
.highlight {
    color: var(--neon-blue);
}

.global-btc-price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}
.global-btc-price .label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.global-btc-price .value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--neon-green);
}

/* Main Grid */
.top-widgets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.widget {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    min-height: 250px;
}
.widget h3 {
    font-weight: 600;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}
.widget .subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.chart-container {
    flex-grow: 1;
    position: relative;
    width: 100%;
    min-height: 180px;
}

/* Fear and Greed */
.fgi-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-grow: 1;
}
.fgi-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: conic-gradient(var(--neon-red) 0%, #ff9800 25%, #ffeb3b 50%, var(--neon-green) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    transition: background 0.5s ease;
}
.fgi-circle::after {
    content: '';
    position: absolute;
    width: 130px;
    height: 130px;
    background: #0d121d; /* Slightly lighter than var(--bg-dark) */
    border-radius: 50%;
    z-index: 1;
}
.fgi-value {
    position: relative;
    z-index: 2;
    font-size: 2.8rem;
    font-weight: 800;
}
.fgi-label {
    position: relative;
    z-index: 2;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

/* Wallets Section */
.wallets-section {
    padding: 2rem;
    min-height: 400px;
}
.wallets-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}
.wallets-header h2 {
    font-weight: 800;
}

.wallet-tabs {
    display: flex;
    gap: 0.5rem;
    flex-grow: 1;
    margin: 0 2rem;
    overflow-x: auto;
    padding-bottom: 0.5rem; /* for scrollbar */
}
.wallet-tabs::-webkit-scrollbar {
    height: 6px;
}
.wallet-tabs::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
}
.wallet-tab {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    padding: 0.5rem 1.5rem;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 100px;
    transition: all 0.3s;
    white-space: nowrap;
}
.wallet-tab:hover {
    color: var(--text-main);
    background: rgba(255,255,255,0.05);
}
.wallet-tab.active {
    background: var(--neon-blue);
    color: var(--bg-dark);
    border-color: var(--neon-blue);
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.4);
}

button {
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s;
    outline: none;
}
.btn-primary {
    background: linear-gradient(135deg, var(--neon-purple), #4a00e0);
    border: none;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 100px;
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(123, 44, 191, 0.4);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(123, 44, 191, 0.6);
}
.btn-secondary {
    background: rgba(0, 210, 255, 0.1);
    border: 1px solid var(--neon-blue);
    color: var(--neon-blue);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
}
.btn-secondary:hover {
    background: var(--neon-blue);
    color: var(--bg-dark);
}
.btn-cancel {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
}
.btn-cancel:hover { color: var(--text-main); }

.wallet-top-split {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    gap: 2rem;
}
.wallet-overview {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.wallet-overview h3 {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}
.portfolio-total {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: -webkit-linear-gradient(0deg, var(--neon-blue), var(--neon-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.portfolio-profit {
    font-size: 1.2rem;
    font-weight: 600;
}
.profit-pos { color: var(--neon-green); }
.profit-neg { color: var(--neon-red); }

.wallet-pie {
    flex: 1;
    max-width: 300px;
    min-width: 250px;
    position: relative;
}

.asset-actions {
    margin-bottom: 2rem;
    background: rgba(0,0,0,0.2);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.05);
}
.asset-actions h3 {
    margin-bottom: 1rem;
    color: var(--text-main);
}
form#addAssetForm {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}
form input, form select {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    flex-grow: 1;
    min-width: 150px;
}
form input:focus, form select:focus {
    border-color: var(--neon-blue);
    background: rgba(0, 0, 0, 0.4);
}
/* Style nicely the select options in dark mode */
form select option {
    background: var(--bg-dark);
    color: var(--text-main);
}

/* Table */
.wallet-table-container {
    overflow-x: auto;
}
table.wallet-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}
table.wallet-table th {
    color: var(--text-muted);
    font-weight: 600;
    padding: 1rem;
    border-bottom: 1px solid var(--glass-border);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
}
table.wallet-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    vertical-align: middle;
}
table.wallet-table tbody tr:hover {
    background: rgba(255,255,255,0.02);
}

.coin-info {
    display: flex;
    align-items: center;
    gap: 12px;
}
.coin-info img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #fff;
    padding: 2px;
}
.coin-name { font-weight: 600; }
.coin-symbol { color: var(--text-muted); font-size: 0.8rem; text-transform: uppercase; }

.btn-delete {
    background: transparent;
    border: none;
    color: var(--neon-red);
    cursor: pointer;
    font-size: 1.2rem;
    opacity: 0.7;
    transition: 0.3s;
    padding: 0.5rem;
}
.btn-delete:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Zero State */
.zero-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}
.zero-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: rgba(255,255,255,0.1);
}
.zero-state h3 {
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.modal.active {
    display: flex;
}
.modal-content {
    padding: 2rem;
    width: 90%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    animation: slideUp 0.3s ease-out forwards;
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.modal-content h2 { font-weight: 800; }
.modal-content input {
    background: rgba(0,0,0,0.4);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 1rem;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1.1rem;
    width: 100%;
    outline: none;
}
.modal-content input:focus {
    border-color: var(--neon-blue);
}
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .top-widgets { grid-template-columns: 1fr; }
    .wallet-top-split { flex-direction: column; text-align: center; }
    .wallet-overview { align-items: center; }
    .wallet-pie { align-self: center; margin-top: 1rem; }
    .wallet-tabs { margin: 0; }
}
@media (max-width: 768px) {
    header.glass-header { flex-direction: column; gap: 1rem; padding: 1.5rem; text-align: center; border-radius: 20px;}
    .global-btc-price { align-items: center; }
}
