/* Global Styles and Variables */
:root {
    --background-color: #F0F0F0;
    --element-color: #FFFFFF;
    --text-color: #333333;
    --accent-color: #6BB77B;  /* Soft green as accent */
    --secondary-accent: #7C9CE5;  /* Soft blue as secondary accent */
    --shadow-color: rgba(0, 0, 0, 0.1);
    --highlight-color: rgba(255, 255, 255, 0.5);
    --border-radius-large: 20px;
    --border-radius-medium: 15px;
    --border-radius-small: 10px;
    --outer-shadow: 8px 8px 16px var(--shadow-color), -8px -8px 16px var(--highlight-color);
    --inner-shadow: inset 4px 4px 8px var(--shadow-color), inset -4px -4px 8px var(--highlight-color);
    --hover-shadow: 12px 12px 20px var(--shadow-color), -12px -12px 20px var(--highlight-color);
    --pressed-shadow: inset 6px 6px 10px var(--shadow-color), inset -6px -6px 10px var(--highlight-color);
    --box-shadow-transition: box-shadow 0.3s ease;
}

/* Base Styles */
body {
    font-family: 'Arial', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    max-width: 100%;
    width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    margin-top: 0;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--secondary-accent);
}

/* Neuromorphic Components */
.neuro-card {
    background-color: var(--element-color);
    border-radius: var(--border-radius-large);
    box-shadow: var(--outer-shadow);
    padding: 20px;
    margin-bottom: 20px;
    transition: var(--box-shadow-transition);
    width: 100%;
    max-width: min(1100px, calc(100% - 30px));
    box-sizing: border-box;
    overflow-x: hidden;
}

/* No longer needed - removed the card */

.neuro-card:hover {
    box-shadow: var(--hover-shadow);
}

.neuro-button {
    background-color: var(--element-color);
    color: var(--accent-color);
    border: none;
    border-radius: var(--border-radius-small);
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    box-shadow: var(--outer-shadow);
    transition: var(--box-shadow-transition), color 0.3s ease;
}

.neuro-button:hover {
    box-shadow: var(--hover-shadow);
    color: var(--secondary-accent);
}

.neuro-button:active {
    box-shadow: var(--pressed-shadow);
}

.neuro-button.primary {
    background-color: var(--accent-color);
    color: white;
}

.neuro-button.secondary {
    background-color: var(--secondary-accent);
    color: white;
}

.neuro-button.danger,
.neuro-button.btn-danger {
    background-color: #E57C7C;
    color: white;
}

.neuro-button.btn-danger:hover {
    background-color: #dc3545;
}

.neuro-button.btn-sm {
    padding: 5px 10px;
    font-size: 14px;
}

.neuro-input {
    width: 100%;
    padding: 12px; /* Match select padding for consistent height */
    margin-bottom: 0; /* Remove margin to let form-group handle spacing */
    border: none;
    border-radius: var(--border-radius-small);
    background-color: var(--element-color);
    box-shadow: var(--inner-shadow);
    transition: var(--box-shadow-transition);
}

/* Bootstrap input-group styling with neuromorphic design */
.input-group .form-control {
    background-color: var(--element-color);
    border: none;
    box-shadow: var(--inner-shadow);
    border-radius: var(--border-radius-small) 0 0 var(--border-radius-small);
    padding: 8px;
    margin-bottom: 0;
}

.input-group .form-control:focus {
    background-color: var(--element-color);
    border: none;
    box-shadow: var(--pressed-shadow);
    outline: none;
}

.input-group .btn {
    background-color: var(--element-color);
    border: none;
    box-shadow: var(--outer-shadow);
    color: var(--accent-color);
    border-radius: 0 var(--border-radius-small) var(--border-radius-small) 0;
    padding: 8px 12px;
    transition: var(--box-shadow-transition);
}

.input-group .btn:hover {
    background-color: var(--element-color);
    border: none;
    box-shadow: var(--hover-shadow);
    color: var(--secondary-accent);
}

.input-group .btn:active {
    background-color: var(--element-color);
    border: none;
    box-shadow: var(--pressed-shadow);
}

.neuro-input:focus {
    outline: none;
    box-shadow: var(--pressed-shadow);
}

.neuro-select {
    display: block;
    width: 100%;
    height: calc(2.5rem + 2px);
    font-size: 1rem;
    line-height: 1.5;
    padding: 0.75rem 2rem 0.75rem 0.75rem;
    color: inherit;
    background-color: var(--element-color);
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    box-shadow: var(--inner-shadow);
    margin-bottom: 0;
    transition: var(--box-shadow-transition);
    box-sizing: border-box;
    /* intentionally no appearance overrides */
}

/* Specific styling for the status filter dropdown */
.status-filter-select {
    min-width: 230px; /* Setting a minimum width to accommodate longer text (15% larger than 200px) */
    width: auto;     /* Allow the dropdown to expand based on content */
    white-space: nowrap; /* Prevent text from wrapping */
    text-overflow: ellipsis; /* Add ellipsis for any overflow */
    overflow: hidden; /* Hide overflow */
    padding-right: 30px; /* Add extra padding on the right for the dropdown arrow */
    appearance: menulist-button; /* Force native appearance for better text display */
    -webkit-appearance: menulist-button;
    -moz-appearance: menulist-button;
}

/* Style for the dropdown options */
.status-filter-select option {
    white-space: nowrap; /* Prevent text from wrapping */
    padding: 8px 12px; /* Add some padding for better readability */
    font-size: 14px; /* Set consistent font size */
}


.neuro-select:focus {
    outline: 0;
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.neuro-select option {
    padding: 0.375rem 0.75rem;
}

.neuro-checkbox {
    margin-right: 10px;
}

.neuro-textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: none;
    border-radius: var(--border-radius-small);
    background-color: var(--element-color);
    box-shadow: var(--inner-shadow);
    min-height: 100px;
    resize: vertical;
    transition: var(--box-shadow-transition);
}

.neuro-textarea:focus {
    outline: none;
    box-shadow: var(--pressed-shadow);
}

/* Layout Components */
.neuro-container {
    width: calc(100% - 120px);
    max-width: 100vw;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
    overflow-x: hidden;
}

@media (max-width: 991px) {
    .neuro-container {
        max-width: min(1200px, calc(100vw - 120px));
    }
}

@media (max-width: 767px) {
    .neuro-container {
        max-width: min(1200px, calc(100vw - 40px));
    }
}

/* Universal sidebar icon container - ensures consistent button sizes */
.sidebar-icon-container {
    flex: 0 0 26px;
    width: 26px;
    height: 26px;
    display: block;
    position: relative;
    margin: 0;
    box-sizing: border-box;
}

/* Absolute centering for images and SVGs only */
.sidebar-icon-container > img,
.sidebar-icon-container > svg {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    padding: 0;
}

/* Custom sidebar icon styling */
.sidebar-custom-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    filter: brightness(0) saturate(100%) invert(20%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(0.2) contrast(1);
    transition: filter 0.3s ease;
    display: block;
}

.neuro-sidebar-item.active .sidebar-custom-icon {
    filter: brightness(0) saturate(100%) invert(100%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(1) contrast(1);
}

.neuro-sidebar-item:hover .sidebar-custom-icon {
    filter: brightness(0) saturate(100%) invert(60%) sepia(39%) saturate(347%) hue-rotate(75deg) brightness(1.1) contrast(1);
}

.neuro-sidebar {
    background-color: var(--element-color);
    border-radius: 0 var(--border-radius-large) var(--border-radius-large) 0;
    box-shadow: var(--outer-shadow);
    padding: 0;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    width: 80px;
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.neuro-sidebar-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px 0 10px 0;
    min-height: 0; /* Allow flex item to shrink */
}

.neuro-sidebar-bottom {
    flex-shrink: 0;
    padding: 10px 0 20px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

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

.neuro-sidebar.collapsed {
    width: 80px;
}

.neuro-sidebar-header {
    padding: 10px 20px;
    text-align: left;
    margin: 15px 0 5px 0;
    font-size: 0.85em;
    text-transform: uppercase;
    color: #666;
    font-weight: bold;
    letter-spacing: 1px;
    display: none;
}

.neuro-sidebar.collapsed .neuro-sidebar-header {
    padding: 10px 0;
    display: none;
}

.neuro-sidebar.collapsed .sidebar-toggle {
    margin: 0;
    padding: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.neuro-sidebar-item {
    padding: 0;
    margin: 5px 10px;
    border-radius: var(--border-radius-small);
    transition: background-color 0.3s ease;
    position: relative;
}

.neuro-sidebar-item:hover {
    background-color: var(--background-color);
}

.neuro-sidebar-item.active {
    background-color: var(--accent-color);
    box-shadow: var(--outer-shadow);
}

.neuro-sidebar-item.active a {
    color: white;
}

.neuro-sidebar-item a {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    color: var(--text-color);
    width: 100%;
    height: 100%;
    padding: 10px 20px;
    margin: 0;
    gap: 10px;
    text-decoration: none;
    position: relative;
    box-sizing: border-box;
}

/* Center icon containers in collapsed sidebar mode */
.neuro-sidebar.collapsed .neuro-sidebar-item a {
    justify-content: center;
    gap: 0;
}

/* FontAwesome icons - keep <i> static, center only ::before */
.sidebar-icon-container i {
    font-size: 18px;
    line-height: 1;
    width: auto;
    display: block;
    position: static;
    margin: 0;
    padding: 0;
}

.sidebar-icon-container .fa-fw {
    width: auto !important;
}

.sidebar-icon-container i::before {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    display: block;
}

/* Legacy FontAwesome styles - only apply when NOT in container */
.neuro-sidebar-item > i:not(.fa)[fallback] {
    margin-right: 10px;
    width: 20px;
    text-align: center;
    position: relative;
    z-index: 2;
}

.neuro-sidebar-item span {
    white-space: nowrap;
    opacity: 0;
    width: 0;
    visibility: hidden;
    position: absolute;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.neuro-sidebar.collapsed .neuro-sidebar-item span {
    opacity: 0;
    width: 0;
    visibility: hidden;
    position: absolute;
}

/* Custom tooltip for sidebar items - definition moved below to consolidate with positioning styles */

/* Style Bootstrap tooltips to match our custom green design */
.tooltip .tooltip-inner {
    background-color: var(--accent-color) !important;
    color: white !important;
    padding: 8px 15px !important;
    border-radius: 5px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
    opacity: 1 !important;
    max-width: 300px !important;
}

/* Style tooltip arrows to match the green color */
.tooltip .arrow::before,
.tooltip.bs-tooltip-top .arrow::before,
.tooltip.bs-tooltip-auto[data-popper-placement^="top"] .arrow::before {
    border-top-color: var(--accent-color) !important;
}
.tooltip.bs-tooltip-right .arrow::before,
.tooltip.bs-tooltip-auto[data-popper-placement^="right"] .arrow::before {
    border-right-color: var(--accent-color) !important;
}
.tooltip.bs-tooltip-bottom .arrow::before,
.tooltip.bs-tooltip-auto[data-popper-placement^="bottom"] .arrow::before {
    border-bottom-color: var(--accent-color) !important;
}
.tooltip.bs-tooltip-left .arrow::before,
.tooltip.bs-tooltip-auto[data-popper-placement^="left"] .arrow::before {
    border-left-color: var(--accent-color) !important;
}

.custom-tooltip {
    position: fixed;
    display: none;
    background-color: var(--accent-color);
    color: white;
    padding: 8px 15px;
    font-size: 14px;
    font-weight: 500;
    z-index: 9999; /* Very high to ensure it's on top */
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    opacity: 0;
    pointer-events: none; /* Prevent tooltip from interfering with clicks */
    transition: opacity 0.2s ease, transform 0.2s ease;
    transform: translateY(-50%);
    margin: 0; /* Reset all margins */
    border-radius: 0 5px 5px 0; /* Square left side, rounded right side */
}

.custom-tooltip.visible {
    display: block !important;
    opacity: 1 !important;
}

.neuro-main-content {
    margin-left: 80px; /* Match the minimized sidebar width */
    padding: 20px;
    transition: margin-left 0.3s ease;
    width: calc(100% - 80px) !important; /* Exactly match sidebar width */
    max-width: calc(100% - 80px) !important; /* Use % instead of vw to prevent overflow */
    overflow-x: hidden !important; /* Hide overflow to prevent horizontal scrolling */
    box-sizing: border-box !important;
}

.neuro-main-content.expanded {
    margin-left: 80px;
    width: calc(100% - 80px) !important;
    max-width: calc(100% - 80px) !important;
    overflow-x: hidden !important;
}

/* Tables */
.neuro-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
    max-width: 100%;
    overflow-x: auto;
}

/* Special table class for tables that should fit content width */
.neuro-table-fit-content {
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    border-collapse: separate;
    border-spacing: 0 10px;
    table-layout: auto !important;
}

/* Responsive table wrapper */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
    display: block;
}

.neuro-table th {
    padding: 12px;
    text-align: left;
    background-color: var(--element-color);
    box-shadow: var(--outer-shadow);
    border-radius: var(--border-radius-small);
}

.neuro-table td {
    padding: 12px;
    background-color: var(--element-color);
    box-shadow: var(--outer-shadow);
}

.neuro-table tr:hover td {
    box-shadow: var(--hover-shadow);
}

.neuro-table tr td:first-child {
    border-top-left-radius: var(--border-radius-small);
    border-bottom-left-radius: var(--border-radius-small);
}

.neuro-table tr td:last-child {
    border-top-right-radius: var(--border-radius-small);
    border-bottom-right-radius: var(--border-radius-small);
}

/* Alert Messages */
.neuro-alert {
    padding: 15px;
    margin: 20px;
    border-radius: var(--border-radius-medium);
    box-shadow: var(--outer-shadow);
    opacity: 1;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1000;
    font-weight: 500;
    border-left: 5px solid;
    animation: alertFadeIn 0.5s ease-in-out;
}

@keyframes alertFadeIn {
    0% { transform: translateY(-20px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

.neuro-alert.success {
    background-color: #d4edda;
    color: #155724;
    border-color: #6BB77B;
}

.neuro-alert.danger {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #dc3545;
}

.neuro-alert.warning {
    background-color: #fff3cd;
    color: #856404;
    border-color: #ffc107;
}

.neuro-alert.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-color: #17a2b8;
}

.neuro-alert .close {
    float: right;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    color: inherit;
    opacity: 0.5;
    background: none;
    border: 0;
    padding: 0;
    margin-left: 15px;
    cursor: pointer;
}

.neuro-alert .close:hover {
    opacity: 0.75;
}

/* Cards and Stats */
.neuro-stats-card {
    background-color: var(--element-color);
    border-radius: var(--border-radius-medium);
    box-shadow: var(--outer-shadow);
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
    transition: var(--box-shadow-transition);
}

.neuro-stats-card:hover {
    box-shadow: var(--hover-shadow);
}

.neuro-stats-card .stats-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: var(--accent-color);
}

.neuro-stats-card .stats-value {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 5px;
    text-align: center;
}

.neuro-stats-card .stats-value.text-left {
    text-align: left;
    padding-left: 15px;
}

.neuro-stats-card .stats-label {
    color: #777;
    font-size: 1rem;
    text-align: center;
}

.neuro-stats-card .stats-label.text-left {
    text-align: left;
    padding-left: 15px;
}

/* New styles for consistent stat card formatting */
.stats-value-left {
    text-align: left;
    padding-left: 15px;
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.stats-label-left {
    text-align: left;
    padding-left: 15px;
    color: #777;
    font-size: 1rem;
}

@media (max-width: 767px) {
    .neuro-stats-card {
        padding: 15px 10px;
        margin-bottom: 0;
    }

    .dashboard-stats .neuro-stats-card .stats-value,
    .dashboard-stats .neuro-stats-card .stats-label {
        padding-left: 8px !important;
        text-align: left !important;
    }
}

/* Forms and Form Elements */
.neuro-form-group {
    margin-bottom: 10px; /* Further reduced for more compact layout */
}

.neuro-form-label {
    display: block;
    margin-bottom: 3px; /* Further reduced for more compact layout */
    font-weight: 500;
}

.neuro-file-input {
    display: none;
}

.neuro-file-label {
    display: inline-block;
    padding: 10px 20px;
    border-radius: var(--border-radius-small);
    background-color: var(--element-color);
    box-shadow: var(--outer-shadow);
    cursor: pointer;
    transition: var(--box-shadow-transition);
}

.neuro-file-label:hover {
    box-shadow: var(--hover-shadow);
}

.neuro-file-label:active {
    box-shadow: var(--pressed-shadow);
}

/* Profile Cards */
.member-profile-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: var(--element-color);
    border-radius: var(--border-radius-large);
    box-shadow: var(--outer-shadow);
    padding: 30px;
    margin-bottom: 30px;
    transition: var(--box-shadow-transition);
}

.member-profile-card:hover {
    box-shadow: var(--hover-shadow);
}

.member-profile-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 20px;
    box-shadow: var(--outer-shadow);
}

.member-profile-photo-rect {
    width: 200px;
    height: 160px;
    border-radius: var(--border-radius-medium);
    object-fit: contain;
    margin-bottom: 20px;
    box-shadow: var(--outer-shadow);
    border: 2px solid var(--accent-color);
    background-color: var(--element-color);
}

.member-profile-name {
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.member-profile-info {
    width: 100%;
    margin-top: 20px;
}

.member-profile-row {
    display: flex;
    margin-bottom: 10px;
    padding: 10px;
    border-radius: var(--border-radius-small);
    background-color: var(--background-color);
}

.member-profile-label {
    font-weight: 500;
    width: 40%;
}

.member-profile-value {
    width: 60%;
}

/* Dashboard */
.dashboard-header {
    margin-bottom: 30px;
}

.dashboard-title {
    font-size: 2rem;
    margin-bottom: 10px;
}

.dashboard-subtitle {
    color: #777;
    margin-bottom: 20px;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* Card link wrapper for clickable stat cards */
.card-link-wrapper {
    text-decoration: none;
    color: var(--text-color);
    display: block;
}

.card-link-wrapper:hover {
    text-decoration: none;
    color: var(--text-color);
}

.card-link-wrapper .neuro-stats-card {
    transition: transform 0.2s ease, box-shadow 0.3s ease;
}

.card-link-wrapper:hover .neuro-stats-card {
    transform: translateY(-3px);
    box-shadow: var(--hover-shadow);
}

/* Responsive Design */
@media (max-width: 991px) {
    .neuro-sidebar {
        width: 80px;
    }

    .neuro-sidebar-item span {
        opacity: 0;
        width: 0;
        visibility: hidden;
        position: absolute;
    }

    .neuro-sidebar-header {
        display: none;
    }

    .neuro-main-content {
        margin-left: 80px;
        width: calc(100% - 80px) !important;
        max-width: calc(100% - 80px) !important;
    }

    .neuro-sidebar.expanded {
        width: 250px;
        padding: 20px 0 0 0;
    }

    .neuro-sidebar.expanded .neuro-sidebar-header {
        display: block;
    }

    .neuro-sidebar.expanded .neuro-sidebar-item span {
        opacity: 1;
        width: auto;
        visibility: visible;
        position: static;
    }

    .neuro-main-content.expanded {
        margin-left: 250px;
        width: calc(100% - 250px) !important;
        max-width: calc(100% - 250px) !important;
    }

    /* Fix for tables on tablets */
    .table-responsive {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Global Tab Styling */
.nav-tabs {
    border-bottom: 2px solid var(--accent-color);
}

.nav-tabs .nav-link {
    color: var(--accent-color);
    border: 2px solid var(--accent-color);
    border-bottom: none;
    background-color: transparent;
    font-weight: 500;
    margin-right: 5px;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    transition: all 0.3s ease;
}

.nav-tabs .nav-link:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    background-color: rgba(107, 183, 123, 0.1);
}

.nav-tabs .nav-link.active,
.nav-tabs .nav-item.show .nav-link {
    color: white !important;
    background-color: var(--accent-color) !important;
    border-color: var(--accent-color) !important;
    border-bottom: 2px solid var(--accent-color) !important;
    position: relative;
    z-index: 1;
}

.nav-tabs .nav-link.active:hover,
.nav-tabs .nav-item.show .nav-link:hover {
    color: white !important;
    background-color: var(--accent-color) !important;
    border-color: var(--accent-color) !important;
}

/* Global tab styling override - high specificity for consistency */
.nav-tabs { 
    border-bottom: 2px solid var(--accent-color) !important; 
}

.nav-tabs .nav-link:not(.active) {
    color: var(--accent-color) !important;
    border: 1px solid var(--accent-color) !important;
    border-bottom-color: transparent !important;
    background: transparent !important;
    border-top-left-radius: 10px; 
    border-top-right-radius: 10px; 
    margin-right: 5px;
}

.nav-tabs .nav-link.active {
    color: #fff !important;
    background: var(--accent-color) !important;
    border: 1px solid var(--accent-color) !important;
    border-bottom-color: var(--accent-color) !important;
}

@media (max-width: 767px) {
    /* Additional mobile fixes for horizontal scrolling */
    html, body {
        max-width: 100vw;
        overflow-x: hidden;
    }

    /* Ensure all containers respect viewport width */
    .container, 
    .container-fluid, 
    .row, 
    .col,
    .card,
    .neuro-card,
    .table-responsive,
    .dashboard-header {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }

    /* Sidebar mobile positioning */
    .neuro-sidebar {
        width: 0;
        padding: 0;
        transform: translateX(-100%); /* Ensure it's completely off-screen */
        visibility: hidden; /* Hide from accessibility tree too */
        overflow: hidden; /* Prevent any content from showing */
        transition: transform 0.3s ease, visibility 0.3s ease, width 0.3s ease, padding 0.3s ease;
    }

    .neuro-sidebar-header {
        display: none;
    }

    .neuro-sidebar.mobile-visible {
        width: 250px;
        padding: 20px 0 0 0;
        transform: translateX(0); /* Slide in from the left */
        visibility: visible;
        display: flex;
        flex-direction: column;
        box-shadow: 5px 0 15px rgba(0, 0, 0, 0.2); /* Add shadow for better separation */
    }
    
    .neuro-sidebar.mobile-visible .neuro-sidebar-content {
        flex: 1;
        overflow-y: auto;
    }
    
    .neuro-sidebar.mobile-visible .neuro-sidebar-bottom {
        margin-top: auto;
        padding: 10px 0 20px 0;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    /* Don't show the sidebar header with the square toggle button on mobile */
    .neuro-sidebar.mobile-visible .neuro-sidebar-header {
        display: none;
    }

    .neuro-sidebar.mobile-visible .neuro-sidebar-item span {
        opacity: 1;
        width: auto;
        visibility: visible;
        position: static;
    }

    .neuro-main-content {
        margin-left: 0;
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 0 !important; /* Ensure no padding on mobile */
    }

    .neuro-main-content.mobile-shifted {
        width: calc(100vw - 250px) !important;
        max-width: calc(100vw - 250px) !important;
        margin-left: 250px;
    }

    /* Ensure containers inside main content are flush with edges */
    .neuro-main-content .container-fluid,
    .neuro-main-content .container,
    .neuro-main-content [class^="col-"] {
        padding-left: 15px;
        padding-right: 15px;
    }

    /* Dashboard mobile fixes */
    .dashboard-title,
    .dashboard-subtitle,
    .dashboard-header {
        padding-left: 15px;
        padding-right: 15px;
        width: 100%;
        box-sizing: border-box;
    }

    .dashboard-stats {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        width: 100%;
        padding-left: 15px;
        padding-right: 15px;
        box-sizing: border-box;
    }

    /* Fix for analytics layout on mobile */
    .analytics-card {
        width: 100%;
        overflow-x: hidden;
        box-sizing: border-box;
    }

    /* Fix for filter bar on mobile */
    .filter-bar {
        width: 100%;
        box-sizing: border-box;
        padding-left: 15px;
        padding-right: 15px;
    }

    /* Fix for tabs on mobile */
    .nav-tabs {
        width: 100%;
        box-sizing: border-box;
        padding-left: 15px;
        padding-right: 15px;
        overflow-x: auto;
        flex-wrap: nowrap;
    }

    /* Fix for chart containers on mobile */
    .chart-container {
        width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    /* Fix for insight summary on mobile */
    .insight-summary {
        width: 100%;
        box-sizing: border-box;
        padding-left: 15px;
        padding-right: 15px;
        margin-left: 0;
        margin-right: 0;
    }

    /* Fix for Bootstrap row and column layout on mobile */
    .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    /* Make all columns take full width on mobile */
    .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-12 {
        width: 100% !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
        box-sizing: border-box !important;
    }
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    display: none;
    background-color: var(--element-color);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    box-shadow: var(--outer-shadow);
    cursor: pointer;
    transition: transform 0.3s ease;
}

@media (max-width: 767px) {
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Mobile menu toggle styling */
    .mobile-menu-toggle {
        transition: transform 0.3s ease, opacity 0.3s ease;
    }

    /* Hide the hamburger icon when using the .hidden class */
    .mobile-menu-toggle.hidden {
        transform: translateX(-100px);
        opacity: 0;
    }
}

/* Age verification styles */
.age-verification-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

/* Category Filter Buttons - Compact Design */
.category-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.category-btn {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--border-radius-small);
    background-color: var(--element-color);
    font-size: 0.85rem;
    box-shadow: 2px 2px 5px var(--shadow-color), -2px -2px 5px var(--highlight-color);
    transition: all 0.2s ease;
    margin-bottom: 4px;
    border: 1px solid transparent;
    color: var(--text-color);
}

.category-btn:hover {
    box-shadow: 3px 3px 6px var(--shadow-color), -3px -3px 6px var(--highlight-color);
    transform: translateY(-1px);
}

.category-btn.active {
    background-color: var(--accent-color);
    color: white;
    box-shadow: inset 2px 2px 4px rgba(0,0,0,0.2), inset -2px -2px 4px rgba(255,255,0.1);
    border: 1px solid rgba(0,0,0,0.1);
}

.age-verification-content {
    background-color: var(--element-color);
    border-radius: var(--border-radius-large);
    box-shadow: var(--outer-shadow);
    padding: 30px;
    max-width: 500px;
    width: 90%;
    text-align: center;
}

.age-verification-title {
    font-size: 1.8rem;
    margin-bottom: 20px;
}

.age-verification-message {
    margin-bottom: 30px;
}

.age-verification-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
}

/* Login and Registration Forms */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.auth-card {
    background-color: var(--element-color);
    border-radius: var(--border-radius-large);
    box-shadow: var(--outer-shadow);
    padding: 22px;
    width: 100%;
    max-width: 380px; /* Original width for login */
    margin: 0 auto;
    box-sizing: border-box;
}

/* Specific styling for register page - wider form */
.register-page .auth-card {
    max-width: 600px;
    padding: 20px;
}

/* Desktop responsive improvements for auth card */
@media (min-width: 768px) {
    .auth-card {
        padding: 30px;
    }
    
    .register-page .auth-card {
        max-width: 700px;
        padding: 25px;
    }
}

@media (min-width: 1200px) {
    .register-page .auth-card {
        max-width: 800px;
        padding: 30px;
    }
}

.auth-title {
    font-size: 2.2rem;
    margin-bottom: 1.2rem;
    text-align: center;
    font-weight: 600;
}

/* Responsive auth title */
@media (max-width: 767px) {
    .auth-title {
        font-size: 1.8rem;
        margin-bottom: 1.2rem;
    }
}

.auth-logo {
    max-width: 160px; /* Reduced size */
    height: auto;
    margin-bottom: 1.2rem; /* Reduced margin */
}

.auth-form {
    margin-bottom: 10px;
    width: 100%;
    box-sizing: border-box;
}

/* Better spacing for desktop auth forms */
@media (min-width: 768px) {
    .auth-form .neuro-form-group {
        margin-bottom: 1rem;
    }
    
    .auth-form .row {
        margin-bottom: 0.25rem;
    }
    
    /* Improve column spacing on desktop */
    .auth-form .col-md-6 {
        padding-right: 15px;
        padding-left: 15px;
    }
    
    /* Better spacing for password guidelines on desktop */
    .neuro-card-inner.mt-3 {
        margin-top: 1rem !important;
    }
}

/* Enhanced neuromorphic card styling for password guidelines */
.neuro-card-inner {
    background-color: var(--element-color);
    border-radius: var(--border-radius-medium);
    box-shadow: var(--inner-shadow);
    padding: 12px;
    margin-bottom: 10px;
    transition: var(--box-shadow-transition);
}

.password-guidelines-content {
    font-size: 0.95rem;
}

.password-requirements li {
    padding: 2px 0;
    font-size: 0.9rem;
}

/* Compact spacing for register form */
.auth-form .neuro-form-group {
    margin-bottom: 0.8rem;
}

.auth-form .row {
    margin-bottom: 0.2rem;
}

/* Reduce spacing in mobile view */
@media (max-width: 767px) {
    .auth-card {
        padding: 15px;
    }
    
    .auth-title {
        font-size: 1.8rem;
        margin-bottom: 1rem;
    }
    
    .auth-form .neuro-form-group {
        margin-bottom: 0.6rem;
    }
    
    .neuro-card-inner.mt-3 {
        margin-top: 0.8rem !important;
        padding: 10px;
    }
}

.auth-form .neuro-input {
    width: 100%;
    box-sizing: border-box;
    max-width: 100%;
}

.auth-form .row,
.auth-form .col-md-12 {
    padding: 0;
    margin: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.auth-footer {
    text-align: center;
    margin-top: 14px; /* Further reduced by 12% from 16px */
}

/* Custom switches */
.neuro-switch {
    position: relative;
    display: inline-block;
    width: 46px; /* Reduced width */
    height: 26px; /* Reduced height */
}

.neuro-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.neuro-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--background-color);
    box-shadow: var(--inner-shadow);
    transition: .4s;
    border-radius: 26px; /* Adjusted for smaller size */
}

.neuro-slider:before {
    position: absolute;
    content: "";
    height: 20px; /* Reduced height */
    width: 20px; /* Reduced width */
    left: 3px; /* Adjusted position */
    bottom: 3px; /* Adjusted position */
    background-color: white;
    box-shadow: var(--outer-shadow);
    transition: .4s;
    border-radius: 50%;
}

input:checked + .neuro-slider {
    background-color: var(--accent-color);
}

input:checked + .neuro-slider:before {
    transform: translateX(20px); /* Adjusted for smaller switch */
}

/* Badge styles */
.neuro-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    background-color: var(--background-color);
    box-shadow: var(--outer-shadow);
}

.neuro-badge.active {
    background-color: #d4edda;
    color: #155724;
}

.neuro-badge.inactive {
    background-color: #f8d7da;
    color: #721c24;
}

/* Custom checkbox styles */
.neuro-form-check {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.neuro-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    background-color: var(--background-color);
    box-shadow: var(--inner-shadow);
    position: relative;
    cursor: pointer;
    margin-right: 8px;
}

.neuro-checkbox:checked {
    background-color: var(--accent-color);
}

.neuro-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
}

.neuro-form-check-label {
    font-weight: 500;
    margin-left: 6px;
    cursor: pointer;
}

.neuro-badge.pending {
    background-color: #fff3cd;
    color: #856404;
}

/* Member Status Styles */
.member-status {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 15px;
    font-weight: bold;
    margin-bottom: 15px;
    font-size: 14px;
}

.member-status.active {
    background-color: #d4edda;
    color: #155724;
}

.member-status.inactive {
    background-color: #f8d7da;
    color: #721c24;
}

/* Tabs */
.neuro-tabs {
    display: flex;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.neuro-tab {
    padding: 10px 20px;
    margin-right: 10px;
    border-radius: var(--border-radius-small);
    cursor: pointer;
    background-color: var(--element-color);
    box-shadow: var(--outer-shadow);
    transition: var(--box-shadow-transition);
}

.neuro-tab:hover {
    box-shadow: var(--hover-shadow);
}

.neuro-tab.active {
    background-color: var(--accent-color);
    color: white;
    box-shadow: var(--pressed-shadow);
}

/* Floating action button */
.neuro-fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--accent-color);
    color: white;
    box-shadow: var(--outer-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 900;
}

.neuro-fab:hover {
    transform: scale(1.1);
    box-shadow: var(--hover-shadow);
}

.neuro-fab i {
    font-size: 24px;
}

/* Error pages */
.error-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 20px;
}

.error-code {
    font-size: 8rem;
    margin-bottom: 20px;
    color: var(--accent-color);
}

.error-message {
    font-size: 2rem;
    margin-bottom: 30px;
}

.error-description {
    margin-bottom: 30px;
    max-width: 600px;
}

/* Loading indicators */
.neuro-loader {
    display: inline-block;
    position: relative;
    width: 80px;
    height: 80px;
}

.neuro-loader:after {
    content: " ";
    display: block;
    border-radius: 50%;
    width: 0;
    height: 0;
    margin: 8px;
    box-sizing: border-box;
    border: 32px solid var(--accent-color);
    border-color: var(--accent-color) transparent var(--accent-color) transparent;
    animation: neuro-loader 1.2s infinite;
}

@keyframes neuro-loader {
    0% {
        transform: rotate(0);
        animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
    }
    50% {
        transform: rotate(180deg);
        animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
    }
    100% {
        transform: rotate(360deg);
    }
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(240, 240, 240, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.currency-value {
    text-align: right;
    padding-right: 0.75rem;
}

.currency-symbol {
    margin-right: 4px;
    display: inline-block;
}

.text-end {
    text-align: right;
    padding-right: 0.75rem;
}

.chart-container {
    position: relative;
    height: 250px;
    margin-bottom: 10px;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.analytics-card {
    background-color: var(--neuro-100);
    border-radius: 15px;
    padding: 12px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
    box-shadow: var(--neuro-shadow);
    width: calc(100% - 24px); /* Account for padding */
    max-width: calc(100% - 24px);
    overflow-x: hidden;
    box-sizing: border-box;
}

.chart-container {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    position: relative;
    height: 300px;
}
.neuro-container {
    width: calc(100% - 120px);
    max-width: 100vw;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
    overflow-x: hidden;
}

@media (max-width: 991px) {
    .neuro-container {
        max-width: min(1200px, calc(100vw - 120px));
    }
}

@media (max-width: 767px) {
    .neuro-container {
        max-width: min(1200px, calc(100vw - 40px));
    }
}
/* Security Features Styling */
.neuro-input.is-valid {
    border: 2px solid #28a745;
    box-shadow: var(--inner-shadow), 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

.neuro-input.is-invalid {
    border: 2px solid #dc3545;
    box-shadow: var(--inner-shadow), 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.text-success {
    color: #28a745 !important;
}

.text-danger {
    color: #dc3545 !important;
}

.text-warning {
    color: #ffc107 !important;
}

.text-info {
    color: #17a2b8 !important;
}

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

.username-status, .password-match-status {
    font-size: 0.85rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.username-status i, .password-match-status i {
    font-size: 0.9rem;
}

/* Disabled submit button styling */
.neuro-button:disabled, .btn-secondary {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #6c757d;
    color: white;
}

.neuro-button:disabled:hover {
    box-shadow: var(--outer-shadow);
    transform: none;
}

/* Animation for validation icons */
@keyframes fadeInScale {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.username-status i, .password-match-status i {
    animation: fadeInScale 0.3s ease-in-out;
}

/* Mobile responsive button styles */
@media (max-width: 991px) {
    .neuro-button {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    
    .dashboard-header {
        flex-wrap: wrap;
        gap: 10px;
    }
}

@media (max-width: 767px) {
    .neuro-button {
        padding: 8px 16px;
        font-size: 0.9rem;
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .dashboard-header-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    /* Single button on grow tracker dashboard can be wider */
    .dashboard-header .neuro-button.primary {
        min-width: 140px;
        padding: 10px 20px;
    }
    
    /* Remove outer padding when a neuro-card contains a table on mobile */
    .neuro-card:has(.table-responsive),
    .neuro-card:has(table) {
        padding: 0 !important;
    }
    
    /* Keep minimal padding for other content inside the card */
    .neuro-card:has(.table-responsive) form,
    .neuro-card:has(.table-responsive) .card-body,
    .neuro-card:has(table) form,
    .neuro-card:has(table) .card-body {
        padding: 0.5rem !important;
    }
    
    /* Ensure table spans full card width */
    .neuro-card:has(.table-responsive) .table-responsive {
        margin: 0 !important;
        border-radius: 0 !important;
    }
}
