/* Import Inter font from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* Define theme variables */
:root {
    --bg-color: #f8f9fa; /* Light background */
    --text-color: #333; /* Light text */
    --card-bg: #fff; /* Light card background */
    --sidebar-bg: #FFFFFF; /* White sidebar */
    --accent-color: #6E0387; /* Primary brand color */
    --highlight-color: #FF8DD3; /* Secondary brand color */
    --icon-color: #f28c38; /* Orange for icons */
}

[data-theme="dark"] {
    --bg-color: #121212; /* Darker background */
    --text-color: #e0e0e0; /* Lighter text */
    --card-bg: #1e1e1e; /* Dark card background */
    --sidebar-bg: #1e1e1e; /* Dark sidebar */
    --accent-color: #9c27b0; /* Slightly lighter purple for better contrast */
    --highlight-color: #ff80ab; /* Slightly lighter pink for better contrast */
    --icon-color: #f28c38; /* Keep icon color consistent */
}

/* Apply Inter font globally */
* {
    font-family: 'Inter', sans-serif !important;
}

/* Existing styles */
body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Login page styles */
.login-container {
    display: flex;
    min-height: 100vh;
}

.login-image {
    flex: 0 0 70%;
    background: url('../img/registerbg.jpg') no-repeat center center;
    background-size: cover;
}

.login-form {
    flex: 0 0 30%;
    display: flex;
    flex-direction: column;
    background-color: var(--card-bg);
}

.login-form-center {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.login-form-content {
    max-width: 350px;
    width: 100%;
}

.login-form-content .logo {
    display: block;
    margin: 0 auto 20px;
    max-width: 200px;
}

.login-form-content h2 {
    color: var(--accent-color);
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
}

.form-control {
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 10px;
    margin-bottom: 15px;
    font-size: 16px;
    background-color: var(--card-bg);
    color: var(--text-color);
}

.form-group.checkbox-group {
    margin-bottom: 25px;
}

.btn-primary {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    border-radius: 5px;
    padding: 10px;
    width: 100%;
    font-size: 16px;
    font-weight: 500;
    color: #fff;
}

.btn-primary:hover {
    background-color: var(--highlight-color);
    border-color: var(--highlight-color);
}

.error {
    color: #dc3545;
    margin-bottom: 15px;
    font-size: 14px;
    text-align: center;
}

.form-links {
    text-align: center;
    margin-top: 15px;
    margin-bottom: 20px;
}

.form-links a {
    color: var(--accent-color);
    text-decoration: none;
}

.form-links a:hover {
    color: var(--highlight-color);
}

.footer {
    text-align: center;
    font-size: 12px;
    color: #6c757d;
    width: 100%;
    padding: 20px 0;
    background-color: #F2F1EF; /* Match main content background */
}

.footer a {
    color: var(--accent-color);
    text-decoration: none;
}

.footer a:hover {
    color: var(--highlight-color);
}

/* Dashboard styles */
.dashboard-container {
    display: flex;
    min-height: 100vh;
    transition: background-color 0.3s ease;
}

.sidebar {
    width: 250px;
    background-color: var(--sidebar-bg);
    color: var(--text-color);
    padding: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden; /* Prevent horizontal scrolling */
    z-index: 1000; /* Ensure sidebar stays above other content */
    transition: transform 0.3s ease-in-out;
}

.sidebar > div {
    display: flex;
    flex-direction: column;
    align-items: center; /* Ensure inner content is centered */
    width: 100%; /* Ensure full width */
}

.sidebar-logo {
    margin-bottom: 40px; /* Spacing below logo */
}

.sidebar-logo img {
    max-width: 150px; /* Adjust logo size */
    display: block;
    margin-top: 50px;
}

.user-info {
    display: flex;
    flex-direction: column; /* Stack avatar and details vertically */
    align-items: center;
    margin-bottom: 40px; /* Spacing below user info */
}

.user-info img {
    width: 60px; /* Larger avatar */
    height: 60px;
    border-radius: 50%;
    margin-bottom: 10px; /* Space between avatar and name */
}

.user-info .user-details {
    text-align: center;
}

.user-info .user-details h4 {
    margin: 0;
    font-size: 12px !important;
}

.user-info .user-details p {
    margin: 0;
    font-size: 12px;
    color: #666;
}

.nav-links {
    list-style: none;
    padding: 0;
    margin-bottom: 40px; /* Spacing above Exit */
    width: 150px; /* Fixed width to center the block */
}

.nav-links li {
    margin-bottom: 10px;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: flex-start; /* Align to the left within the fixed width */
    font-size: 16px;
    padding: 10px;
    border-radius: 8px;
}

.nav-links a i {
    margin-right: 10px;
    font-size: 18px;
    width: 20px;
    text-align: center;
    color: var(--highlight-color);
}

.nav-links a:hover {
    background-color: #F4F3F1;
    color: var(--accent-color);
}

.nav-links .active {
    background-color: #F4F3F1;
    color: var(--accent-color);
}

.exit-btn {
    color: var(--text-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: flex-start; /* Align to the left within the fixed width */
    font-size: 16px;
    padding: 10px;
    border-radius: 8px;
    width: 150px; /* Match the nav-links width */
}

.exit-btn i {
    margin-right: 10px;
    font-size: 18px;
}

.exit-btn:hover {
    background-color: #F4F3F1;
    color: var(--accent-color);
}

.main-content {
    flex: 1;
    background-color: #F2F1EF;
    padding: 80px;
    margin-left: 250px;
    overflow-y: auto;
    height: 100vh;
    width: calc(100% - 250px); /* Ensure main content takes remaining width */
    box-sizing: border-box; /* Include padding in width calculation */
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.header .dropdown {
    background-color: var(--card-bg);
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
    color: var(--text-color);
}

.theme-toggle {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-color);
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

/* Updated layout for performance and activity sections */
.top-section {
    display: flex;
    gap: 20px;
    margin-bottom: 60px; /* Increased spacing */
    height: 300px; /* Increased height */
}

.performance-section {
    width: 35%; /* 35% width for performance section */
    background-color: #101322; /* Background color for performance section */
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    padding: 25px;
    color: #fff; /* White text for contrast */
}

.performance-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.performance-content .metric {
    text-align: center;
    flex: 1;
}

.performance-content .metric h3 {
    font-size: 40px;
    margin: 0;
    font-weight: 700;
}

.performance-content .metric p {
    margin: 8px 0 0;
    font-size: 14px;
}

.activity-section {
    width: 65%; /* 65% width for activity section */
    background-color: var(--highlight-color); /* Secondary color #FF8DD3 */
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    height: 300px; /* Match performance section height */
}

.activity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.activity-tabs {
    display: flex;
    gap: 20px;
}

.activity-tabs a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
}

.activity-tabs a.active {
    color: var(--accent-color);
    border-bottom: 3px solid var(--accent-color);
}

.activity-tabs a:hover {
    color: #fff; /* White for contrast on hover */
}

.view-count {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: var(--text-color);
}

.view-count i {
    margin-right: 8px;
    color: var(--highlight-color);
    font-size: 16px;
    width: 16px;
    text-align: center;
}

.engagement-section {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.engagement-card {
    flex: 1;
    background-color: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    text-align: center;
    position: relative;
}

.engagement-card i {
    font-size: 28px;
    color: var(--highlight-color);
    margin-bottom: 15px;
    display: inline-block;
    width: 100%;
    text-align: center;
}

.engagement-card h4 {
    font-size: 28px;
    margin: 0;
    font-weight: 600;
}

.engagement-card p {
    font-size: 14px;
    color: #888;
    margin: 8px 0 0;
}

.engagement-card a {
    color: var(--accent-color);
    text-decoration: none;
}

.engagement-card a:hover {
    color: var(--highlight-color);
}

.engagement-card .trend {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 14px;
}

.engagement-card .trend-up {
    color: #28a745;
}

.engagement-card .trend-down {
    color: #dc3545;
}

.engagement-card .trend i {
    font-size: 14px;
    width: 14px;
    text-align: center;
    color: var(--highlight-color);
}

.metrics-section {
    background-color: var(--card-bg);
    padding: 2rem 25px; /* Increased padding */
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    margin-bottom: 2rem;
}

.metrics-section h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 1.5rem; /* Increased spacing */
    color: var(--text-color);
    padding-top: 0.5rem; /* Added top padding */
}

.table {
    width: 100%;
    margin-bottom: 2rem;
    background-color: var(--card-bg);
    color: var(--text-color);
    border-collapse: collapse;
}

.table thead th {
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: var(--text-color);
    padding: 12px;
    text-align: left;
}

.table tbody td {
    border-top: 1px solid #dee2e6;
    color: var(--text-color);
    padding: 12px;
}

/* Responsive Design for Login */
@media (max-width: 768px) {
    .login-container {
        flex-direction: column;
    }

    .login-image {
        flex: 0 0 200px;
        width: 100%;
    }

    .login-form {
        flex: 1;
        width: 100%;
    }

    .login-form-center {
        flex: 1;
        padding: 20px;
    }

    .login-form-content {
        max-width: 100%;
        padding: 0 15px;
    }

    .login-form-content .logo {
        max-width: 150px;
    }

    .login-form-content h2 {
        font-size: 24px;
    }

    .form-control {
        font-size: 14px;
    }

    .btn-primary {
        font-size: 14px;
    }

    .error {
        font-size: 12px;
    }

    .form-links {
        font-size: 14px;
    }

    .footer {
        font-size: 10px;
        padding: 15px 0;
    }
}

@media (max-width: 480px) {
    .login-image {
        flex: 0 0 150px;
    }

    .login-form-center {
        padding: 15px;
    }

    .login-form-content .logo {
        max-width: 120px;
    }

    .login-form-content h2 {
        font-size: 20px;
    }
}

/* Responsive Design for Dashboard */
@media (max-width: 768px) {
    .dashboard-container {
        flex-direction: column;
    }

    .sidebar {
        position: relative;
        width: 100%;
        padding: 40px;
        height: auto;
        overflow-x: visible;
    }

    .main-content {
        margin-left: 0;
        padding: 40px;
        height: auto;
        width: 100%;
    }

    .top-section {
        flex-direction: column;
        height: auto; /* Allow sections to stack naturally */
        margin-bottom: 30px; /* Adjusted spacing for mobile */
    }

    .performance-section {
        width: 100%; /* Full width on smaller screens */
        height: 200px; /* Adjusted height for smaller screens */
    }

    .activity-section {
        width: 100%; /* Full width on smaller screens */
        height: 200px; /* Adjusted height for smaller screens */
    }

    .engagement-section {
        flex-direction: column;
    }
}

/* Font Awesome styles */
.fa,
.fas,
.far,
.fal,
.fat,
.fad,
.fab {
    font-family: 'Font Awesome 6 Free' !important;
    font-weight: 900;
}

.far {
    font-weight: 400;
}

.fab {
    font-family: 'Font Awesome 6 Brands' !important;
}

/* Update hover states for icons */
.nav-links a:hover i,
.engagement-card:hover i,
.view-count:hover i {
    color: var(--accent-color);
}

/* Update theme toggle icon color */
.theme-toggle i {
    color: var(--highlight-color);
}

/* Dark mode specific styles */
[data-theme="dark"] .performance-section {
    background-color: #1e1e1e;
    border: 1px solid #333;
}

[data-theme="dark"] .activity-section {
    background-color: #2d2d2d;
    border: 1px solid #333;
}

[data-theme="dark"] .engagement-card {
    background-color: #1e1e1e;
    border: 1px solid #333;
}

[data-theme="dark"] .engagement-card:hover {
    background-color: #2d2d2d;
    transform: translateY(-2px);
    transition: all 0.3s ease;
}

[data-theme="dark"] .metrics-section {
    background-color: #1e1e1e;
    border: 1px solid #333;
}

[data-theme="dark"] .table {
    background-color: #1e1e1e;
    color: #e0e0e0;
}

[data-theme="dark"] .table thead th {
    border-bottom: 2px solid #333;
    color: #e0e0e0;
}

[data-theme="dark"] .table tbody td {
    border-top: 1px solid #333;
    color: #e0e0e0;
}

[data-theme="dark"] .header .dropdown {
    background-color: #1e1e1e;
    border: 1px solid #333;
    color: #e0e0e0;
}

[data-theme="dark"] .activity-tabs a {
    color: #e0e0e0;
}

[data-theme="dark"] .activity-tabs a.active {
    color: var(--accent-color);
    border-bottom: 3px solid var(--accent-color);
}

[data-theme="dark"] .activity-tabs a:hover {
    color: var(--highlight-color);
}

[data-theme="dark"] .view-count {
    color: #e0e0e0;
}

[data-theme="dark"] .engagement-card p {
    color: #b0b0b0;
}

[data-theme="dark"] .metrics-section h3 {
    color: #e0e0e0;
}

/* Add smooth transition for theme switching */
body {
    transition: background-color 0.3s ease, color 0.3s ease;
}

.dashboard-container {
    transition: background-color 0.3s ease;
}

/* Update theme toggle button */
.theme-toggle {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-color);
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

[data-theme="dark"] .theme-toggle {
    background-color: rgba(255, 255, 255, 0.1);
}

.theme-toggle:hover {
    background-color: rgba(0, 0, 0, 0.1);
    transform: scale(1.1);
}

[data-theme="dark"] .theme-toggle:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Mobile Menu Styles */
.mobile-menu-toggle {
    display: none;
    background: var(--highlight-color);
    border: none;
    color: var(--card-bg);
    font-size: 24px;
    cursor: pointer;
    padding: 10px;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
}

[data-theme="dark"] .mobile-menu-toggle {
    color: var(--text-color);
}

.sidebar {
    width: 250px;
    background-color: var(--sidebar-bg);
    color: var(--text-color);
    padding: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1000;
    transition: transform 0.3s ease-in-out;
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }

    .sidebar {
        transform: translateX(-100%);
        padding: 40px;
        width: 80%;
        max-width: 300px;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 40px;
        height: auto;
        width: 100%;
    }

    .dashboard-container {
        flex-direction: column;
    }

    /* Add overlay when menu is open */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

    .sidebar-overlay.active {
        display: block;
    }

    /* Adjust header for mobile */
    .header {
        margin-top: 60px;
    }

    /* Adjust user info for mobile */
    .user-info {
        margin-bottom: 20px;
    }

    .user-info img {
        width: 50px;
        height: 50px;
    }

    /* Adjust nav links for mobile */
    .nav-links {
        width: 100%;
    }

    .nav-links a {
        padding: 12px;
        font-size: 16px;
    }

    .nav-links a i {
        font-size: 20px;
    }

    /* Adjust exit button for mobile */
    .exit-btn {
        width: 100%;
        padding: 12px;
        margin-top: 20px;
    }
}

/* Responsive Table Styles */
@media (max-width: 768px) {
    .metrics-section {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -20px;
        padding: 1.5rem 20px; /* Adjusted padding for mobile */
    }

    .metrics-section h3 {
        margin-bottom: 1.25rem; /* Slightly reduced on mobile */
        padding-top: 0.25rem;
    }

    .table {
        min-width: 600px;
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        margin-bottom: 2.5rem;
    }

    .table thead {
        display: table-header-group;
    }

    .table tbody {
        display: table-row-group;
    }

    .table tr {
        display: table-row;
    }

    .table th,
    .table td {
        display: table-cell;
        min-width: 120px;
    }

    /* Add horizontal scroll indicator */
    .metrics-section::-webkit-scrollbar {
        height: 5px;
    }

    .metrics-section::-webkit-scrollbar-track {
        background: var(--card-bg);
    }

    .metrics-section::-webkit-scrollbar-thumb {
        background: var(--accent-color);
        border-radius: 5px;
    }

    /* Style the "View All Transactions" button */
    .metrics-section .btn-primary {
        width: 100%;
        margin-top: 2rem;
        padding: 12px;
        position: relative;
        z-index: 1;
    }

    /* Add some space after the scrollable area */
    .metrics-section::after {
        content: '';
        display: block;
        height: 1rem;
        width: 100%;
    }
}

/* Dark mode table styles */
[data-theme="dark"] .table {
    background-color: var(--card-bg);
}

[data-theme="dark"] .table thead th {
    border-bottom: 2px solid #333;
    color: var(--text-color);
}

[data-theme="dark"] .table tbody td {
    border-top: 1px solid #333;
    color: var(--text-color);
}

.wallet-info {
    padding: 15px;
    text-align: center;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    margin: 10px 0 30px 0;
}

.wallet-info p {
    margin: 5px 0;
    font-size: 14px;
    color: #333;
}

.wallet-info .btn {
    margin-top: 10px;
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    white-space: nowrap; /* Prevent text from wrapping */
}