/* =========================================
   CRYPTO TRADING DASHBOARD - MAZER STYLE
   ========================================= */

:root {
    --primary: #435ebe;
    --secondary: #6c757d;
    --success: #198754;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #0dcaf0;
    --light: #f9f9f9;
    --dark: #1e1e2d;
    --sidebar-width: 260px;
    --navbar-height: 80px;
}

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

body {
    font-family: 'Nunito', sans-serif;
    background-color: #f2f7ff;
    overflow-x: hidden;
}

/* =========================================
   SIDEBAR
   ========================================= */
#sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #435ebe 0%, #2d3e8f 100%);
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

.sidebar-wrapper {
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-wrapper::-webkit-scrollbar {
    width: 5px;
}

.sidebar-wrapper::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

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

.logo {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
}

.theme-toggle {
    margin-left: auto;
}

.theme-toggle button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    transition: all 0.3s;
}

.theme-toggle button:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Sidebar Menu */
.sidebar-menu {
    padding: 1rem 0;
}

.menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-title {
    padding: 0.5rem 1.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-item {
    margin: 0.25rem 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.sidebar-link i {
    font-size: 1.2rem;
    margin-right: 0.75rem;
    width: 24px;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.sidebar-item.active .sidebar-link {
    background: rgba(255, 255, 255, 0.15);
    border-left-color: #ffc107;
    color: white;
    font-weight: 600;
}

/* =========================================
   MAIN CONTENT
   ========================================= */
#main {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: all 0.3s ease;
}

/* Navbar */
.navbar-top {
    background: white;
    height: var(--navbar-height);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 1rem 2rem;
}

#sidebar-toggle {
    background: transparent;
    border: none;
    color: var(--primary);
    display: none;
}

.user-menu {
    cursor: pointer;
}

.user-img i {
    color: var(--primary);
}

/* Main Content Area */
#main-content {
    padding: 2rem;
}

.page-heading {
    margin-bottom: 2rem;
}

.page-title h3 {
    font-weight: 700;
    color: #25396f;
    margin-bottom: 0.5rem;
}

.text-subtitle {
    font-size: 0.9rem;
}

.breadcrumb {
    background: transparent;
    margin-bottom: 0;
    padding: 0;
}

/* =========================================
   CARDS & STATISTICS
   ========================================= */
.card {
    border: none;
    border-radius: 1rem;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
    transition: all 0.3s;
}

.card:hover {
    box-shadow: 0 5px 40px rgba(0, 0, 0, 0.1);
    transform: translateY(-5px);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
    font-weight: 700;
}

.card-body {
    padding: 1.5rem;
}

/* Stats Icons */
.stats-icon {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.stats-icon.purple {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stats-icon.blue {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.stats-icon.green {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.stats-icon.red {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

/* =========================================
   TABLE
   ========================================= */
.table {
    color: #25396f;
}

.table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.table thead th {
    font-weight: 600;
    padding: 1rem;
    border: none;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #f0f0f0;
}

.table tbody tr:hover {
    background: #f8f9ff;
}

.table code {
    background: #f0f0f0;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.85rem;
    color: #e74c3c;
}

/* Exchange Badges */
.badge {
    padding: 0.4rem 0.8rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.exchange-binance {
    background: #f0b90b;
    color: #000;
}

.exchange-okx {
    background: #000;
    color: #fff;
}

.exchange-hyperliquid {
    background: #00d4ff;
    color: #000;
}

.exchange-aster {
    background: #7c3aed;
    color: #fff;
}

/* =========================================
   BUTTONS
   ========================================= */
.btn {
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    font-weight: 600;
    transition: all 0.3s;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn-info {
    background: #0dcaf0;
    color: white;
}

.btn-info:hover {
    background: #0bb5d6;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

/* =========================================
   MODAL
   ========================================= */
.modal-content {
    border: none;
    border-radius: 1rem;
    box-shadow: 0 10px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 1rem 1rem 0 0;
    border: none;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

.modal-title {
    font-weight: 700;
}

.modal-footer {
    border-top: 1px solid #f0f0f0;
}

/* Form Controls */
.form-label {
    font-weight: 600;
    color: #25396f;
    margin-bottom: 0.5rem;
}

.form-select,
.form-control {
    border: 2px solid #e9ecef;
    border-radius: 0.5rem;
    padding: 0.75rem;
    transition: all 0.3s;
}

.form-select:focus,
.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.form-control[readonly] {
    background: #f8f9fa;
}

/* Dropdown Menu */
.dropdown-menu {
    border: 2px solid #e9ecef;
    border-radius: 0.5rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.dropdown-item {
    padding: 0.75rem 1rem;
    transition: all 0.2s;
    cursor: pointer;
}

.dropdown-item:hover {
    background: #f8f9ff;
    color: #667eea;
}

.dropdown-item strong {
    display: block;
    color: #25396f;
    margin-bottom: 0.25rem;
}

.dropdown-item small {
    color: #6c757d;
    font-size: 0.8rem;
}

/* =========================================
   FOOTER
   ========================================= */
footer {
    background: white;
    padding: 1.5rem 2rem;
    border-top: 1px solid #e9ecef;
    margin-top: 2rem;
}

.footer p {
    margin-bottom: 0;
    font-size: 0.9rem;
}

/* =========================================
   UTILITIES
   ========================================= */
.font-semibold {
    font-weight: 600;
}

.font-extrabold {
    font-weight: 800;
}

.text-muted {
    color: #6c757d !important;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 1rem;
    color: #6c757d;
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 1199px) {
    #sidebar {
        margin-left: calc(-1 * var(--sidebar-width));
    }
    
    #main {
        margin-left: 0;
    }
    
    #sidebar-toggle {
        display: block;
    }
    
    body.sidebar-show #sidebar {
        margin-left: 0;
    }
    
    body.sidebar-show #main {
        margin-left: var(--sidebar-width);
    }
}

@media (max-width: 768px) {
    #main-content {
        padding: 1rem;
    }
    
    .navbar-top {
        padding: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .table {
        font-size: 0.85rem;
    }
    
    .table thead th,
    .table tbody td {
        padding: 0.5rem;
    }
    
    .stats-icon {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
}

@media (max-width: 576px) {
    .page-title h3 {
        font-size: 1.5rem;
    }
    
    .btn-sm {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
    }
    
    .modal-dialog {
        margin: 0.5rem;
    }
}

/* =========================================
   DARK MODE (Optional)
   ========================================= */
body.dark-mode {
    background-color: #1e1e2d;
    color: #fff;
}

body.dark-mode .card {
    background: #2a2a3c;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.3);
}

body.dark-mode .navbar-top {
    background: #2a2a3c;
}

body.dark-mode .table tbody td {
    border-bottom-color: #3a3a4c;
    color: #fff;
}

body.dark-mode .form-select,
body.dark-mode .form-control {
    background: #3a3a4c;
    border-color: #4a4a5c;
    color: #fff;
}

body.dark-mode .modal-content {
    background: #2a2a3c;
    color: #fff;
}

/* =========================================
   ANIMATIONS
   ========================================= */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeIn 0.5s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-menu.show {
    animation: slideDown 0.3s ease;
}