:root {
    --bg-dark: #0f111a;
    --bg-card: rgba(26, 29, 41, 0.7);
    --bg-hover: rgba(45, 49, 70, 0.8);
    --text-main: #f0f2f5;
    --text-muted: #94a3b8;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --positive: #10b981;
    --negative: #ef4444;
    
    --c-coc: #eab308;
    --c-pxc: #06b6d4;
    --c-vxc: #a855f7;

    --font: 'Inter', sans-serif;
    --radius: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: var(--font);
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 85% 30%, rgba(168, 85, 247, 0.08) 0%, transparent 50%);
}

.hidden {
    display: none !important;
}

/* ══════════════ LOGIN SCREEN ══════════════ */
.login-screen {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-dark);
    z-index: 1000;
}

.login-bg-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(59,130,246,0.15) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    animation: pulseGlow 4s infinite alternate;
}

@keyframes pulseGlow {
    from { transform: translate(-50%, -50%) scale(1); opacity: 0.8; }
    to { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
}

.login-card {
    background: rgba(25, 28, 41, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 3rem;
    border-radius: 24px;
    width: 100%;
    max-width: 440px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 10;
}

.login-logo {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.logo-icon { color: var(--accent); }
.logo-accent { color: var(--accent); }

.login-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.login-sub {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}
.login-sub code {
    background: rgba(0,0,0,0.3);
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    color: var(--accent);
}

.login-input-wrap {
    margin-bottom: 1.5rem;
}

.login-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 2rem;
    text-align: center;
    letter-spacing: 0.5rem;
    padding: 1rem;
    border-radius: 12px;
    outline: none;
    transition: var(--transition);
}

.login-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.login-error {
    color: var(--negative);
    background: rgba(239, 68, 68, 0.1);
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-primary {
    width: 100%;
    background: var(--accent);
    color: white;
    border: none;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: var(--transition);
}
.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}
.btn-primary:active {
    transform: translateY(0);
}

/* ══════════════ APP LAYOUT ══════════════ */
.app {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: rgba(20, 22, 33, 0.8);
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
}

.sidebar-logo {
    font-size: 1.5rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 3rem;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 500;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
}

.nav-item:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.03);
}

.nav-item.active {
    color: var(--accent);
    background: rgba(59, 130, 246, 0.1);
}

.sidebar-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 1.5rem;
}

.sidebar-player {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.player-avatar {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.player-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.player-status {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.player-status.online::before {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--positive);
}

.btn-logout {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: rgba(239, 68, 68, 0.1);
    color: var(--negative);
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}
.btn-logout:hover {
    background: rgba(239, 68, 68, 0.2);
}


/* Main Content Area */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem 3rem;
}

.page {
    animation: fadeIn 0.4s ease forwards;
}

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

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2rem;
}

.page-greeting {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
}

/* ══════════════ CARDS & GRID ══════════════ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.stat-card.accent {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(168, 85, 247, 0.1));
    border-color: rgba(59, 130, 246, 0.3);
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-change {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    background: rgba(255,255,255,0.05);
}
.stat-change.positive { color: var(--positive); background: rgba(16, 185, 129, 0.1); }
.stat-change.negative { color: var(--negative); background: rgba(239, 68, 68, 0.1); }

.stat-sub {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.5);
}

.stat-sparkline {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 50%;
    height: 50px;
    opacity: 0.5;
}

.eye-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.2rem;
    transition: var(--transition);
}
.eye-btn:hover { color: white; }


/* ══════════════ CHARTS ══════════════ */
.chart-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius);
    padding: 1.5rem;
    backdrop-filter: blur(10px);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.chart-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.chart-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    background: rgba(255,255,255,0.05);
    margin-top: 0.5rem;
}
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.status-dot.green { background: var(--positive); box-shadow: 0 0 8px var(--positive); }
.status-dot.red { background: var(--negative); box-shadow: 0 0 8px var(--negative); }

.timerange-selector {
    display: flex;
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    padding: 0.25rem;
}
.tr-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}
.tr-btn.active {
    background: rgba(255,255,255,0.1);
    color: white;
}

.chart-currency-tabs {
    display: flex;
    gap: 0.5rem;
}
.cur-tab {
    background: rgba(255,255,255,0.05);
    border: 1px solid transparent;
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.cur-tab.active {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--accent);
    color: var(--accent);
}

.chart-container {
    height: 300px;
    width: 100%;
}


/* ══════════════ SIDE PANEL ══════════════ */
.side-panel {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius);
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
}

.side-panel-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.crypto-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
}

.crypto-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.02);
    transition: var(--transition);
}
.crypto-item:hover {
    background: rgba(255,255,255,0.05);
}

.crypto-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 800;
}
.crypto-icon.coc { background: rgba(234, 179, 8, 0.1); color: var(--c-coc); }
.crypto-icon.pxc { background: rgba(6, 182, 212, 0.1); color: var(--c-pxc); }
.crypto-icon.vxc { background: rgba(168, 85, 247, 0.1); color: var(--c-vxc); }

.crypto-info { flex: 1; }
.crypto-name { font-weight: 600; font-size: 0.95rem; }
.crypto-sym { font-size: 0.8rem; color: var(--text-muted); }

.crypto-amounts { text-align: right; }
.crypto-amount { font-weight: 600; font-family: monospace; font-size: 0.95rem; }
.crypto-value { font-size: 0.8rem; color: var(--text-muted); }


/* ══════════════ TABLES ══════════════ */
.table-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius);
    padding: 1.5rem;
    backdrop-filter: blur(10px);
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.btn-link {
    background: transparent;
    border: none;
    color: var(--accent);
    font-weight: 500;
    cursor: pointer;
}
.btn-link:hover { text-decoration: underline; }

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.85rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.data-table td {
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.02);
    font-size: 0.9rem;
}

.data-table tr:last-child td { border-bottom: none; }

.type-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}
.type-buy { background: rgba(16, 185, 129, 0.1); color: var(--positive); }
.type-sell { background: rgba(239, 68, 68, 0.1); color: var(--negative); }


/* ══════════════ RYNEK ══════════════ */
.market-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.market-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.market-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.market-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
}
.market-icon.coc { background: rgba(234, 179, 8, 0.15); color: var(--c-coc); }
.market-icon.pxc { background: rgba(6, 182, 212, 0.15); color: var(--c-pxc); }
.market-icon.vxc { background: rgba(168, 85, 247, 0.15); color: var(--c-vxc); }

.market-name { font-size: 1.1rem; font-weight: 700; }
.market-sym { color: var(--text-muted); font-size: 0.85rem; }

.market-change {
    margin-left: auto;
    font-weight: 600;
    font-size: 0.9rem;
}
.market-change.positive { color: var(--positive); }
.market-change.negative { color: var(--negative); }

.market-price {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.market-chart-mini {
    height: 60px;
    margin-bottom: 1.5rem;
    opacity: 0.8;
}

.market-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.btn-buy {
    background: rgba(16, 185, 129, 0.1);
    color: var(--positive);
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 0.75rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.btn-buy:hover { background: rgba(16, 185, 129, 0.2); }

.btn-sell {
    background: rgba(239, 68, 68, 0.1);
    color: var(--negative);
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 0.75rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.btn-sell:hover { background: rgba(239, 68, 68, 0.2); }


/* ══════════════ PORTFEL ══════════════ */
.wallet-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.wallet-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius);
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.wallet-card::before {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, transparent 100%);
    pointer-events: none;
}

.wallet-card.coc-bg { border-top: 4px solid var(--c-coc); }
.wallet-card.pxc-bg { border-top: 4px solid var(--c-pxc); }
.wallet-card.vxc-bg { border-top: 4px solid var(--c-vxc); }

.wallet-currency {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.wallet-amount {
    font-size: 2.5rem;
    font-weight: 800;
    font-family: monospace;
    margin-bottom: 0.5rem;
}

.wallet-value {
    color: rgba(255,255,255,0.6);
    font-size: 1rem;
}


/* ══════════════ USTAWIENIA ══════════════ */
.settings-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius);
}

.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.settings-item:last-child { border-bottom: none; }

.settings-label {
    font-weight: 600;
    margin-bottom: 0.25rem;
}
.settings-value {
    color: var(--text-muted);
    font-size: 0.9rem;
}


/* ══════════════ MODALS & TOASTS ══════════════ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 1;
    transition: opacity 0.3s;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-card {
    background: #1a1d29;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    width: 100%;
    max-width: 400px;
    padding: 2rem;
    transform: translateY(0);
    transition: transform 0.3s;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
}

.modal-overlay.hidden .modal-card {
    transform: translateY(20px);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h2 { font-size: 1.5rem; }

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}
.modal-close:hover { color: white; }

.modal-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.modal-label { color: var(--text-muted); font-size: 0.9rem; }

.modal-price { font-weight: 700; font-size: 1.1rem; }

.modal-input {
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
    padding: 0.5rem;
    border-radius: 8px;
    width: 150px;
    text-align: right;
    font-size: 1rem;
}
.modal-input:focus { border-color: var(--accent); outline: none; }

.modal-receive { font-weight: 700; color: var(--positive); font-size: 1.1rem; }

.modal-footer {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-secondary {
    flex: 1;
    background: rgba(255,255,255,0.05);
    color: white;
    border: none;
    padding: 0.8rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
}
.btn-secondary:hover { background: rgba(255,255,255,0.1); }
.modal-footer .btn-primary { flex: 1; }

.modal-error {
    color: var(--negative);
    background: rgba(239, 68, 68, 0.1);
    padding: 0.5rem;
    border-radius: 8px;
    margin-top: 1rem;
    font-size: 0.85rem;
    text-align: center;
}

.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #1a1d29;
    border-left: 4px solid var(--accent);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    z-index: 3000;
    transform: translateX(0);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast.hidden {
    transform: translateX(120%);
    opacity: 0;
}

/* ══════════════ RESPONSIVE ══════════════ */
@media (max-width: 1100px) {
    .stats-grid, .market-grid { grid-template-columns: repeat(2, 1fr); }
    .chart-layout { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .app { flex-direction: column; }
    .sidebar { width: 100%; height: auto; border-right: none; border-bottom: 1px solid rgba(255,255,255,0.05); padding: 1rem; }
    .sidebar-logo { margin-bottom: 1rem; }
    .sidebar-nav { flex-direction: row; flex-wrap: wrap; }
    .sidebar-bottom { display: none; }
    .main-content { padding: 1rem; }
    .stats-grid, .market-grid, .wallet-grid { grid-template-columns: 1fr; }
}
