/* ===========================
   COLOR VARIABLES
=========================== */
:root {
    --navy-primary: #1a365d;
    --navy-light: #2c5282;
    --navy-dark: #0f172a;
}

/* ===========================
   RESET & BASE
=========================== */
* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    margin: 0;
    padding: 0;
    background-color: #bad8f7;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

body {
    min-height: 100vh;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, Trebuchet MS, Roboto, Ubuntu, sans-serif;
    display: flex;
    flex-direction: column;
    color: #2c3e50;
    background: transparent;
}

/* Watermark overlay (light fade effect) */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.55);
    z-index: 0;
}

/* ===========================
   MAIN WRAPPER & CONTAINER
=========================== */
.main-wrapper {
    position: relative;
    z-index: 1;
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding-top: 10px;
    padding-bottom: 10px;
    width: 100%;
    top: 0;
}

.container {
    width: 94%;
    max-width: 94%;
}

/* Equal height columns */ 
.row.equal-height {
    display: flex;
    align-items: stretch;
    justify-content: center;
}
.row.equal-height > [class*='col-'] {
    display: flex;
    flex-direction: column;
}

/* ===========================
   NAVBAR
=========================== */
.navbar {
    background: var(--navy-primary) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-brand img {
    max-height: 50px;
    width: auto;
    object-fit: contain;
    display: inline-block;
    vertical-align: middle;
    transform: scale(1.3);
    transform-origin: left center;
    margin-top: -6px;
    margin-bottom: -8px;
    margin-right: 36px;
}

.navbar-nav .nav-item {
    margin: 0 12px;
    letter-spacing: .3px;
    height: 50px;
    display: flex;
    align-items: center;
}

.navbar-nav .nav-link {
    font-size: 22px;
    font-weight: 500;
    color: #ffffff !important;
    padding: 0 1rem;
    transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: #ff8c00 !important;
    background-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
    border-radius: 36px;
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-item.dropdown:hover > .nav-link,
.navbar-dark .dropdown-menu .dropdown-item:hover {
    color: #ff8800 !important;
    background-color: transparent !important;
}

.navbar-nav .dropdown-menu {
    background-color: #1a365d;
    border: none;
}

.navbar-nav .dropdown-menu .dropdown-item {
    color: white;
}

.navbar-nav .dropdown-menu .dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ff8800;
}

.navbar-nav .nav-item.dropdown > .nav-link {
    border-radius: 36px;
    transition: all 0.2s ease-in-out;
}

.navbar-nav .nav-item.dropdown:hover > .nav-link,
.navbar-nav .nav-item.show > .nav-link {
    border-radius: 36px !important;
    color: #ff8800 !important;
    background-color: rgba(255,255,255,0.1) !important;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.2);
}

.navbar-nav .nav-link,
.dropdown-item {
    transition: color 0.2s ease-in-out;
}

/* Active page highlight */
.navbar-nav .nav-link.nav-active {
    color: #ff8c00 !important;
    background-color: rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
    border-radius: 36px;
}
.navbar-nav .dropdown-menu .dropdown-item.nav-active-item {
    color: #ff8c00 !important;
    background-color: rgba(255, 255, 255, 0.1) !important;
    font-weight: 600;
}

/* ===========================
   FOOTER
=========================== */
footer {
    position: relative !important;
    flex-shrink: 0 !important;
    width: 100% !important;
    margin-top: auto !important;
    background-color: var(--navy-primary) !important;
    color: white !important;
    border-top: 1px solid #e2e8f0;
    z-index: 1000;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
}

footer .container {
    padding: 1.5rem 0 !important;
}

/* ===========================
   BUTTONS
=========================== */
.btn-navy {
    background: linear-gradient(135deg, var(--navy-primary) 0%, var(--navy-light) 100%);
    border: none;
    border-radius: 10px;
    font-weight: 600;
    color: white;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(26, 54, 93, 0.4);
}

.btn-navy:focus,
.btn-navy:focus-visible {
    color: white;
    box-shadow: 0 0 0 0.25rem rgba(26, 54, 93, 0.5);
}

.btn-navy:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(26, 54, 93, 0.5);
    background: linear-gradient(135deg, var(--navy-light) 0%, var(--navy-primary) 100%);
    color: white;
    text-decoration: none;
}
.btn-navy.active,
.btn-navy:active {
    color: white;
}

/* Password toggle button matches input background */
.input-group .toggle-password {
    background-color: transparent;
    border-color: #e9ecef;
    color: #6c757d;
}

.input-group .toggle-password:hover,
.input-group .toggle-password:focus {
    background-color: transparent;
    border-color: #e9ecef;
    color: #495057;
    box-shadow: none;
}

/* Match Chrome autofill tint on the eye button */
.input-group:has(input:-webkit-autofill) .toggle-password {
    background-color: rgb(232, 240, 254);
}

/* Normalize Chrome autofill background inside input-groups (password fields) */
.input-group input:-webkit-autofill,
.input-group input:-webkit-autofill:hover,
.input-group input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0px 1000px #fff inset !important;
    box-shadow: 0 0 0px 1000px #fff inset !important;
    -webkit-text-fill-color: #212529 !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* ===========================
   CARDS
=========================== */
.card,
.register-card {
    border: none;
    border-radius: 16px;
    background: white !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    flex: 1;
}

.register-card .card-body {
    background: #ffffff;
    border-radius: 16px;
    padding: 2rem !important;
}

/* New merged card-body stretch */
.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    overflow: hidden;
}

.card.register-card {
    margin-top: 0; /* override Bootstrap default spacing */
    height: fit-content;
}

/* Dashboard accordion — override overflow:hidden so collapse animation works */
#investmentAccordion {
    overflow-y: auto;
    max-height: 65vh;
    padding-right: 4px;
}

#investmentAccordion .card-body,
#investmentAccordion .accordion-collapse {
    overflow: visible;
}

#investmentAccordion::-webkit-scrollbar { width: 8px; }
#investmentAccordion::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.accordion-button:not(.collapsed) {
    background-color: #d3e3fd;
    color: #1a365d;
}

#investmentAccordion .input-group-text {
    min-width: 140px;
    justify-content: center;
    font-weight: 500;
}

/* ===========================
   FORMS
=========================== */
label {
    font-size: 1.1rem;
    font-weight: 500;
}

.form-control-lg {
    border-radius: 10px;
    border: 2px solid #e9ecef;
    padding: 0.75rem 1rem;
    font-size: 1rem;
}

.form-control:focus,
.form-control-lg:focus,
.form-check-input:focus {
    border-color: var(--navy-primary);
    box-shadow: 0 0 0 0.2rem rgba(26, 54, 93, 0.25);
}

.form-check-input:checked {
    background-color: var(--navy-primary);
    border-color: var(--navy-primary);
}

/* ===========================
   VALIDATION
=========================== */
.was-validated .form-control:invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.was-validated .form-control:valid {
    border-color: #198754;
    box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.25);
}

.was-validated .form-check-input:invalid ~ .form-check-label {
    color: #dc3545;
}

/* ===========================
   ALERTS
=========================== */
.alert {
    border-radius: 10px;
    border: none;
    font-weight: 500;
}

.alert-danger {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #dc2626;
}

/* ===========================
   UTILITIES
=========================== */
.text-navy {
    color: var(--navy-primary) !important;
}

.bg-navy {
    background: linear-gradient(135deg, var(--navy-primary) 0%, var(--navy-light) 100%) !important;
}

/* ===========================
   BOARD / MEMBER LISTS
=========================== */
#boardList .list-group-item,
#memberList li,
#investmentList li,
#assignedMembersList li {
    margin-bottom: 0 !important;
    border-radius: 1rem !important;
    transition: all 0.2s ease;
}
#distributionMembersList li {
    margin-bottom: 0 !important;
    border-radius: 1rem !important;
    transition: all 0.2s ease;
}
#distributionList li {
    margin-bottom: 0 !important;
    border-radius: 1rem !important;
    transition: all 0.2s ease;
}
#investorDashboard li {
    margin-bottom: 0 !important;
    border-radius: 1rem !important;
    transition: all 0.2s ease;
}

#boardList .list-group-item:hover,
#memberList li:hover,
#investmentList li:hover,
#assignedMembersList li:hover {
  transform: translateY(-4px); /* lifts card slightly */
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  cursor: pointer;
  background-color: #d3e3fd;
}
#distributionMembersList li:hover {
  transform: translateY(-4px); /* lifts card slightly */
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  cursor: pointer;
  background-color: #d3e3fd;
}
#distributionList li:hover {
  transform: translateY(-4px); /* lifts card slightly */
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  cursor: pointer;
  background-color: #d3e3fd;
}
#investorDashboard li:hover {
  transform: translateY(-4px); /* lifts card slightly */
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  cursor: pointer;
  background-color: #d3e3fd;
}

/* Selected row highlight — override Bootstrap's default blue active */
#investmentList .investment-row,
#memberList .member-row,
#investmentSelectorList .investment-row,
#invDashList .inv-dash-row {
    transition: none !important;
}

#investmentList .investment-row.active,
#memberList .member-row.active,
#invDashList .inv-dash-row.active {
    background-color: var(--navy-primary) !important;
    color: #fff !important;
    border-color: var(--navy-primary) !important;
}

#investmentList .investment-row.active .text-muted,
#investmentList .investment-row.active .badge,
#memberList .member-row.active .text-muted,
#memberList .member-row.active .badge,
#invDashList .inv-dash-row.active .text-muted,
#invDashList .inv-dash-row.active .badge {
    color: rgba(255,255,255,0.8) !important;
}

#investmentList .investment-row.active .dist-amount,
#invDashList .inv-dash-row.active .text-success,
#invDashList .inv-dash-row.active .text-danger {
    color: #fff !important;
}

/* Scrollable lists — consistent max-height across all panels */
#assignedMembersList,
#distributionMembersList,
#distributionList,
#investorDashboard,
#boardList,
#memberList,
#investmentList {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    max-height: calc(110vh - 320px);
    padding-right: 4px;
}

#memberList::-webkit-scrollbar,
#boardList::-webkit-scrollbar,
#investmentList::-webkit-scrollbar,
#assignedMembersList::-webkit-scrollbar,
#distributionMembersList::-webkit-scrollbar,
#distributionList::-webkit-scrollbar,
#investorDashboard::-webkit-scrollbar,
#invDashList::-webkit-scrollbar,
#invDistTableWrap::-webkit-scrollbar,
#newInvestmentForm::-webkit-scrollbar,
#distTableWrap::-webkit-scrollbar,
#memberDropdown::-webkit-scrollbar {
    width: 6px;
}

#memberList::-webkit-scrollbar-thumb,
#boardList::-webkit-scrollbar-thumb,
#investmentList::-webkit-scrollbar-thumb,
#assignedMembersList::-webkit-scrollbar-thumb,
#distributionMembersList::-webkit-scrollbar-thumb,
#distributionList::-webkit-scrollbar-thumb,
#investorDashboard::-webkit-scrollbar-thumb,
#invDashList::-webkit-scrollbar-thumb,
#invDistTableWrap::-webkit-scrollbar-thumb,
#newInvestmentForm::-webkit-scrollbar-thumb,
#distTableWrap::-webkit-scrollbar-thumb,
#memberDropdown::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

/* Hide filtered-out items gracefully */
#memberList li[style*="none"],
#boardList li[style*="none"],
#investmentList li[style*="none"],
#assignedMembersList li[style*="none"],
#distributionMembersList li[style*="none"],
#distributionList li[style*="none"],
#investorDashboard li[style*="none"],
#newInvestmentForm li[style*="none"] {
    margin: 0 !important;
    padding: 0 !important;
    height: 0 !important;
    overflow: hidden;
    border: none !important;
}

/* Prevent background or card height from moving */
#manageInvestmentHeader,
#assignedMembersHeader {
    flex-shrink: 0;
}

/* Drag-and-drop indicators */
.drag-over {
    background-color: #d9f0ff !important;
    border: 2px dashed #007bff !important;
}
.dragging {
    opacity: 0.5;
}
.drag-over-item {
    background-color: #e8f4fd !important;
    outline: 2px dashed #0d6efd;
    border-radius: 0.25rem;
}

/* Compact investment selector list (manage_investments left panel) */
#investmentSelectorList {
    overflow-y: auto;
    max-height: 200px;
    padding-right: 4px;
}
#investmentSelectorList::-webkit-scrollbar { width: 6px; }
#investmentSelectorList::-webkit-scrollbar-thumb {
    background-color: rgba(0,0,0,0.2);
    border-radius: 10px;
}
#investmentSelectorList .investment-row.active {
    background-color: var(--navy-primary) !important;
    color: #fff !important;
    border-color: var(--navy-primary) !important;
}
#investmentSelectorList .investment-row.active .text-muted,
#investmentSelectorList .investment-row.active .badge {
    color: rgba(255,255,255,0.8) !important;
}

/* Select2 single select styling */
.select2-container .select2-selection--single {
    height: 38px;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    padding: 4px 8px;
}

/* ===========================
   RESPONSIVE
=========================== */
@media (max-width: 768px) {
    .register-card .card-body {
        padding: 1.5rem !important;
        border-radius: 12px;
    }

    .btn-lg {
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }

    .main-wrapper {
        min-height: calc(100vh - 160px);
        padding: 0.5rem;
    }

    .row > .col-md-6 {
        margin-bottom: 1rem;
    }
}

/* ===========================
   MISC
=========================== */
.carousel-item img {
    height: 83vh;
    object-fit: cover;
}

.text-shadow {
  text-shadow: 0 0 6px rgba(0, 51, 102, 0.6);
}

#confirmActionHeader.bg-success,
#confirmActionHeader.bg-danger {
    color: #fff;
}

.btn-md {
    padding: 0.5rem 0.9rem;
    font-size: 1.1rem;
    border-radius: 0.75rem;
}
::placeholder {
    color: #adb5bd !important;
    opacity: 1;
}

/* 5-column layout for xl+ screens */
@media (min-width: 1200px) {
    .col-xl-2dot4 {
        flex: 0 0 auto;
        width: 20%;
    }
}