/* Modern Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Premium Palette */
    --primary: #5d5fef;
    --primary-hover: #4b4dcf;
    --secondary: #1a1d1f;
    /* Dark Grey/Black for strong contrast */
    --bg-body: #F4F6FA;
    --bg-surface: #ffffff;
    --text-main: #11142d;
    --text-muted: #808191;
    --border: #E4E5E7;

    /* Functional Colors */
    --success: #26A17B;
    --danger: #FF754C;
    --warning: #F7931A;

    /* Spacing & Radius */
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 12px;

    /* Shadows - Soft & Premium */
    --shadow-card: 0px 14px 40px rgba(118, 118, 118, 0.08);
    --shadow-hover: 0px 20px 50px rgba(118, 118, 118, 0.15);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-body);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Dark Mode Theme */
[data-theme="dark"] {
    --bg-body: #111315;
    --bg-surface: #1a1d1f;
    --text-main: #efefef;
    --text-muted: #808191;
    /* Keep or adjust lightness */
    --border: #272b30;
    --secondary: #272b30;

    --shadow-card: 0px 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-hover: 0px 8px 32px rgba(0, 0, 0, 0.5);

    /* Adjust functional colors if needed for dark mode contrast */
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    height: 100vh;
    overflow: hidden;
    /* App-like feel */
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

/* Typography */
h1,
h2,
h3,
h4 {
    font-weight: 700;
    letter-spacing: -0.02em;
}

.text-muted {
    color: var(--text-muted);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Common Components */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(93, 95, 239, 0.3);
}

.btn-secondary {
    background-color: transparent;
    border: 2px solid var(--border);
    color: var(--secondary);
}

.btn-secondary:hover {
    border-color: var(--secondary);
}

/* Auth Pages (Split Layout) */
.auth-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: 100vh;
    width: 100vw;
}

.auth-container-center {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100vw;
    background: var(--bg-body);
}

.auth-hero {
    background: var(--primary);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    padding: 4rem;
    position: relative;
    overflow: hidden;
}

.auth-hero::before {
    content: '';
    position: absolute;
    width: 150%;
    height: 150%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 70%);
    top: -50%;
    left: -50%;
    animation: rotate 20s infinite linear;
}

.auth-brand {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    z-index: 1;
}

.auth-sub {
    font-size: 1.25rem;
    opacity: 0.9;
    text-align: center;
    max-width: 400px;
    z-index: 1;
}

.auth-form-wrapper {
    background: var(--bg-surface);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    animation: fadeIn 0.6s ease-out;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--secondary);
}

.modern-input {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s;
    background: #fcfcfc;
}

.modern-input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(93, 95, 239, 0.1);
}

/* Dashboard Layout */
.dashboard-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.content-wrapper {
    flex: 1;
    display: flex;
    overflow-y: auto;
    /* Scrollbar here */
    height: 100vh;
    position: relative;
}

/* Left Sidebar */
.sidebar-left {
    width: 280px;
    flex-shrink: 0;
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

.brand-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--primary);
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 3rem;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    color: var(--text-muted);
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.nav-link:hover,
.nav-link.active {
    background: var(--bg-body);
    /* Slightly lighter/diff than surface? actually body bg is ideal */
    color: var(--text-main);
}

.nav-link.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 8px 20px rgba(93, 95, 239, 0.25);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2.5rem 3rem;
    /* overflow handled by wrapper */
}

/* ... existing styles ... */

/* Right Sidebar */
.sidebar-right {
    width: 340px;
    flex-shrink: 0;
    background: var(--bg-surface);
    border-left: 1px solid var(--border);
    padding: 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    /* Ensure full height in wrapper */
}

.page-header {
    margin-bottom: 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-title {
    font-size: 2rem;
    font-weight: 800;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.status-widget {
    background: var(--bg-surface);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    gap: 1.25rem;
    box-shadow: var(--shadow-card);
    transition: transform 0.3s;
}

.status-widget:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.asset-table {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 1.5rem;
}

.table-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.asset-row {
    display: grid;
    grid-template-columns: 50px 2fr 1.5fr 1fr auto;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}

.asset-row:hover {
    background: var(--bg-body);
}

.asset-row:last-child {
    border-bottom: none;
}

.coin-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.coin-btc {
    background: var(--warning);
}

.coin-eth {
    background: #627eea;
}

.coin-usdt {
    background: var(--success);
}

/* Right Sidebar */
.sidebar-right {
    width: 340px;
    flex-shrink: 0;
    background: var(--bg-surface);
    border-left: 1px solid var(--border);
    padding: 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.chart-wrapper {
    margin-bottom: 3rem;
    position: relative;
    height: 250px;
    width: 100%;
}

.action-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 3rem;
}

.action-btn {
    flex: 1;
    padding: 1rem;
    border-radius: var(--radius-md);
    border: none;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.btn-deposit {
    background: var(--success);
}

.btn-withdraw {
    background: var(--primary);
}

.contact-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.contact-row:hover {
    background: var(--bg-body);
}

/* Utilities */
.hidden {
    display: none;
}

.alert {
    padding: 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    background: #fee2e2;
    color: var(--danger);
    font-weight: 500;
}


/* Components - Cards & Modals */
.card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-card);
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary);
}

.icon-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: transform 0.2s;
}

.card:hover .icon-circle {
    transform: scale(1.1);
}

/* Badges */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-success {
    background: rgba(38, 161, 123, 0.15);
    color: var(--success);
}

.badge-warning {
    background: rgba(247, 147, 26, 0.15);
    color: var(--warning);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease-out;
}

.modal-box {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
    animation: slideInUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid var(--border);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal-close:hover {
    background: var(--bg-body);
    color: var(--danger);
    transform: rotate(90deg);
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 2px dashed var(--border);
    margin-top: 2rem;
}

.empty-state h3 {
    margin: 1rem 0 0.5rem;
    font-size: 1.5rem;
}

.empty-state p {
    max-width: 400px;
    margin-bottom: 2rem;
}

/* Animations */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Top Navigation Styles */
.navbar-top {
    height: 80px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-links {
    display: flex;
    gap: 0.5rem;
    height: 100%;
    align-items: center;
}

.top-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 1.5rem;
    color: var(--text-muted);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    height: 100%;
    border-bottom: 3px solid transparent;
    font-size: 0.95rem;
}

.top-nav-link i {
    font-size: 1.1rem;
}

.top-nav-link:hover {
    color: var(--primary);
    background: linear-gradient(to bottom, transparent 90%, rgba(93, 95, 239, 0.05) 100%);
}

.top-nav-link.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Layout modifications for Top Nav */
.dashboard-layout.top-nav {
    flex-direction: column;
}

.dashboard-layout.top-nav .content-wrapper {
    height: calc(100vh - 80px);
    overflow-y: auto;
    width: 100%;
}

.dashboard-layout.top-nav .main-content {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    padding: 2rem;
}