/* ==========================================================================
   1. CORE VARIABLES & GLOBAL RESET
   ========================================================================== */
:root {
    --bg-dark: #0f1216;
    --card-bg: #1a1e23;
    --border-color: #2d343c;
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --accent-green: #10b981;
    --accent-blue: #3b82f6;
    --sidebar-width: 260px;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
}

/* ==========================================================================
   2. SYSTEM LAYOUT ARCHITECTURE
   ========================================================================== */
.main-layout {
    display: flex;
    min-height: 100vh;
}

.content-area {
    flex: 1;
    padding: 2rem;
    overflow-x: hidden;
    position: relative;
}

/* ==========================================================================
   3. SIDEBAR STRUCTURE & COMPONENTS
   ========================================================================== */
.dashboard-sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--card-bg);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    flex-shrink: 0;
    position: sticky;
    top: 0;
}

/* Close Icon Trigger (Hidden on Desktop natively) */
.sidebar-close-trigger {
    display: none;
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    z-index: 10;
    transition: color 0.2s;
}

.sidebar-close-trigger:hover {
    color: #ef4444;
}

/* Brand Identity Wrapper */
.sidebar-brand-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 2rem;
}

.brand-logo-icon {
    font-size: 1.5rem;
    color: var(--accent-blue);
}

.brand-meta-text {
    display: flex;
    flex-direction: column;
}

.brand-title-main {
    font-weight: 800;
    font-size: 1.25rem;
    color: #fff;
    letter-spacing: -0.5px;
}

.brand-status-sub {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
    margin-top: 1px;
}

/* User Widget Profile Box */
.sidebar-user-widget {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.03);
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar-frame {
    width: 40px;
    height: 40px;
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.user-meta-details {
    display: flex;
    flex-direction: column;
}

.user-display-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
}

.user-role-badge {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Navigation Links Map */
.sidebar-menu-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.menu-link-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

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

.menu-link-item i {
    width: 20px;
    text-align: center;
}

/* ==========================================================================
   4. CONTENT DASHBOARD ELEMENTS
   ========================================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: linear-gradient(145deg, #1a1e23, #15181d);
    border: 1px solid rgba(255, 255, 255, 0.04);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.4);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.85rem;
    font-weight: 700;
    color: #fff;
}

.text-gradient {
    background: linear-gradient(90deg, var(--accent-green), var(--accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* =========================================
   DASHBOARD SIGNAL CARDS
   ========================================= */

.dashboard-card {
    background-color: var(--bg-dark-card, #161A22);
    border: 1px solid var(--border-color, #2A303C);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    width: 100%;
}

/* Signal Required Alert Styles */
.border-danger-card {
    border: 1px solid rgba(255, 76, 76, 0.3);
}

.card-content-center {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Aligns text to the left like your image */
}

.icon-danger-wrapper {
    color: #ff4c4c;
    background: rgba(255, 76, 76, 0.1);
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 15px;
    display: inline-block;
}

.icon-danger-wrapper i {
    font-size: 1.5rem;
}

.card-title-alert {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #ffffff;
}

.card-text-alert {
    color: #a0a5b0;
    font-size: 0.95rem;
    margin-bottom: 20px;
    line-height: 1.5;
}

.text-danger { color: #ff4c4c !important; }
.text-warning { color: #ffca28 !important; }
.font-bold { font-weight: 700; }

.btn-danger-solid {
    background-color: #ff4c4c;
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s ease;
}

.btn-danger-solid:hover {
    background-color: #e63939;
    color: #ffffff;
}

/* Trading Signal Strength Styles */
.card-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.header-title-left {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.signal-value {
    font-size: 1rem;
    font-weight: 500;
}

.signal-progress-container {
    margin-bottom: 20px;
}

.progress-bar-track {
    background-color: #2A303C;
    height: 12px;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.8s ease-in-out;
}

.fill-danger { 
    background: linear-gradient(90deg, #ff4c4c 0%, #ff7676 100%);
}

.progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #6b7280;
    font-weight: 500;
}

.warning-note-box {
    font-size: 0.85rem;
    color: #a0a5b0;
    background: rgba(255, 202, 40, 0.05);
    border: 1px solid rgba(255, 202, 40, 0.1);
    padding: 12px 15px;
    border-radius: 10px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    line-height: 1.4;
}

.warning-note-box i {
    margin-top: 2px;
}

/* ==========================================================================
   5. DATA TABLES & INTERACTIVE COMPONENTS
   ========================================================================== */
.data-table-container {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.04);
    margin-bottom: 2rem;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    min-width: 500px;
    border-collapse: collapse;
}

th {
    text-align: left;
    color: var(--text-secondary);
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

td {
    padding: 1rem;
    border-bottom: 1px solid #252a30;
    font-size: 0.9rem;
}

tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.01);
}

.status-badge {
    background: rgba(16, 185, 129, 0.08);
    color: var(--accent-green);
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(16, 185, 129, 0.15);
    display: inline-flex;
    align-items: center;
}

/* Clipboard Module Styles */
.copy-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.copy-btn:hover {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

code {
    font-family: 'Courier New', Courier, monospace;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
}

/* Hidden Mobile Trigger default rule */
.sidebar-hamburger-trigger {
    display: none;
}


/* ==========================================================================
   7. MARKET TICKER LOADING ANIMATION (NEW)
   ========================================================================== */
.rate-value.loading {
    opacity: 0.5;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 0.5; }
    50% { opacity: 0.2; }
    100% { opacity: 0.5; }
}

/* ==========================================================================
   6. HIGH-PERFORMANCE MOBILE LAYER (Optimized)
   ========================================================================== */
@media (max-width: 768px) {
    .main-layout {
        display: block;
        width: 100%;
        position: relative;
    }

    /* Fixed Slider Canvas */
    .dashboard-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        max-width: 85%;
        height: 100vh;
        z-index: 9999;
        transform: translateX(-100%);
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 20px 0 40px rgba(0, 0, 0, 0.6);
    }

    .dashboard-sidebar.active {
        transform: translateX(0) !important;
    }

    /* Mobile Overlay (to dismiss sidebar) */
    .dashboard-sidebar.active::after {
        content: "";
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0,0,0,0.5);
        z-index: -1;
    }

    .sidebar-close-trigger {
        display: flex;
    }

    .content-area {
        padding: 5.5rem 1rem 1.5rem 1rem !important; 
    }

    .sidebar-hamburger-trigger {
        display: flex;
        position: fixed;
        top: 16px;
        left: 16px;
        z-index: 2000;
        background: var(--accent-blue);
        color: #ffffff;
        border: none;
        padding: 12px;
        border-radius: 8px;
        box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
        cursor: pointer;
    }
}
/* Card Container Styles */
.dashboard-card {
    background-color: #161a22;
    border: 1px solid #2a303c;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
}

.primary-blue-gradient {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid #3b82f633;
}

.card-icon-header {
    color: #3b82f6;
    font-size: 1.2rem;
    margin-bottom: 12px;
}

.card-title { font-size: 1.1rem; color: #ffffff; margin-bottom: 10px; }
.card-text { font-size: 0.9rem; color: #94a3b8; line-height: 1.5; margin-bottom: 15px; }

/* Features List */
.features-list { list-style: none; padding: 0; }
.features-list li { color: #60a5fa; font-size: 0.85rem; margin-bottom: 8px; display: flex; align-items: center; gap: 10px; }
/* Container to keep elements aligned */
.dashboard-wrapper {
    max-width: 600px; /* Adjust this to match your Signal Card width */
    margin: 0 auto;   /* Centers the column on the page */
}

.dashboard-card {
    background-color: var(--bg-dark-card, #161A22);
    border: 1px solid var(--border-color, #2A303C);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    width: 100%; /* Ensures it fills the container */
    box-sizing: border-box; /* Ensures padding doesn't break the width */
}

/* Wallet Grid adjustments to keep buttons uniform */
.wallet-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 20px;
}

/* Update the option container for side-by-side alignment */
.wallet-option {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 15px; 
    cursor: pointer;
    transition: all 0.3s;
    
    /* Flexbox centers the icon and text side-by-side */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px; /* Space between the icon and the text */
}

.wallet-option span { 
    color: #ffffff; 
    font-size: 0.95rem; 
    font-weight: 600; 
}

.wallet-option:hover { 
    border-color: #3b82f6; 
    background: #25334d; 
}

/* New class to strictly control the icon size */
.wallet-icon-small {
    width: 24px;   /* Forces the image to be small */
    height: 24px;
    object-fit: contain; /* Ensures the logo isn't stretched */
    display: block;
}

/* =========================================
   DASHBOARD & SETTINGS STYLING
   ========================================= */

/* Base Body Styling */
.dash-body {
    background-color: #0b0e14;
    color: #e2e8f0;
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
}

/* Header Navigation */
.dash-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background-color: #11141a;
    border-bottom: 1px solid #1e232d;
}
.dash-brand a {
    color: #ffffff;
    text-decoration: none;
    font-size: 1.3rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}
.dash-user-nav {
    display: flex;
    align-items: center;
    gap: 30px;
}
.nav-icons {
    display: flex;
    gap: 20px;
}
.nav-icons a {
    color: #848e9c;
    font-size: 1.1rem;
    transition: color 0.2s ease;
}
.nav-icons a:hover {
    color: #ffffff;
}

/* Main Container & Titles */
.dash-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 20px;
}
.dash-welcome {
    margin-bottom: 30px;
}
.dash-welcome h1 {
    margin: 0 0 8px 0;
    color: #ffffff;
    font-size: 1.8rem;
}
.dash-welcome p {
    margin: 0;
    color: #848e9c;
    font-size: 0.95rem;
}

/* 2-Column Layout Grid */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: start;
}

/* Settings Cards */
.dash-card {
    background-color: #11141a;
    border: 1px solid #1e232d;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}
.dash-card h2 {
    font-size: 1.25rem;
    color: #ffffff;
    margin-top: 0;
}

/* Profile Avatar Zone */
.profile-avatar-section {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}
.avatar-circle {
    width: 75px;
    height: 75px;
    background-color: #1e232d;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    color: #475266;
    border: 2px dashed #334155;
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.form-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #94a3b8;
}
.auth-form input {
    width: 100%;
    padding: 14px 16px;
    background-color: #1e232d;
    border: 1px solid #2b3139;
    border-radius: 8px;
    color: #ffffff;
    font-size: 0.95rem;
    box-sizing: border-box;
    transition: all 0.2s ease;
}
.auth-form input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}
.auth-form input.input-readonly {
    background-color: #0d1017;
    color: #64748b;
    border-color: #1e232d;
    cursor: not-allowed;
}

/* Buttons */
.btn-auth-submit {
    background: linear-gradient(90deg, #3b82f6 0%, #1d4ed8 100%);
    color: #ffffff;
    border: none;
    padding: 14px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    transition: opacity 0.2s;
}
.btn-auth-submit:hover {
    opacity: 0.9;
}
.btn-auth-submit.btn-green {
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
}

.btn-action.btn-dark {
    background-color: #1e232d;
    color: #ffffff;
    border: 1px solid #334155;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}
.btn-action.btn-dark:hover {
    background-color: #2b3139;
    border-color: #475266;
}

/* 2FA Toggle Box */
.security-toggle-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(59, 130, 246, 0.05);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* Responsive Breakpoints */
@media (max-width: 850px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }
    .dash-header {
        flex-direction: column;
        gap: 20px;
    }
}