/* ===================================
   CitadelVest Pro - Dashboard Styles
   File: public/css/dashboard.css
   =================================== */

/* === CSS VARIABLES === */
:root {
    --color-white: #ffffff;
    --color-light: #f0eff5;
    --color-gray-light: #86848c;
    --color-gray-dark: #56555e;
    --color-dark: #27282f;
    --color-primary: var(--primary);
    --color-success: rgb(34, 202, 75);
    --color-danger: rgb(255, 67, 54);
    --color-warning: rgb(234, 181, 7);
    --color-purple: rgb(160, 99, 245);
    --color-primary-light: var(--primary-light);
    --color-success-light: rgba(34, 202, 75, 0.2);
    --color-danger-light: rgba(255, 67, 54, 0.2);
    --color-purple-light: rgba(160, 99, 245, 0.2);
    --card-padding: 1.6rem;
    --padding-1: 1rem;
    --padding-2: 8px;
    --card-border-radius: 1.6rem;
    --border-radius-1: 1rem;
    --border-radius-2: 6px;
}

/* === DARK THEME === */
.dark-theme {
    --color-white: #131316;
    --color-light: #23232a;
    --color-dark: #ddd;
    --color-gray-dark: #adacb5;
}

/* === RESET === */
* {
    margin: 0;
    padding: 0;
    outline: 0;
    appearance: none;
    text-decoration: none;
    list-style: none;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

html {
    font-size: 14px;
}

body {
    background: var(--color-light);
    min-height: 100vh;
    color: var(--color-dark);
}

img {
    width: 100%;
}

/* === TYPOGRAPHY === */
h1 { font-size: 2.2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1rem; }
h5 { font-size: 0.86rem; font-weight: 500; }
p { font-size: 0.86rem; color: var(--color-white); }
small { font-weight: 300; font-size: 0.77rem; }

/* === UTILITY CLASSES === */
.text-muted { color: var(--color-gray-light); }
.primary { color: var(--color-primary); }
.danger { color: var(--color-danger); }
.success { color: var(--color-success); }
.purple { color: var(--color-purple); }

.bg-primary { background: var(--color-primary); box-shadow: 0 0.8rem 0.8rem var(--color-primary-light); }
.bg-danger { background: var(--color-danger); box-shadow: 0 0.8rem 0.8rem var(--color-danger-light); }
.bg-success { background: var(--color-success); box-shadow: 0 0.8rem 0.8rem var(--color-success-light); }
.bg-purple { background: var(--color-purple); box-shadow: 0 0.8rem 0.8rem var(--color-purple-light); }
.bg-dark { background: #27282f; box-shadow: 0 0.8rem 0.8rem rgba(0, 0, 0, 0.2); }
.bg-purple-light { background: var(--color-purple-light); }
.bg-danger-light { background: var(--color-danger-light); }
.bg-primary-light { background: var(--color-primary-light); }
.bg-success-light { background: var(--color-success-light); }

/* === NAVIGATION === */
nav {
    width: 100%;
    background: var(--color-white);
    padding: 0.8rem 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin: 0 auto;
    max-width: 1400px;
}

nav .logo {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

nav .profile-area {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

nav .menu-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--color-dark);
    font-size: 2rem;
    cursor: pointer;
    padding: 0.5rem;
}

nav .theme-btn {
    display: flex;
    background: var(--color-light);
    width: 3.5rem;
    height: 1.6rem;
    border-radius: var(--border-radius-2);
    cursor: pointer;
}

nav .theme-btn span {
    width: 50%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    transition: all 0.3s;
}

nav .theme-btn .active {
    background: var(--color-dark);
    border-radius: var(--border-radius-2);
    color: var(--color-white);
}

nav .profile {
    display: flex;
    gap: 1rem;
    align-items: center;
}

nav .profile-photo {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    overflow: hidden;
    background: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1rem;
}

/* === MAIN LAYOUT === */
main {
    display: grid;
    grid-template-columns: 16rem auto 30rem;
    gap: 2rem;
    width: 96%;
    margin: 1rem auto 4rem;
}

/* === SIDEBAR === */
main aside {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 88vh;
}

main aside .sidebar a {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    height: 4.2rem;
    color: var(--color-gray-light);
    position: relative;
    transition: all 0.3s;
}

main aside .sidebar a span {
    font-size: 1.7rem;
    margin-left: 3rem;
    transition: all 0.3s;
}

main aside .sidebar a.active {
    background: var(--color-white);
    color: var(--color-primary);
}

main aside .sidebar a.active::before {
    content: '';
    width: 6px;
    height: 100%;
    position: absolute;
    background: var(--color-primary);
}

main aside .sidebar a:hover {
    color: var(--color-primary);
}

main aside .sidebar a:hover span {
    margin-left: 2rem;
}

main aside .sidebar h4 {
    font-weight: 500;
}

main aside .updates {
    background: var(--color-white);
    border-radius: var(--border-radius-1);
    text-align: center;
    padding: var(--card-padding);
}

main aside .updates span {
    font-size: 2.8rem;
}

main aside .updates h4 {
    margin: 1rem 0;
}

/* === MIDDLE SECTION === */
main section.middle .header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

main section.middle .header input[type="date"] {
    padding: 0.5rem 2rem;
    border-radius: var(--border-radius-2);
    border: none;
    background: var(--color-white);
    color: var(--color-gray-dark);
}

/* === BALANCE CARDS === */
main section.middle .cards {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    width: 100%;
}

main section.middle .cards .card:first-child {
    flex: 2 1 350px;
    min-width: 300px;
}

main section.middle .cards .card:not(:first-child) {
    flex: 1 1 200px;
    min-width: 180px;
}

main section.middle .cards .card {
    background: linear-gradient(#ff796f, #bd261b);
    padding: var(--card-padding);
    border-radius: var(--card-border-radius);
    color: white;
    height: 16rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 2rem 3rem var(--color-danger-light);
    min-width: 22rem;
    transition: all 0.3s ease;
}

main section.middle .cards .card:nth-child(2) {
    background: linear-gradient(#7f8191, #27282f);
    box-shadow: 0 2rem 3rem rgba(0, 0, 0, 0.2);
}

main section.middle .cards .card:nth-child(3) {
    background: linear-gradient(#5d70ff, #5719c2);
    box-shadow: 0 2rem 3rem var(--color-primary-light);
}

main section.middle .cards .card:hover {
    box-shadow: none;
    transform: translateY(-5px);
}

main section.middle .cards .card .top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

main section.middle .cards .card .top .left {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

main section.middle .cards .card .top .left h2 {
    font-weight: 400;
    font-size: 1.4rem;
}

main section.middle .cards .card .middle {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

main section.middle .cards .card .middle h1 {
    font-size: 2.2rem;
}

main section.middle .cards .card .bottom {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

main section.middle .cards .card .bottom .right {
    display: flex;
    gap: 2rem;
}

/* === DEPOSIT FUNDING GRID === */
.deposit-funding-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

/* === MONTHLY REPORT === */
main .monthly-report {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 2rem;
}

main .monthly-report .report {
    background: var(--color-white);
    padding: var(--card-padding);
    border-radius: var(--border-radius-1);
}

main .monthly-report h1 {
    font-weight: 700;
    font-size: 1.8rem;
}

/* === RIGHT SECTION === */
main section.right .investments {
    background: var(--color-white);
    border-radius: var(--card-border-radius);
}

main section.right .investments .header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--card-padding);
    padding-bottom: 0;
}

main section.right .investments .header a {
    display: flex;
    align-items: center;
    color: var(--color-primary);
    cursor: pointer;
}

main section.right .investments .investment {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--card-padding);
    border-bottom: 1px solid var(--color-light);
    transition: all 0.3s ease;
}

main section.right .investments .investment:last-child {
    border-bottom: none;
}

main section.right .investments .investment:hover {
    background: var(--color-light);
    cursor: pointer;
}

/* === RECENT TRANSACTIONS === */
main .recent-transactions {
    margin-top: 2rem;
}

main .recent-transactions .header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
}

main .recent-transactions .header a {
    display: flex;
    align-items: center;
    color: var(--color-primary);
    cursor: pointer;
}

main .recent-transactions .transaction {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem var(--card-padding);
    border-radius: var(--card-border-radius);
    transition: all 0.3s ease;
}

main .recent-transactions .transaction:hover {
    background: var(--color-white);
    cursor: pointer;
}

main .recent-transactions .transaction .service {
    display: flex;
    gap: 1rem;
}

main .recent-transactions .transaction .service .icon {
    padding: var(--padding-2);
    border-radius: var(--border-radius-1);
    display: flex;
    align-items: center;
}

/* === CRYPTO PRICES === */
.crypto-prices {
    margin-top: 2rem;
}

/* === SIDEBAR OVERLAY === */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    display: none;
}

.sidebar-overlay.show {
    display: block;
}




/**
 * ===================================
 * FIXED MODAL STYLES
 * File: Add this to your main CSS file (dashboard.css or components.css)
 * FIXES: Network selector styling, modal scrolling, responsive design
 * ===================================
 */

/* ============================================= */
/* NETWORK SELECTOR STYLES */
/* ============================================= */

.network-selector {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin: 1rem 0;
}

.network-option {
    display: flex;
    align-items: center;
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    position: relative;
}

.network-option:hover:not(.disabled) {
    border-color: var(--primary);
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.network-option.active {
    border-color: var(--primary);
    background: linear-gradient(135deg, var(--primary-light) 0%, rgba(118, 75, 162, 0.1) 100%);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.network-option.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #f5f5f5;
}

.network-option.disabled:hover {
    transform: none;
    border-color: #e0e0e0;
}

.network-icon {
    font-size: 2rem;
    margin-right: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.network-info {
    flex: 1;
    min-width: 0; /* Allow text to wrap */
}

.network-info strong {
    display: block;
    color: var(--text-dark);
    margin-bottom: 0.2rem;
    font-size: 1rem;
}

.network-info small {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.network-badge {
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    flex-shrink: 0;
}

.network-badge.available {
    background: #4CAF50;
    color: white;
}

.network-badge.coming-soon {
    background: #FF9800;
    color: white;
}

/* ============================================= */
/* MODAL FIXES - CRITICAL FOR SCROLLING */
/* ============================================= */

/* Fix modal to allow scrolling */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    overflow-y: auto; /* CRITICAL: Allow vertical scrolling */
}

.modal.show {
    display: flex;
}

/* Modal content should not overflow parent */
.modal-content {
    background: white;
    border-radius: 20px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh; /* CRITICAL: Limit height to 90% of viewport */
    display: flex;
    flex-direction: column;
    margin: auto; /* Center vertically when scrolling */
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* Modal header - fixed at top */
.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0; /* Don't shrink */
}

/* Modal body - scrollable */
.modal-body {
    padding: 1.5rem;
    overflow-y: auto; /* CRITICAL: Allow body to scroll */
    flex: 1; /* Take up available space */
    max-height: calc(90vh - 140px); /* Account for header and footer */
}

/* Modal footer - fixed at bottom */
.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    flex-shrink: 0; /* Don't shrink */
}

/* ============================================= */
/* INFO BOXES */
/* ============================================= */

.info-box {
    background: #e3f2fd;
    padding: 1rem;
    border-radius: 10px;
    margin: 1rem 0;
}

.info-box p {
    margin: 0;
    color: #1976d2;
    font-size: 0.9rem;
    line-height: 1.6;
}

.warning-box {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 8px;
}

.warning-box p {
    margin: 0;
    color: #856404;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ============================================= */
/* FORM ELEMENTS */
/* ============================================= */

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

.form-input {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group small {
    display: block;
    margin-top: 0.3rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ============================================= */
/* BUTTONS */
/* ============================================= */

.quick-amount-btn {
    flex: 1;
    padding: 0.6rem;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    color: var(--text-dark);
}

.quick-amount-btn:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-2px);
}

.quick-amount-btn:active {
    transform: translateY(0);
}

.btn-primary,
.btn-secondary {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.btn-primary {
    background: var(--brand-gradient);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #e0e0e0;
    color: var(--text-dark);
}

.btn-secondary:hover {
    background: #d0d0d0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: #f5f5f5;
    color: var(--text-dark);
}

/* ============================================= */
/* COMING SOON SECTION */
/* ============================================= */

#comingSoonMessage {
    text-align: center;
    padding: 2rem;
}

#comingSoonMessage h3 {
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

#comingSoonMessage p {
    color: var(--text-muted);
    line-height: 1.6;
}

/* ============================================= */
/* RESPONSIVE DESIGN */
/* ============================================= */

@media (max-width: 768px) {
    .modal {
        padding: 10px;
    }
    
    .modal-content {
        max-width: 100%;
        max-height: 95vh;
        border-radius: 12px;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem;
    }
    
    .network-option {
        padding: 0.8rem;
    }
    
    .network-icon {
        font-size: 1.5rem;
        width: 40px;
        height: 40px;
    }
    
    .network-info strong {
        font-size: 0.9rem;
    }
    
    .network-info small {
        font-size: 0.75rem;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .network-selector {
        gap: 0.6rem;
    }
    
    .network-option {
        padding: 0.7rem;
    }
    
    .network-icon {
        width: 35px;
        height: 35px;
        font-size: 1.3rem;
    }
    
    .network-badge {
        font-size: 0.65rem;
        padding: 0.3rem 0.6rem;
    }
}

/* ============================================= */
/* DARK MODE SUPPORT (if you have dark theme) */
/* ============================================= */

body.dark-theme .network-option {
    background: #2a2a2a;
    border-color: #404040;
}

body.dark-theme .network-option.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
}

body.dark-theme .network-info strong {
    color: #e0e0e0;
}

body.dark-theme .info-box {
    background: #1e3a5f;
}

body.dark-theme .info-box p {
    color: #90caf9;
}

body.dark-theme .warning-box {
    background: #4a3f1f;
    border-left-color: #ffc107;
}

body.dark-theme .warning-box p {
    color: #ffd54f;
}

body.dark-theme .modal-content {
    background: #1a1a1a;
}

body.dark-theme .modal-header,
body.dark-theme .modal-footer {
    border-color: #404040;
}

body.dark-theme .form-input {
    background: #2a2a2a;
    border-color: #404040;
    color: #e0e0e0;
}

/**
 * ===================================
 * Dark Mode Toggle Button - Navigation Bar
 * Add to your main CSS file (dashboard.css or components.css)
 * ===================================
 */

/* Dark Mode Toggle Button */
.dark-mode-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-primary-light);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 1rem;
    color: var(--text);
}

.dark-mode-toggle-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.dark-mode-toggle-btn .material-icons-sharp {
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.dark-mode-toggle-btn:hover .material-icons-sharp {
    transform: rotate(20deg);
}

/* Dark mode specific styles */
.dark-theme .dark-mode-toggle-btn {
    color: #e8e8f0;
}

.dark-theme .dark-mode-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .dark-mode-toggle-btn {
        width: 36px;
        height: 36px;
        margin-right: 0.5rem;
    }
    
    .dark-mode-toggle-btn .material-icons-sharp {
        font-size: 1.3rem;
    }
}





/* ── Site Footer (Authenticated Pages) ─────────────────── */
.site-footer {
    margin-top: 4rem;
    padding: 1.5rem 2rem;
    border-top: 1px solid #f0f0f0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-family: 'Poppins', sans-serif;
    font-size: 0.82rem;
    color: var(--text-muted, #999);
}

.site-footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    align-items: center;
}

.site-footer-links a {
    color: var(--text-muted, #999);
    text-decoration: none;
    transition: color 0.2s;
    white-space: nowrap;
}

.site-footer-links a:hover {
    color: var(--primary, var(--primary));
}

.site-footer-copy {
    white-space: nowrap;
}

/* Dark mode */
.dark-theme .site-footer {
    border-top-color: #2a2a2a;
}

@media (max-width: 768px) {
    .site-footer {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem 1rem;
        gap: 0.75rem;
    }

    .site-footer-links {
        justify-content: center;
    }
}

body.dark-mode .date-range-group {
    background: var(--bg-card) !important;
    border-color: var(--border-light) !important;
    color: var(--text-primary) !important;
}
body.dark-mode .date-range-group input,
body.dark-mode .date-range-group select,
body.dark-mode .date-range-group label {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-medium) !important;
}

body.dark-mode #announcementBanner,
body.dark-mode .announcement-banner {
    background: var(--bg-card) !important;
    border-color: var(--border-light) !important;
    color: var(--text-primary) !important;
}
body.dark-mode .announcement-banner a {
    color: var(--primary) !important;
}

