/* Banyan Tree Village — shared site stylesheet
 * Consolidated in original cascade order. Intentional media-query and
 * specificity overrides remain in place to preserve existing appearances.
 * Page-specific stylesheets are loaded separately by their own templates.
 */

/* ==========================================================================
   1. Theme, typography, navigation and responsive components
   ========================================================================== */
/* Banyan Tree Village Custom CSS */

/* Root Variables: Define primary colors and values used throughout the site
   Using CSS variables allows for easy theme changes and consistency */
:root {
  --bs-primary: #a3e0e3 !important;      /* Main theme color - Light blue */
  --bs-primary-rgb: 163, 224, 227 !important;  /* RGB values for opacity/alpha variations */
  --bs-white: #fffffc !important;        /* Custom off-white for better readability */
  --bs-white-rgb: 255, 255, 252 !important;
  --bs-body-bg: #fffffc !important;      /* Page background color */
  --bs-secondary: #6c757d;               /* Secondary gray color */
  --bs-success: #198754;                 /* Success state color - Green */
  --bs-danger: #dc3545;                  /* Danger/error state color - Red */
  --bs-warning: #ffc107;                 /* Warning state color - Yellow */
  --bs-info: #0dcaf0;                    /* Info state color - Cyan */
  --bs-nav-link-color: #3d3333;          /* Navigation link color */
  --bs-nav-link-hover-bg: rgba(61, 51, 51, 0.1); /* Navigation hover background */
}

/* Button Styling: Override Bootstrap's default button styles */
.btn-primary {
  background-color: var(--bs-primary) !important;
  border-color: var(--bs-primary) !important;
}

/* Outline Button Styling: For secondary action buttons */
.btn-outline-primary {
  color: #3d3333 !important;
  border-color: #3d3333 !important;
}

/* Hover/Focus States: Interactive states for outline buttons */
.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active {
  background-color: var(--bs-primary) !important;
  color: #fff !important;
}

/* Background and Text Color Utilities */
.bg-primary { background-color: var(--bs-primary) !important; }
.text-primary { color: var(--bs-primary) !important; }
.border-primary { border-color: var(--bs-primary) !important; }

/* Link Styling */
a {
  color: var(--bs-primary);
}

a:hover {
  color: #8bc2c2;  /* Darker shade for hover state */
}

/* Badge Styling: For status indicators and tags */
.badge.bg-primary {
  background-color: var(--bs-primary) !important;
}

/* Dropdown Menu Styling */
.dropdown-item.active, 
.dropdown-item:active {
  background-color: var(--bs-primary) !important;
}

/* Pagination Controls */
.page-link {
  color: var(--bs-primary) !important;
}

.page-item.active .page-link {
  background-color: var(--bs-primary) !important;
  border-color: var(--bs-primary) !important;
  color: #fff !important;
}

/* Hero Section: Main banner area with background image */
.hero-section {
    background: url('/static/images/banyan-tree-grounds.jpg') center/cover no-repeat;
    position: relative;
}

.hero-section .hero-copy {
    position: relative;
    z-index: 0;
    isolation: isolate;
    width: max-content;
    max-width: 100%;
    padding: 1.25rem 3rem 1.25rem 1.5rem;
}

.hero-section .hero-copy::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0;
    border-radius: 0.5rem;
    background: linear-gradient(
        90deg,
        rgba(8, 25, 22, 0.68) 0%,
        rgba(8, 25, 22, 0.68) calc(100% - 3rem),
        rgba(8, 25, 22, 0) 100%
    );
    pointer-events: none;
}

/* Global Layout and Typography */
body {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    min-height: 100vh;  /* Ensures full viewport height */
    display: flex;
    flex-direction: column;  /* Enables footer to stick to bottom */
    background-color: var(--bs-white);
}

/* Component Background Colors: Ensure consistent background across components */
.card, 
.navbar-light,
.dropdown-menu,
.modal-content,
.list-group-item,
.table,
.form-control,
.bg-white {
    background-color: var(--bs-white) !important;
}

/* Form Input Text Styling: Ensure proper contrast for readability */
.form-control {
    color: #212529 !important;  /* Dark text for better readability */
    font-weight: 400;
}

.form-control::placeholder {
    color: #3d3333 !important;  /* Dark color for better readability */
    opacity: 0.7;
}

/* Focus state for form inputs */
.form-control:focus {
    color: #212529 !important;  /* Maintain dark text on focus */
    background-color: var(--bs-white) !important;
    border-color: var(--bs-primary) !important;
    box-shadow: 0 0 0 0.2rem rgba(163, 224, 227, 0.25) !important;
}

/* Form select (dropdown) styling for better visibility */
.form-select {
    color: #3d3333 !important;
    background-color: var(--bs-white) !important;
    border-color: #ced4da;
}

.form-select:focus {
    color: #3d3333 !important;
    background-color: var(--bs-white) !important;
    border-color: var(--bs-primary) !important;
    box-shadow: 0 0 0 0.2rem rgba(163, 224, 227, 0.25) !important;
}

.form-select option {
    color: #3d3333 !important;
    background-color: var(--bs-white) !important;
}

/* Help text and descriptive text */
.form-text {
    color: #3d3333 !important;
}

/* File upload text */
.form-control[type="file"]::file-selector-button {
    color: #3d3333 !important;
    background-color: #f8f9fa !important;
    border-color: #ced4da !important;
}

/* Ensure all Bootstrap secondary text uses proper contrast */
.text-secondary {
    color: #3d3333 !important;
}

/* Portal button grid styling - Uniform sizing for all buttons */
.portal-btn-grid .btn {
    max-height: 80px;
    font-size: 0.8rem;
    line-height: 1.1;
    text-align: center;
    white-space: normal;
    word-wrap: break-word;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.25rem;
    overflow: hidden;
}

.portal-btn-grid .btn i {
    flex-shrink: 0;
    margin-bottom: 0.25rem;
    margin-right: 0;
    font-size: 1.1rem;
}

.portal-btn-grid .btn span {
    display: block;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    hyphens: auto;
    word-break: break-word;
}

/* Mobile responsive adjustments */
@media (max-width: 576px) {
    .portal-btn-grid .btn {
        min-height: 75px;
        max-height: 75px;
        font-size: 0.75rem;
        padding: 0.4rem 0.2rem;
    }
    
    .portal-btn-grid .btn i {
        font-size: 1rem;
        margin-bottom: 0.2rem;
    }
}

/* Tablet adjustments */
@media (min-width: 577px) and (max-width: 768px) {
    .portal-btn-grid .btn {
        min-height: 78px;
        max-height: 78px;
        font-size: 0.77rem;
    }
}

/* Desktop adjustments */
@media (min-width: 769px) {
    .portal-btn-grid .btn {
        min-height: 85px;
        max-height: 85px;
        font-size: 0.82rem;
        padding: 0.6rem 0.3rem;
    }
    
    .portal-btn-grid .btn i {
        font-size: 1.1rem;
        margin-bottom: 0.3rem;
    }
}

/* Mobile-First Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        background-size: cover;
        background-position: center;
    }

    img {
        max-width: 768px;
    }
}

/* Desktop Styles */
@media (min-width: 769px) {
    img {
        max-width: 1920px;
    }
}

/* Layout Utilities */
main {
    flex: 1;  /* Pushes footer to bottom */
}

/* Navigation Styling */


/* Banyan Tree Logo Styling */
.banyan-tree-logo {
    vertical-align: middle;
}

.navbar-dark .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23ffffff' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}

.navbar-toggler {
    border-color: rgba(255, 255, 255, 0.3) !important;
}

/* Dropdown Menu Text Color */
.navbar-dark .navbar-nav .nav-link,
.dropdown-menu .dropdown-item {
    color: #3d3333 !important;
}

/* Simple Header design matching exact image layout */
.simple-header {
    background-color: var(--bs-primary) !important;
    padding: 0.75rem 0;
    border: none;
    box-shadow: none;
}

.simple-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Logo styling */
.navbar-brand-container {
    display: flex;
    align-items: center;
}

.navbar-brand {
    color: #3d3333 !important;
    font-weight: 600;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    margin-right: 0;
    padding: 0;
}

.banyan-tree-logo {
    height: 30px;
    width: auto;
    margin-right: 10px;
    filter: brightness(0) invert(1);
}

/* Simple horizontal navigation */
.simple-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-left: 2rem;
}

.simple-nav .nav-item {
    color: #3d3333 !important;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s;
    padding: 0;
    border: none;
    background: transparent;
    position: relative;
    white-space: nowrap;
}

.simple-nav .nav-item:hover,
.simple-nav .nav-item.active {
    color: #212529 !important;
    opacity: 0.8;
}

/* User menu in the top right */
.user-menu {
    margin-left: 1rem;
}

.dropdown-toggle {
    color: #3d3333 !important;
    text-decoration: none;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    font-weight: 500;
}

.dropdown-toggle::after {
    margin-left: 0.5rem;
}

.dropdown-toggle i {
    margin-right: 0.25rem;
}

.auth-link {
    color: #3d3333 !important;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.auth-link:hover {
    color: #212529 !important;
    opacity: 0.8;
}

/* Mobile menu styling */
.navbar-toggler {
    border: none;
    color: #3d3333 !important;
    padding: 0.25rem 0.5rem;
    font-size: 1.1rem;
    background: transparent;
    outline: none !important;
    box-shadow: none !important;
}

/* Mobile navigation collapse menu */
.navbar-collapse {
    background-color: var(--bs-primary);
    border-top: 1px solid rgba(61, 51, 51, 0.1);
}

/* Override Bootstrap's default nav-link color for mobile - highest specificity */
.navbar-collapse .navbar-nav .nav-item .nav-link {
    color: #3d3333 !important;
    font-weight: 500;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(61, 51, 51, 0.1);
}

.navbar-collapse .navbar-nav .nav-item .nav-link:hover,
.navbar-collapse .navbar-nav .nav-item .nav-link.active {
    color: #212529 !important;
    background-color: rgba(61, 51, 51, 0.1);
    opacity: 0.9;
}

/* Additional override for any remaining nav-link elements */
.navbar-collapse .nav-link {
    color: #3d3333 !important;
    font-weight: 500;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(61, 51, 51, 0.1);
}

.navbar-collapse .nav-link:hover,
.navbar-collapse .nav-link.active {
    color: #212529 !important;
    background-color: rgba(61, 51, 51, 0.1);
    opacity: 0.9;
}

/* Mobile separator styling */
.navbar-collapse .text-light {
    border-color: rgba(61, 51, 51, 0.3) !important;
}

.mobile-nav {
    background-color: var(--bs-primary);
    border-top: 1px solid rgba(255,255,255,0.1);
}

.mobile-nav-items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mobile-nav-item {
    color: #3d3333 !important;
    text-decoration: none;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(61, 51, 51, 0.1);
    font-weight: 500;
}

.mobile-nav-item:hover,
.mobile-nav-item.active {
    color: #212529 !important;
    opacity: 0.8;
}

/* Dropdown styles */
.dropdown-menu {
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border: none;
    margin-top: 0.5rem;
    animation: dropdown-animation 0.2s ease forwards;
}

@keyframes dropdown-animation {
    0% {
        opacity: 0;
        transform: translateY(-10px) scale(0.98);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.dropdown-item {
    padding: 0.5rem 1.25rem;
    transition: all 0.2s ease;
    color: #3d3333 !important;
}

.dropdown-item:hover {
    background-color: rgba(61, 51, 51, 0.05);
    color: #212529 !important;
}

/* Footer Styling */
footer {
    margin-top: auto;  /* Sticks footer to bottom */
    background-color: #3d3333 !important;
    font-size: 0.9rem;
    color: #ffffff !important;
}

/* More compact footer styling */
footer h6 {
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff !important;
}

footer .small {
    font-size: 0.85rem;
    color: #ffffff !important;
}

/* Ensure all footer text is white */
footer, 
footer * {
    color: #ffffff !important;
}

footer a {
    color: #ffffff !important;
}

footer a:hover {
    color: #a3e0e3 !important;
}

footer .text-light {
    color: #ffffff !important;
}

footer .footer-links {
    line-height: 1.2;
}

footer .social-icons a {
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

footer .social-icons a:hover {
    opacity: 1;
}

/* Card Component Styling */
.card {
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: all 0.3s ease;  /* Smooth hover effect */
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Board Position Assignment Card Headers - Enhanced Legibility */
.card-header h6 {
    color: #212529 !important;
    font-weight: 700 !important;
    font-size: 1rem !important;
    text-shadow: none !important;
    opacity: 1 !important;
}

/* Specific styling for board position cards */
.card-header .fas {
    color: #212529 !important;
    opacity: 0.8;
    margin-right: 0.5rem;
}

/* Ensure all card headers have proper contrast */
.card-header {
    background-color: #f8f9fa !important;
    border-bottom: 2px solid #dee2e6 !important;
    padding: 1rem !important;
}

/* Override any muted text in card headers */
.card-header .text-muted {
    color: #495057 !important;
    font-weight: 500 !important;
}

/* Google Maps Container Styling */
.map-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.map-container:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
    transform: translateY(-3px);
}

.map-container:hover::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(166, 224, 224, 0.2);
    pointer-events: none;
}

.map-container iframe {
    width: 100%;
    height: 100%;
    min-height: 200px;
    border: none;
    display: block;
}

.map-container img {
    transition: all 0.3s ease;
    display: block;
    width: 100%;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);  /* Enhanced shadow on hover */
}

/* Card Layout Management */
.card-body {
    flex: 1;
}

.card-header {
    border-radius: 0.5rem 0.5rem 0 0 !important;  /* Rounded top corners */
}

/* Button Base Styling */
.btn {
    border-radius: 0.25rem;
}

/* Light Background Override */
.bg-light {
    background-color: var(--bs-white) !important;
}

/* Blog Content Typography and Spacing */
.blog-content img {
    max-width: 100%;
    height: auto;
}

.blog-content h1, 
.blog-content h2, 
.blog-content h3, 
.blog-content h4, 
.blog-content h5, 
.blog-content h6 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.blog-content p {
    margin-bottom: 1rem;
}

.blog-content ul, 
.blog-content ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

/* Calendar Widget Styling */
#calendar {
    max-width: 100%;
    margin: 0 auto;
}

.fc-event {
    cursor: pointer;
    border-radius: 0.25rem;
}

/* Compact UI Components */
.card-body {
    padding: 0.75rem;
}

.list-group-item {
    padding: 0.5rem 1rem;
}

.btn {
    padding: 0.375rem 0.75rem;
}

.card + .card {
    margin-top: 0.75rem;  /* Spacing between stacked cards */
}

/* Legend Card Specific Styling */
.legend-card .list-group-item {
    padding: 0.25rem 0.5rem;
    font-size: 0.9rem;
}

/* Bulletin Board Category Labels */
.bulletin-category-badge {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
}

/* Text Truncation Utilities */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Admin Dashboard Statistics Cards */
.admin-stat-card {
    text-align: center;
    padding: 1.5rem;
}

.admin-stat-card .icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.admin-stat-card .value {
    font-size: 2rem;
    font-weight: bold;
}

.admin-stat-card .label {
    font-size: 1rem;
    color: #6c757d;
}

/* Responsive Design Enhancements - Mobile-First Approach */

/* Base mobile styles (0-575px) */
.container {
    padding-left: 15px;
    padding-right: 15px;
}

/* Fluid Typography */
h1, .h1 {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
}

h2, .h2 {
    font-size: clamp(1.3rem, 3.5vw, 2rem);
}

h3, .h3 {
    font-size: clamp(1.1rem, 3vw, 1.75rem);
}

.display-5 {
    font-size: clamp(2rem, 6vw, 3rem);
}

.lead {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
}

/* Enhanced Mobile Navigation (up to tablet) */
@media (max-width: 991.98px) {
    /* Hide desktop navigation on tablets and mobile */
    .simple-nav {
        display: none !important;
    }

    /* Show mobile toggle button */
    .navbar-toggler {
        display: block !important;
        border: none;
        padding: 0.25rem 0.5rem;
        background: rgba(61, 51, 51, 0.1);
        border-radius: 0.375rem;
    }

    /* Mobile navigation dropdown */
    .navbar-collapse {
        background-color: var(--bs-primary);
        padding: 1rem;
        border-radius: 0 0 0.5rem 0.5rem;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        max-height: 80vh;
        overflow-y: auto;
        margin-top: 0.5rem;
    }

    .navbar-nav .nav-item {
        margin-bottom: 0.5rem;
    }

    .navbar-nav .nav-link {
        padding: 0.75rem 1rem !important;
        border-radius: 4px;
        color: #ffffff !important;
        font-weight: 500;
        min-height: 44px; /* Touch-friendly size */
        display: flex;
        align-items: center;
    }

    .navbar-nav .nav-link:hover,
    .navbar-nav .nav-link.active {
        background-color: rgba(255, 255, 255, 0.1);
        color: #f0f0f0 !important;
    }
}

/* Small Mobile Specific (up to 575px) */
@media (max-width: 575.98px) {
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }

    /* Hero section adjustments */
    .hero-section {
        padding: 2rem 1rem !important;
    }

    .hero-section .fs-4 {
        font-size: 1.1rem !important;
    }

    /* Card adjustments */
    .card-body {
        padding: 1rem;
    }

    /* Button adjustments */
    .btn {
        min-height: 44px; /* Touch-friendly */
        padding: 0.5rem 1rem;
    }

    .btn-lg {
        font-size: 1rem;
        padding: 0.75rem 1.5rem;
    }
}

/* Tablet Specific (576px - 991px) */
@media (min-width: 576px) and (max-width: 991.98px) {
    .container {
        padding-left: 20px;
        padding-right: 20px;
    }

    /* Optimize card layouts for tablets */
    .row-cols-md-2 > * {
        flex: 0 0 auto;
        width: 50%;
    }

    .row-cols-md-3 > * {
        flex: 0 0 auto;
        width: 33.333333%;
    }

    /* Hero section tablet optimization */
    .hero-section {
        padding: 3rem 2rem !important;
    }
}

/* Large tablets and small desktop (992px - 1199px) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .simple-nav {
        gap: 1rem; /* Reduce gap for smaller desktop */
    }

    .simple-nav .nav-item {
        font-size: 0.9rem;
    }
}

/* Enhanced Card Layouts for All Screen Sizes */
.card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Card Grid Improvements */
.row.g-3 {
    --bs-gutter-x: 1rem;
    --bs-gutter-y: 1rem;
}

/* Touch-friendly buttons across all devices */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* Card body optimization */
.card-body {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card-body .btn {
    margin-top: auto; /* Push buttons to bottom */
}

/* Feature cards on homepage */
.card.h-100 .card-body {
    padding: 1.5rem;
}

/* Small mobile specific adjustments */
@media (max-width: 575.98px) {
    .card.h-100 .card-body {
        padding: 1rem;
    }

    .card.h-100 .card-body .fa-3x {
        font-size: 2rem !important; /* Smaller icons on mobile */
    }

    /* Optimize button spacing in cards */
    .card-body .btn + .btn {
        margin-top: 0.5rem;
    }
}

/* Tablet optimizations */
@media (min-width: 576px) and (max-width: 991.98px) {
    .card.h-100 .card-body {
        padding: 1.25rem;
    }

    /* Ensure equal height cards work properly */
    .row-cols-md-2 .card,
    .row-cols-md-3 .card {
        height: 100%;
    }
}

/* Mobile footer adjustments */
@media (max-width: 767.98px) {
    footer .row > div {
        margin-bottom: 1rem;
        text-align: center;
    }

    footer .footer-links {
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        margin: 0.5rem 0;
    }

    footer .footer-links a {
        margin: 0.25rem;
    }

    footer .social-icons {
        display: flex;
        justify-content: center;
        margin-bottom: 0.5rem;
    }
}

.list-group-item.active, 
.list-group-item:active {
    background-color: var(--bs-primary) !important;
    color: #3d3333 !important;
}

/* Force dark text specifically for mobile navbar */
.navbar-collapse .navbar-nav .nav-link {
  color: #3d3333 !important;
}

/* Override any Bootstrap navbar defaults on teal background */
.simple-header .nav-link {
  color: #3d3333 !important;
}

/* ==========================================================================
   2. Document layout
   ========================================================================== */
/* Responsive document cards styling for mobile */
@media (max-width: 767.98px) {
    /* Make sure mobile cards have proper spacing */
    .document-card {
        margin-bottom: 15px;
    }
    
    /* Ensure card title stands out */
    .document-card .card-title {
        font-weight: 600;
    }
    
    /* Better button spacing in cards */
    .document-card .btn {
        margin-bottom: 5px;
        padding: 8px 12px;
    }
    
    /* Make sure card content has proper padding */
    .document-card .card-body {
        padding: 15px;
    }
    
    /* Ensure table is completely hidden on mobile */
    .mobile-hidden {
        display: none !important;
    }
}

/* Ensure card buttons are touchable size on mobile */
.document-action-btn {
    min-height: 38px;
    min-width: 80px;
}

/* Prevent horizontal scrolling on document cards */
.document-cards-container {
    overflow-x: hidden;
}

/* ==========================================================================
   3. Image presentation and carousel sizing
   ========================================================================== */


/* Responsive image with srcset support */
.responsive-image {
    width: 100%;
    height: auto;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

/* Hero images - different sizes for different devices */
.hero-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    object-position: center;
}

@media (min-width: 768px) {
    .hero-image {
        height: 500px;
    }
}

@media (min-width: 1200px) {
    .hero-image {
        height: 600px;
    }
}

/* Gallery thumbnails with responsive sizing */
.gallery-thumbnail {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-thumbnail:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

@media (min-width: 576px) {
    .gallery-thumbnail {
        height: 250px;
    }
}

@media (min-width: 992px) {
    .gallery-thumbnail {
        height: 300px;
    }
}

/* Gallery images with proper aspect ratios */
.gallery-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
}

.gallery-image:hover {
    transform: scale(1.05);
}

/* Hero section background images */
.hero-section {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Card images */
.card-img-top {
    height: 200px;
    object-fit: cover;
    object-position: center;
}

/* Blog post images */
.blog-image {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: cover;
    border-radius: 0.375rem;
    margin: 1rem 0;
}

/* Avatar and profile images */
.avatar {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 50%;
}

.profile-image {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 50%;
}

/* Responsive image containers */
.image-container {
    position: relative;
    overflow: hidden;
    border-radius: 0.375rem;
}

.image-container::before {
    content: '';
    display: block;
    padding-top: 56.25%; /* 16:9 aspect ratio */
}

.image-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Mobile optimizations */
@media (max-width: 575.98px) {
    .gallery-image {
        height: 150px;
    }
    
    .card-img-top {
        height: 150px;
    }
    
    .blog-image {
        max-height: 250px;
    }
    
    .profile-image {
        width: 100px;
        height: 100px;
    }
}

/* Tablet optimizations */
@media (min-width: 576px) and (max-width: 991.98px) {
    .gallery-image {
        height: 180px;
    }
    
    .card-img-top {
        height: 180px;
    }
    
    .blog-image {
        max-height: 350px;
    }
}

/* Loading placeholder for images */
.image-loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Lazy loading optimization */
img[loading="lazy"] {
    /* Native lazy loading doesn't add a "loaded" class. Keep decoded images
       visible even when they were cached or JavaScript hasn't run. */
    opacity: 1;
    transition: opacity 0.3s;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* Carousel image styles - responsive without cropping */
.carousel-item img {
    width: 100%;
    height: auto;
    object-fit: contain;
    object-position: center;
    max-height: 60vh;
}

/* Carousel container styling */
.carousel-inner {
    background-color: #f8f9fa;
}

/* Carousel links */
.carousel-item a {
    display: block;
    text-decoration: none;
    text-align: center;
}

/* Carousel native resolution options */
.carousel-image-native {
    width: 100%;
    height: auto;
    max-height: 60vh;
    object-fit: contain;
    object-position: center;
}

.carousel-image-aspect {
    width: 100%;
    height: 50vh;
    object-fit: contain;
    object-position: center;
    background-color: #000;
}

.carousel-image-letterbox {
    width: 100%;
    height: 400px;
    object-fit: contain;
    object-position: center;
    background-color: #f8f9fa;
}

/* Responsive carousel heights */
@media (max-width: 575.98px) {
    .carousel-item img {
        max-height: 40vh;
    }
    
    .carousel-image-native {
        max-height: 40vh;
    }
    
    .carousel-image-aspect {
        height: 30vh;
    }
    
    .carousel-image-letterbox {
        height: 250px;
    }
}

@media (min-width: 576px) and (max-width: 991.98px) {
    .carousel-item img {
        max-height: 50vh;
    }
    
    .carousel-image-native {
        max-height: 50vh;
    }
    
    .carousel-image-aspect {
        height: 40vh;
    }
    
    .carousel-image-letterbox {
        height: 350px;
    }
}

@media (min-width: 992px) {
    .carousel-item img {
        max-height: 60vh;
    }
}

/* ==========================================================================
   4. Accessibility, keyboard focus and alternate display modes
   ========================================================================== */
/* ADA Compliance CSS - Banyan Tree Village */

/* Skip Links for Screen Readers */
.skip-links {
  position: absolute;
  top: -40px;
  left: 6px;
  z-index: 9999;
}

.skip-link,
.visually-hidden-focusable {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link:focus,
.visually-hidden-focusable:focus {
  position: static !important;
  width: auto !important;
  height: auto !important;
  padding: 8px 16px !important;
  margin: 0 !important;
  overflow: visible !important;
  clip: auto !important;
  white-space: normal !important;
  background-color: #000 !important;
  color: #fff !important;
  text-decoration: none !important;
  border-radius: 4px !important;
  font-weight: bold !important;
  z-index: 10000 !important;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .btn-primary {
    background-color: #000 !important;
    border-color: #000 !important;
    color: #fff !important;
  }
  
  .btn-outline-primary {
    color: #000 !important;
    border-color: #000 !important;
  }
  
  .btn-outline-primary:hover {
    background-color: #000 !important;
    color: #fff !important;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .carousel {
    animation: none !important;
  }
  
  .fade {
    transition: none !important;
  }
}

/* Enhanced Focus Indicators */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus,
.btn:focus,
.nav-link:focus,
.dropdown-toggle:focus {
  outline: 3px solid #005fcc !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 3px rgba(0, 95, 204, 0.3) !important;
}

/* Navigation accessibility improvements */
.nav-item.active,
.nav-link[aria-current="page"] {
  font-weight: bold;
  position: relative;
}

.nav-item.active::after,
.nav-link[aria-current="page"]::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: currentColor;
}

/* Form accessibility improvements */
.form-label {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.form-control:invalid {
  border-color: #dc3545;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.form-control:invalid:focus {
  border-color: #dc3545;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Error states */
.is-invalid {
  border-color: #dc3545 !important;
}

.invalid-feedback {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  font-size: 0.875em;
  color: #dc3545;
}

/* Button accessibility improvements */
.btn {
  min-height: 44px;
  min-width: 44px;
  padding: 0.5rem 1rem;
  font-weight: 500;
  border-radius: 4px;
  transition: all 0.15s ease-in-out;
}

.btn:disabled,
.btn.disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Color contrast improvements */
.text-muted {
  color: #3d3333 !important;
}

.bg-light {
  background-color: #f8f9fa !important;
  color: #3d3333 !important;
}

.bg-dark {
  background-color: #212529 !important;
  color: #fff !important;
}

/* Override Bootstrap's light text colors for better readability */
body {
  color: #3d3333 !important;
}

.card-text {
  color: #3d3333 !important;
}

.text-light {
  color: #3d3333 !important;
}

p, .form-text {
  color: #3d3333 !important;
}

/* Table accessibility */
.table th {
  background-color: #f8f9fa;
  font-weight: 600;
}

.table-striped > tbody > tr:nth-of-type(odd) > td,
.table-striped > tbody > tr:nth-of-type(odd) > th {
  background-color: rgba(0, 0, 0, 0.05);
}

/* Alert accessibility */
.alert {
  border-left: 4px solid;
  border-radius: 4px;
}

.alert-success {
  border-left-color: #198754;
}

.alert-danger {
  border-left-color: #dc3545;
}

.alert-warning {
  border-left-color: #ffc107;
}

.alert-info {
  border-left-color: #0dcaf0;
}

/* Link accessibility */
a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

/* Image accessibility */
img {
  max-width: 100%;
  height: auto;
}

/* Screen reader only content */
.sr-only,
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Large text mode support */
@media (min-resolution: 120dpi) {
  body {
    font-size: 18px;
    line-height: 1.6;
  }
  
  .btn {
    min-height: 48px;
    min-width: 48px;
    font-size: 18px;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  :root {
    --bs-body-bg: #1a1a1a;
    --bs-body-color: #e9ecef;
    --bs-primary: #6ea8dc;
  }
  
  .hero-section {
    background-color: #2d3748;
    color: #e9ecef;
  }
  
  .card {
    background-color: #2d3748;
    border-color: #4a5568;
    color: #e9ecef;
  }
}

/* Keyboard navigation improvements */
.dropdown-menu {
  border: 2px solid #dee2e6;
}

.dropdown-item:focus,
.dropdown-item:hover {
  background-color: #e9ecef;
  color: #3d3333 !important;
  outline: 2px solid #005fcc;
  outline-offset: -2px;
}

/* Mobile accessibility improvements */
@media (max-width: 768px) {
  .btn {
    min-height: 48px;
    min-width: 48px;
    font-size: 16px;
  }
  
  .nav-link {
    min-height: 48px;
    display: flex;
    align-items: center;
  }
  
  .form-control {
    min-height: 48px;
    font-size: 16px;
  }
}

/* Lightbox accessibility improvements */
.lightbox-close {
  background: transparent !important;
  border: none !important;
  min-height: 44px;
  min-width: 44px;
  padding: 0.5rem;
}

.lightbox-close:hover,
.lightbox-close:focus {
  background-color: rgba(255, 255, 255, 0.2) !important;
  border-radius: 4px;
}

.lightbox-nav {
  background: transparent !important;
  border: none !important;
  min-height: 44px;
  min-width: 44px;
  padding: 1rem;
}

.lightbox-nav:hover,
.lightbox-nav:focus {
  background-color: rgba(255, 255, 255, 0.2) !important;
  border-radius: 4px;
}

/* Improved carousel accessibility */
.carousel-control-prev,
.carousel-control-next {
  width: 44px;
  height: 44px;
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  margin: auto 1rem;
  opacity: 0.8;
}

.carousel-control-prev:hover,
.carousel-control-next:hover,
.carousel-control-prev:focus,
.carousel-control-next:focus {
  opacity: 1;
  background-color: rgba(0, 0, 0, 0.7);
}

/* Print accessibility */
@media print {
  .skip-links,
  .navbar,
  .btn,
  .social-icons {
    display: none !important;
  }
  
  a[href]:after {
    content: " (" attr(href) ")";
  }
  
  .visually-hidden {
    position: static !important;
    width: auto !important;
    height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
    clip: auto !important;
    white-space: normal !important;
  }
}

/* ==========================================================================
   5. Text contrast and scoped color exceptions
   ========================================================================== */
/* Text Color Fix - Override all light text colors to #3d3333 */

/* Global text color reset */
body, html {
  color: #3d3333 !important;
}

/* All paragraph and text elements */
p, span, div, li, td, th {
  color: #3d3333 !important;
}

/* Exception: Allow folder icons to have custom colors */
.nav-tree-icon i.fa-folder,
.row-icon.folder-icon i.fa-folder,
.details-preview-icon i.fa-folder {
  color: unset !important;
}

/* Homepage hero copy sits over a darkened portion of the grounds photo. */
.hero-section .hero-copy h1,
.hero-section .hero-copy > p:not(.visually-hidden) {
  color: #fff !important;
}

.hero-section .hero-copy .btn-primary {
  color: #3d3333 !important;
}

/* Card text specifically */
.card-text, .card-body p, .card-body {
  color: #3d3333 !important;
}

/* Bootstrap text utilities override */
.text-muted, .text-secondary, .text-light {
  color: #3d3333 !important;
}

/* Form text and help text */
.form-text, .help-text, small {
  color: #3d3333 !important;
}

/* Additional form elements for better contrast */
.form-label, label {
  color: #3d3333 !important;
}

/* Select dropdown text and options */
select, select option {
  color: #3d3333 !important;
}

/* File input styling */
.form-control[type="file"] {
  color: #3d3333 !important;
}

/* Button text that might be too light */
.btn-link {
  color: #3d3333 !important;
}

.btn-link:hover {
  color: #212529 !important;
}

/* Headings if they're too light */
h1, h2, h3, h4, h5, h6 {
  color: #3d3333 !important;
}

/* List items */
ul li, ol li, .list-group-item {
  color: #3d3333 !important;
}

/* Table content */
table, .table td, .table th {
  color: #3d3333 !important;
}

/* Admin contact messages - improved contrast for colored table rows */
.table-warning,
.table-warning td,
.table-warning th,
.table-warning a,
.table-warning small {
  color: #5a4a00 !important;  /* Dark amber for yellow backgrounds */
}

.table-warning .text-muted {
  color: #6b5a00 !important;  /* Slightly lighter but still readable */
}

.table-danger,
.table-danger td,
.table-danger th,
.table-danger a,
.table-danger small {
  color: #721c24 !important;  /* Dark red for pink/danger backgrounds */
}

.table-danger .text-muted {
  color: #842029 !important;  /* Slightly lighter but still readable */
}

.table-secondary,
.table-secondary td,
.table-secondary th,
.table-secondary a,
.table-secondary small {
  color: #3d4246 !important;  /* Dark gray for secondary backgrounds */
}

.table-secondary .text-muted {
  color: #4d5257 !important;
}

/* Keep badges readable with their original colors */
.table-warning .badge,
.table-danger .badge,
.table-secondary .badge {
  color: inherit;
}

.table-warning .badge.bg-warning {
  color: #5a4a00 !important;
}

.table-warning .badge.bg-success,
.table-danger .badge.bg-success {
  color: #fff !important;
}

.table-warning .badge.bg-danger,
.table-danger .badge.bg-danger {
  color: #fff !important;
}

.table-warning .badge.bg-info,
.table-danger .badge.bg-info,
.table-secondary .badge.bg-info {
  color: #fff !important;
}

.table-warning .badge.bg-secondary,
.table-danger .badge.bg-secondary,
.table-secondary .badge.bg-secondary {
  color: #fff !important;
}

.table-warning .badge.bg-light,
.table-danger .badge.bg-light,
.table-secondary .badge.bg-light {
  color: #3d3333 !important;
}

/* Ensure buttons remain readable */
.table-warning .btn,
.table-danger .btn,
.table-secondary .btn {
  color: inherit;
}

.table-warning .btn-outline-primary,
.table-danger .btn-outline-primary,
.table-secondary .btn-outline-primary {
  color: #0d6efd !important;
  border-color: #0d6efd !important;
}

.table-warning .btn-outline-secondary,
.table-danger .btn-outline-secondary,
.table-secondary .btn-outline-secondary {
  color: #6c757d !important;
  border-color: #6c757d !important;
}

/* Ensure white text stays white for dark backgrounds */
.bg-dark,
.btn-primary,
.card-header {
  color: #fff !important;
}

/* Navigation text should use dark color on teal background */
.navbar-brand, .nav-link {
  color: #3d3333 !important;
}

/* Exception: Keep white text only on dark navbar backgrounds */
.navbar-dark .navbar-nav .nav-link {
  color: #fff !important;
}

/* ==========================================================================
   6. Board directory
   ========================================================================== */
/* Board of Directors Section Styles */
.board-section .card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.board-section .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15) !important;
}

.board-section .card-body {
    position: relative;
}

.board-section .card-title {
    font-size: 0.875rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.board-section h5 {
    font-weight: 600;
    color: #2c3e50;
}

.board-section .rounded-circle {
    border-width: 3px !important;
}

/* Property Manager specific styling */
.board-section .bg-light {
    background-color: #f8f9fa !important;
}

.board-section .text-success {
    color: #198754 !important;
}

.board-section .border-success {
    border-color: #198754 !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .board-section .col-lg-4:nth-child(6) {
        margin-top: 1rem;
    }
    
    .board-section .card-body {
        padding: 1.5rem !important;
    }
    
    .board-section .rounded-circle {
        width: 70px !important;
        height: 70px !important;
    }
}

@media (max-width: 576px) {
    .board-section .rounded-circle {
        width: 60px !important;
        height: 60px !important;
    }
    
    .board-section h5 {
        font-size: 1.1rem;
    }
    
    .board-section .card-title {
        font-size: 0.8rem;
    }
}

/* Email link styling */
.board-section a[href^="mailto:"] {
    color: #6c757d;
    font-size: 0.9rem;
}

.board-section a[href^="mailto:"]:hover {
    color: #198754;
    text-decoration: underline !important;
}

/* ==========================================================================
   7. Resident portal enhancements
   ========================================================================== */
/* Portal Document Category Button Enhancements */
.portal-btn-grid .btn {
    min-height: 80px;
    text-align: left;
    position: relative;
    transition: all 0.2s ease-in-out;
}

.portal-btn-grid .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.portal-btn-grid .btn .badge {
    font-size: 0.75rem;
    padding: 0.4em 0.6em;
    border-radius: 12px;
    font-weight: 600;
}

.portal-btn-grid .btn-primary .badge-light {
    background-color: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
}

.portal-btn-grid .btn-outline-primary .badge-primary {
    background-color: var(--bs-primary);
    color: white;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 768px) {
    .portal-btn-grid .btn {
        min-height: 70px;
        font-size: 0.9rem;
    }
    
    .portal-btn-grid .btn .badge {
        font-size: 0.7rem;
        padding: 0.3em 0.5em;
    }
}

@media (max-width: 576px) {
    .portal-btn-grid .btn {
        min-height: 60px;
        font-size: 0.85rem;
    }
    
    .portal-btn-grid .btn i {
        font-size: 0.9rem;
    }
    
    .portal-btn-grid .btn .badge {
        font-size: 0.65rem;
        padding: 0.25em 0.4em;
    }
}

/* ==========================================================================
   8. Shared layout patterns
   ========================================================================== */


/* Consistent spacing */
.layout-container {
    margin-bottom: 2rem;
}

.layout-card {
    margin-bottom: 1.5rem;
}

/* Sticky sidebar positioning */
.layout-sidebar-sticky {
    position: sticky;
    top: 20px;
    z-index: 10;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .layout-sidebar-sticky {
        position: static;
        top: auto;
    }
    
    /* On mobile, stack vertically */
    .layout-main-content,
    .layout-sidebar {
        order: 0 !important;
    }
}

/* Footer protection - ensure content doesn't overlap */
.layout-page-content {
    padding-bottom: 100px;
    margin-bottom: 80px;
}

/* Admin dashboard specific styling */
.admin-dashboard .row {
    margin-bottom: 2rem;
}

.admin-dashboard .card {
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s ease;
}

.admin-dashboard .card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Standardized button spacing */
.layout-action-buttons {
    margin-top: 1rem;
}

.layout-action-buttons .btn {
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Consistent card header styling */
.layout-card-header {
    border-bottom: 1px solid rgba(0,0,0,0.125);
    font-weight: 600;
}

/* Standard list group styling */
.layout-list-group .list-group-item {
    border-left: 3px solid transparent;
    transition: border-color 0.3s ease;
}

.layout-list-group .list-group-item.active {
    border-left-color: var(--bs-primary);
}

/* Statistics display formatting */
.layout-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.layout-stat-item {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    text-align: center;
}

.layout-stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--bs-primary);
}

.layout-stat-label {
    font-size: 0.9rem;
    color: #6c757d;
    margin-top: 0.25rem;
}