/*
Theme Name: Kubera
Theme URI: https://example.com/kubera
Author: Your Name
Author URI: https://example.com
Description: A modern financial dashboard theme inspired by Kubera
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: kubera
*/

/* ========================================
   RESET & BASE STYLES
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #1e293b;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    min-height: 100vh;
}

/* ========================================
   DASHBOARD LAYOUT
   ======================================== */
.kubera-dashboard {
    display: flex;
    min-height: 100vh;
}

.dashboard-sidebar {
    width: 260px;
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.dashboard-main {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
}

/* ========================================
   SIDEBAR STYLES
   ======================================== */
.sidebar-logo {
    padding: 24px;
    border-bottom: 1px solid #e2e8f0;
}

.sidebar-logo h1 {
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
}

.sidebar-nav {
    flex: 1;
    padding: 16px;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: 8px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: #64748b;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
    font-weight: 500;
}

.sidebar-nav a:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.sidebar-nav a.active {
    background: #0f172a;
    color: #ffffff;
}

.sidebar-nav .dashicons {
    margin-right: 12px;
    font-size: 20px;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid #e2e8f0;
}

/* ========================================
   HEADER STYLES
   ======================================== */
.dashboard-header {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 90;
}

.search-bar {
    flex: 1;
    max-width: 500px;
}

.search-bar input {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.search-bar input:focus {
    outline: none;
    border-color: #0f172a;
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.1);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background 0.2s;
}

.user-menu:hover {
    background: #f1f5f9;
}

.user-menu img {
    border-radius: 50%;
}

.user-menu span {
    font-weight: 500;
    color: #475569;
}

.logout-link {
    margin-left: 12px;
    padding: 6px 12px;
    background: #f1f5f9;
    color: #0f172a;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    transition: background 0.2s;
}

.logout-link:hover {
    background: #e2e8f0;
}

/* ========================================
   DASHBOARD CONTENT
   ======================================== */
.dashboard-content {
    padding: 32px;
    flex: 1;
    overflow-y: auto;
}

/* Portfolio Summary */
.portfolio-summary {
    margin-bottom: 32px;
}

.portfolio-summary h2 {
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.total-value {
    font-size: 48px;
    font-weight: 700;
    color: #0f172a;
}

.value-change {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin-left: 16px;
}

.value-change.positive {
    background: #dcfce7;
    color: #16a34a;
}

.value-change.negative {
    background: #fee2e2;
    color: #dc2626;
}

/* ========================================
   ASSET GRID
   ======================================== */
.asset-grid {
    margin-bottom: 32px;
}

#asset-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.asset-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    transition: all 0.3s;
    cursor: pointer;
}

.asset-card:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.asset-card h4 {
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    margin-bottom: 8px;
}

.asset-value {
    font-size: 28px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 8px;
}

.asset-change {
    font-size: 14px;
    font-weight: 600;
    display: inline-block;
    padding: 4px 8px;
    border-radius: 6px;
}

.asset-change.positive {
    background: #dcfce7;
    color: #16a34a;
}

.asset-change.negative {
    background: #fee2e2;
    color: #dc2626;
}

.asset-category {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 8px;
}

/* ========================================
   DASHBOARD WIDGETS
   ======================================== */
.dashboard-widgets {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.widget {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
}

.widget h3 {
    font-size: 18px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 20px;
}

/* Chart Widget */
.chart-widget {
    min-height: 400px;
}

#portfolio-chart {
    max-height: 350px;
}

/* Transactions Widget */
.transactions-widget {
    max-height: 500px;
    overflow-y: auto;
}

#transaction-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.transaction-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    border-bottom: 1px solid #f1f5f9;
}

.transaction-item:last-child {
    border-bottom: none;
}

.transaction-info h5 {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 4px;
}

.transaction-info p {
    font-size: 12px;
    color: #94a3b8;
}

.transaction-amount {
    font-size: 16px;
    font-weight: 700;
}

.transaction-amount.positive {
    color: #16a34a;
}

.transaction-amount.negative {
    color: #0f172a;
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: #0f172a;
    color: #ffffff;
}

.btn-primary:hover {
    background: #1e293b;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.3);
}

.btn-secondary {
    background: #f1f5f9;
    color: #0f172a;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

/* ========================================
   LOADING STATES
   ======================================== */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f1f5f9;
    border-top-color: #0f172a;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 1024px) {
    .dashboard-widgets {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .dashboard-sidebar {
        width: 200px;
    }
    
    .dashboard-main {
        margin-left: 200px;
    }
    
    #asset-list {
        grid-template-columns: 1fr;
    }
    
    .dashboard-header {
        padding: 12px 16px;
    }
    
    .dashboard-content {
        padding: 16px;
    }
    
    .total-value {
        font-size: 36px;
    }
}

@media (max-width: 640px) {
    .dashboard-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    
    .dashboard-sidebar.open {
        transform: translateX(0);
    }
    
    .dashboard-main {
        margin-left: 0;
    }
    
    .search-bar {
        max-width: 100%;
    }
    
    .user-menu span {
        display: none;
    }
}

/* ========================================
   UTILITIES
   ======================================== */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }
.p-4 { padding: 32px; }

.hidden {
    display: none;
}

.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }