/* ================================================
   KRIPTOMATIC - Admin Panel Styles
   Based on Landing Page Design System
   ================================================ */

:root {
    /* Core Colors - EXACT match from landing */
    --primary: #7C3AED;
    --primary-dark: #5B21B6;
    --primary-light: #A78BFA;
    --secondary: #EC4899;
    --accent: #06B6D4;
    
    /* Backgrounds - EXACT match from landing */
    --dark: #0F0A1F;
    --darker: #080510;
    --card-bg: rgba(124, 58, 237, 0.08);
    
    /* Text - Landing uses white as default */
    --text-muted: #9CA3AF;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #7C3AED 0%, #EC4899 100%);
    --gradient-dark: linear-gradient(180deg, #0F0A1F 0%, #1A1025 100%);
    
    /* Status Colors */
    --success: #10B981;
    --danger: #EF4444;
    --warning: #FBBF24;
    --info: #3B82F6;
    
    /* Layout */
    --sidebar-width: 260px;
    --border-color: rgba(124, 58, 237, 0.15);
}

/* ============================================
   BASE - Same as landing page
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--darker);
    color: #fff;
    line-height: 1.6;
    min-height: 100vh;
}

/* All headings WHITE like landing */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    color: #fff;
    font-weight: 600;
}

/* Paragraphs can be muted */
p {
    color: var(--text-muted);
}

/* Links */
a {
    color: var(--primary-light);
    text-decoration: none;
}

a:hover {
    color: #fff;
}

/* Strong text always white */
strong, b {
    color: #fff;
    font-weight: 600;
}

/* Small text muted */
small, .small, .text-muted {
    color: var(--text-muted) !important;
}

/* ============================================
   SIDEBAR - Dark gradient like landing navbar
   ============================================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--gradient-dark);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.sidebar-brand svg {
    height: 40px;
    border-radius: 10px;
}

.sidebar-brand span {
    font-size: 1.25rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.nav-section {
    padding: 0 1rem;
    margin-bottom: 1.5rem;
}

.nav-section-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    padding: 0 0.75rem;
    margin-bottom: 0.5rem;
}

.nav-item {
    margin-bottom: 0.25rem;
    list-style: none;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: rgba(255,255,255,0.7) !important;
    border-radius: 12px;
    transition: all 0.3s;
    font-weight: 500;
}

.nav-link i {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.nav-link:hover {
    color: #fff !important;
    background: rgba(124, 58, 237, 0.15);
}

.nav-link.active {
    color: #fff !important;
    background: var(--gradient-primary);
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
}

/* Sidebar User */
.sidebar-user {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: rgba(124, 58, 237, 0.05);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #fff;
}

.user-details { flex: 1; min-width: 0; }
.user-name { font-weight: 600; color: #fff; font-size: 0.9rem; }
.user-role { font-size: 0.75rem; color: var(--text-muted); }
.user-role.admin { color: var(--secondary); }

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    padding: 2rem;
}

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

.page-header h2 {
    font-size: 1.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #fff;
}

.page-header h2 i {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ============================================
   CARDS - Like landing feature-card
   ============================================ */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.3s;
}

.card:hover {
    border-color: rgba(124, 58, 237, 0.4);
    box-shadow: 0 20px 40px rgba(124, 58, 237, 0.15);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
}

.card-header h5 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-header h5 i {
    color: var(--primary-light);
}

.card-body {
    padding: 1.5rem;
}

/* Card body text colors */
.card-body h3, .card-body .h3,
.card-body h4, .card-body .h4,
.card-body h5, .card-body .h5 {
    color: #fff !important;
}

.card-body h6, .card-body .h6 {
    color: var(--text-muted);
}

.card-body p {
    color: var(--text-muted);
}

.card-footer {
    background: transparent;
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
}

/* ============================================
   STAT CARDS - Like landing stats
   ============================================ */
.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(124, 58, 237, 0.15);
}

/* Stat values WHITE like landing pricing */
.stat-card h3 {
    font-size: 2rem;
    font-weight: 700;
    color: #fff !important;
}

.stat-card h6, .stat-card .stat-label {
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.stat-card .stat-icon {
    position: absolute;
    top: 1rem;
    right: 1rem;
    opacity: 0.5;
}

.stat-card .stat-icon i {
    font-size: 2.5rem;
}

/* ============================================
   TABLES
   ============================================ */
.table {
    color: #fff;
    margin-bottom: 0;
    --bs-table-bg: transparent;
    --bs-table-color: #fff;
}

.table>:not(caption)>*>* {
    background-color: transparent;
    color: #fff;
}

.table thead th {
    background: rgba(124, 58, 237, 0.1);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem;
}

.table tbody td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
    color: #fff;
}

.table tbody tr:hover {
    background: rgba(124, 58, 237, 0.1);
}

/* Closed/secondary rows - still visible */
.table-secondary,
.table-secondary td,
tr.table-secondary td {
    background: rgba(124, 58, 237, 0.05) !important;
    color: rgba(255,255,255,0.7) !important;
}

/* Warning rows */
.table-warning,
.table-warning td,
tr.table-warning td {
    background: rgba(251, 191, 36, 0.1) !important;
    color: #fff !important;
}

.table-dark {
    --bs-table-bg: rgba(124, 58, 237, 0.15);
    --bs-table-color: #fff;
}

/* ============================================
   BUTTONS - Like landing CTA buttons
   ============================================ */
.btn {
    padding: 0.6rem 1.25rem;
    font-weight: 500;
    border-radius: 12px;
    transition: all 0.3s;
    border: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.5);
    color: #fff;
}

.btn-secondary {
    background: rgba(255,255,255,0.1);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
}

.btn-success {
    background: linear-gradient(135deg, #10B981, #34D399);
    color: #fff;
}

.btn-danger {
    background: linear-gradient(135deg, #EF4444, #F87171);
    color: #fff;
}

.btn-warning {
    background: linear-gradient(135deg, #F59E0B, #FBBF24);
    color: #000;
}

.btn-outline-primary {
    background: transparent;
    color: var(--primary-light);
    border: 1px solid var(--primary);
}

.btn-outline-primary:hover,
.btn-outline-primary.active {
    background: var(--primary);
    color: #fff;
}

.btn-outline-secondary {
    background: transparent;
    color: rgba(255,255,255,0.7);
    border: 1px solid rgba(255,255,255,0.2);
}

.btn-outline-secondary:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.btn-outline-success {
    background: transparent;
    color: var(--success);
    border: 1px solid var(--success);
}

.btn-outline-success:hover,
.btn-outline-success.active {
    background: var(--success);
    color: #fff;
}

.btn-outline-danger {
    background: transparent;
    color: var(--danger);
    border: 1px solid var(--danger);
}

.btn-outline-danger:hover {
    background: var(--danger);
    color: #fff;
}

.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.85rem; }
.btn-lg { padding: 0.875rem 1.75rem; font-size: 1.1rem; }

/* ============================================
   FORMS
   ============================================ */
.form-control, .form-select {
    background: var(--dark);
    border: 1px solid var(--border-color);
    color: #fff;
    border-radius: 12px;
    padding: 0.75rem 1rem;
}

.form-control:focus, .form-select:focus {
    background: var(--dark);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
    color: #fff;
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-label {
    color: #fff;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-text {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.form-check-input {
    background-color: var(--dark);
    border: 1px solid var(--border-color);
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.form-check-label {
    color: rgba(255,255,255,0.9);
}

.input-group-text {
    background: rgba(124, 58, 237, 0.1);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    font-weight: 500;
    padding: 0.4em 0.8em;
    border-radius: 50px;
}

.badge.bg-primary {
    background: var(--gradient-primary) !important;
}

.badge.bg-success {
    background: rgba(16, 185, 129, 0.2) !important;
    color: #34D399 !important;
}

.badge.bg-danger {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #F87171 !important;
}

.badge.bg-warning {
    background: rgba(251, 191, 36, 0.2) !important;
    color: #FBBF24 !important;
}

.badge.bg-info {
    background: rgba(59, 130, 246, 0.2) !important;
    color: #60A5FA !important;
}

.badge.bg-secondary {
    background: rgba(156, 163, 175, 0.2) !important;
    color: var(--text-muted) !important;
}

/* ============================================
   ALERTS
   ============================================ */
.alert {
    border: none;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    border-left: 4px solid;
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    border-left-color: var(--success);
    color: #34D399;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.15);
    border-left-color: var(--danger);
    color: #F87171;
}

.alert-warning {
    background: rgba(251, 191, 36, 0.15);
    border-left-color: var(--warning);
    color: #FBBF24;
}

.alert-info {
    background: rgba(59, 130, 246, 0.15);
    border-left-color: var(--info);
    color: #60A5FA;
}

.alert a {
    color: inherit;
    text-decoration: underline;
}

/* ============================================
   PNL COLORS
   ============================================ */
.pnl-positive, .text-success {
    color: #34D399 !important;
}

.pnl-negative, .text-danger {
    color: #F87171 !important;
}

/* ============================================
   ACCORDION (FAQ)
   ============================================ */
.accordion-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    margin-bottom: 0.5rem;
    border-radius: 12px !important;
    overflow: hidden;
}

.accordion-button {
    background: transparent;
    color: #fff;
    font-weight: 500;
    padding: 1rem 1.25rem;
}

.accordion-button:not(.collapsed) {
    background: rgba(124, 58, 237, 0.15);
    color: var(--primary-light);
    box-shadow: none;
}

.accordion-button:focus {
    box-shadow: none;
}

.accordion-button::after {
    filter: invert(1);
}

.accordion-body {
    background: transparent;
    color: var(--text-muted);
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
}

/* ============================================
   MODALS
   ============================================ */
.modal-content {
    background: var(--dark);
    border: 1px solid var(--border-color);
    border-radius: 20px;
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
}

.modal-title { color: #fff; }

.modal-body {
    padding: 1.5rem;
    color: #fff;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
}

.btn-close { filter: invert(1); }

/* ============================================
   LIST GROUP
   ============================================ */
.list-group-item {
    background: transparent;
    border-color: var(--border-color);
    color: #fff;
}

.list-group-item:hover,
.list-group-item-action:hover {
    background: rgba(124, 58, 237, 0.1);
    color: #fff;
}

/* ============================================
   NAV PILLS (Filters)
   ============================================ */
.nav-pills .nav-link {
    color: rgba(255,255,255,0.7);
    background: transparent;
    border: 1px solid var(--border-color);
    margin-right: 0.5rem;
    border-radius: 50px;
    padding: 0.5rem 1rem;
}

.nav-pills .nav-link:hover {
    background: rgba(124, 58, 237, 0.15);
    color: #fff;
}

.nav-pills .nav-link.active {
    background: var(--gradient-primary);
    border-color: transparent;
    color: #fff;
}

/* ============================================
   AUTH PAGES
   ============================================ */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--darker);
    position: relative;
}

.auth-wrapper::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 80%;
    height: 150%;
    background: radial-gradient(ellipse, rgba(124, 58, 237, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.auth-container {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
}

.auth-container .card {
    width: 100%;
}

.auth-wrapper .card {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
}

/* ============================================
   SPINNER
   ============================================ */
.spinner-border {
    color: var(--primary-light);
}

/* ============================================
   SPECIAL COMPONENTS
   ============================================ */

/* Position rows */
.position-row {
    cursor: pointer;
}

.position-row:hover {
    background: rgba(124, 58, 237, 0.15) !important;
}

.position-chevron {
    transition: transform 0.2s ease;
    color: var(--text-muted);
}

.position-chevron.rotated {
    transform: rotate(90deg);
    color: var(--primary-light);
}

/* Transaction items */
.transaction-item {
    border-left: 3px solid;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 0 12px 12px 0;
    background: rgba(255, 255, 255, 0.03);
}

.transaction-item:hover {
    background: rgba(124, 58, 237, 0.1);
}

.transaction-item.buy { border-left-color: var(--success); }
.transaction-item.sell { border-left-color: var(--secondary); }

/* Status dots */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.online { background: var(--success); box-shadow: 0 0 8px var(--success); }
.status-dot.offline { background: var(--danger); }

/* API Guide Link */
.api-guide-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-light);
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    background: rgba(124, 58, 237, 0.15);
    border-radius: 50px;
    transition: all 0.3s;
}

.api-guide-link:hover {
    background: rgba(124, 58, 237, 0.25);
    color: #fff;
}

/* Balance cards in bg-dark */
.bg-dark {
    background: var(--card-bg) !important;
}

/* Font mono */
.font-monospace {
    font-family: 'JetBrains Mono', 'Fira Code', monospace !important;
}

/* HR */
hr {
    border-color: var(--border-color);
    opacity: 1;
}

/* ============================================
   RESPONSIVE
   ============================================ */
.mobile-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1001;
    background: var(--gradient-primary);
    border: none;
    border-radius: 12px;
    padding: 0.75rem;
    color: #fff;
}

@media (max-width: 991px) {
    .mobile-toggle { display: flex; align-items: center; justify-content: center; }
    .sidebar { transform: translateX(-100%); transition: transform 0.3s; }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0; padding: 1rem; padding-top: 5rem; }
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--dark); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-light); }

/* ============================================
   OPACITY - Better than default
   ============================================ */
.opacity-50 { opacity: 0.6 !important; }

/* Image thumbnail */
.img-thumbnail {
    background: var(--dark);
    border-color: var(--border-color);
}
