/* --- Header --- */
.navbar-brand {
    color: #212529 !important;
    font-weight: 600;
    font-size: 1.25rem;
    padding-top: 0.8rem;
    padding-bottom: 0.8rem;
}

.header {
    background-color: #fff;
    border-bottom: 1px solid var(--border-color);
}

.header .bi-person-circle {
    font-size: 1.75rem;
    color: var(--text-muted);
    transition: color 0.2s ease-in-out;
}

.header .nav-link:hover .bi-person-circle {
    color: var(--text-dark);
}

/* --- Sidebar --- */
.sidebar {
    background-color: white;
    border-right: 1px solid var(--border-color);
    min-height: calc(100vh - 56px);
    display: flex;
    flex-direction: column;
}

.sidebar > .nav {
    flex: 0 0 auto;
}

.sidebar .nav-link {
    font-weight: 500;
    color: var(--text-dark);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-radius: 0.375rem;
    margin: 0.25rem 0.75rem;
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
}

.sidebar .nav-link .bi {
    font-size: 1.1rem;
    color: var(--text-muted);
    transition: color 0.2s ease-in-out;
}

.sidebar .nav-link:hover {
    background-color: var(--medium-gray-bg);
}

.sidebar .nav-link.active {
    background-color: var(--medium-gray-bg);
    color: var(--text-dark);
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background-color: #e3f2fd !important;   /* Light blue background */
    color: #1976d2 !important;              /* Blue text */
    font-weight: 700 !important;            /* Bold text */
}

.sidebar .nav-link:hover .bi,
.sidebar .nav-link.active .bi {
    color: #1976d2 !important;              /* Blue icon */
}

/* Sidebar Footer */
.sidebar-footer {
    margin-top: auto;
    padding: 1.5rem 1rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
}

.sidebar-footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.sidebar-footer-link {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

.sidebar-footer-link:hover {
    color: var(--brand-blue);
    text-decoration: underline;
}

.sidebar-footer-separator {
    color: var(--text-muted);
}

.sidebar-footer-branding {
    font-size: 0.7rem;
}

.sidebar-footer-text {
    display: inline;
}

.sidebar-footer-brand-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease-in-out;
}

.sidebar-footer-brand-link:hover {
    color: var(--brand-blue);
    text-decoration: underline;
}

/* --- Overview Cards --- */
.overview-card {
    background-color: var(--light-gray-bg);
    border: none;
    border-radius: 0.75rem;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.overview-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.05);
}

.overview-card .card-title {
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.overview-card .card-main-stat {
    font-size: 2.75rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.2;
}

.overview-card .card-subtext {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.card-subtext.positive {
    color: #198754;
}

/* --- Activity List --- */
.activity-list .list-group-item {
    border: none;
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 0.5rem;
}

.activity-list .list-group-item:last-child {
    border-bottom: none;
}

.activity-list .bi {
    font-size: 1.25rem;
    color: var(--brand-blue);
}

.activity-list .activity-text {
    color: var(--text-body);
}

.activity-list .activity-time {
    font-size: 0.875rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.status-badge {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.3em 0.7em;
    border-radius: 0.375rem;
}

.status-completed,
.status-pending {
    background-color: #E9ECEF;
    color: #495057;
}

/* Profile dropdown: keep icon fixed and dropdown below */
.header .nav-item.dropdown {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 48px; /* Fixed width for the icon area */
}

.header #profileDropdown {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    padding: 0;
}

.header .dropdown-menu {
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;        /* Anchor to the right edge */
    left: auto !important;      /* Remove left positioning */
    transform: none !important; /* Remove centering transform */
    min-width: 120px;
    margin-top: 0.5rem;
}

/* Membership */
.welcome-text {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.card {
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-radius: 0.5rem;
}

.table {
    margin-bottom: 0;
}

.table th {
    background-color: #f8f9fa;
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.table td {
    vertical-align: middle;
    border-bottom: 1px solid #f1f3f4;
}

.table tbody tr:hover {
    background-color: rgba(0,0,0,0.02);
}

.member-info h6 {
    margin-bottom: 0.25rem;
    font-weight: 600;
    color: var(--dark-color);
}

.member-info small {
    color: var(--text-muted);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.25);
}

.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.25);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
}

.modal-footer {
    border-top: 1px solid var(--border-color);
}

.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.membership-type {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.membership-social {
    background-color: #e3f2fd;
    color: #1976d2;
}

.membership-senior {
    background-color: #e8f5e8;
    color: #2e7d32;
}

.membership-active {
    background-color: #fff3e0;
    color: #ef6c00;
}

.membership-spouse {
    background-color: #f5f5f5;
    color: #666666;
}

.membership-replacement {
    background-color: #f5f5f5;
    color: #666666;
}

/* Remove or comment out these custom hover styles */
.hover-highlight {
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
}

.hover-highlight:hover {
    background-color: #f5f5f5; 
}

#membersTableBody tr.hover-highlight:hover,
.table tbody tr.hover-highlight:hover {
    background-color: #e3f2fd !important;
    color: #1976d2 !important;
    transition: background-color 0.2s ease-in-out;
}

#membersTableBody tr:hover {
    cursor: pointer;
}

/* Style error placeholder text for invalid fields */
.form-control.is-invalid::placeholder,
input.is-invalid::placeholder,
select.is-invalid::placeholder {
    color: #e57373 !important;      /* Lighter red shade */
    font-size: 0.95em !important;   /* Slightly smaller font */
    font-weight: normal !important; /* Not bold */
    opacity: 1;                     /* Ensure visibility */
}

/* Highlight for newly added or edited rows - flash for 3 seconds */
@keyframes flash-highlight {
    0% {
        background-color: #cfe2ff;
    }
    100% {
        background-color: transparent;
    }
}

#membersTableBody tr.member-row-highlighted td {
    animation: flash-highlight 3s ease-out forwards;
}

#packagesTableBody tr.package-row-highlighted td {
    animation: flash-highlight 3s ease-out forwards;
}

/* Flash animation for auto-populated form fields */
.field-auto-populated {
    animation: flash-highlight 3s ease-out forwards;
}

/* --- Footer --- */
.app-footer {
    background-color: #f8f9fa;
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 0;
    margin-top: auto;
    font-size: 0.875rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.footer-link {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

.footer-link:hover {
    color: var(--brand-blue);
    text-decoration: underline;
}

.footer-separator {
    color: var(--text-muted);
}

.footer-branding {
    color: var(--text-muted);
}

.footer-text {
    display: inline;
}

.footer-brand-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease-in-out;
}

.footer-brand-link:hover {
    color: var(--brand-blue);
    text-decoration: underline;
}

/* Responsive footer for mobile */
@media (max-width: 576px) {
    .footer-content {
        font-size: 0.8rem;
    }

    .footer-links {
        flex-direction: column;
        gap: 0.5rem;
    }

    .footer-separator {
        display: none;
    }
}
