/*
 * assets/css/style.css
 *
 * This file contains custom CSS for the Tribal Footprint website.
 * It includes styles for general layout, public-facing elements,
 * admin dashboard components, and utility classes.
 */

/* ==========================================================================
   Base & General Layout
   ========================================================================== */
html, body {
  height: 100%; /* Ensures html and body take full viewport height for sticky footer */
  margin: 0; /* Remove default body margin */
  padding: 0; /* Remove default body padding */
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f8f9fa;
  color: #343a40;
  display: flex;          /* Enable Flexbox for vertical layout */
  flex-direction: column; /* Stack children (header, main content, footer) vertically */
}

/* Container for all content between header and footer, allows it to grow */
.container-fluid {
  flex-grow: 1; /* This makes the content area expand to fill available space */
  display: flex; /* Make it a flex container to manage sidebar and main content */
  flex-direction: column; /* Stack vertically if content itself uses rows */
  padding-left: 0;
  padding-right: 0;
}

/* Ensures the row inside container-fluid also grows */
.container-fluid > .row {
    flex-grow: 1;
}

/* ==========================================================================
   Public-Facing Site Styles
   ========================================================================== */

/* Navbar Brand (Public) */
.navbar-brand {
    font-weight: bold;
}

/* Map Section */
#map {
    border: 1px solid #dee2e6;
}

/* Guide Cards */
.guide-card {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease-in-out;
}

.guide-card:hover {
    transform: translateY(-5px);
}

.guide-card img {
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
    height: 200px; /* Fixed height for consistency */
    object-fit: cover; /* Ensures images cover the area without distortion */
}

.guide-card .card-body {
    padding: 1.5rem;
}

.guide-card .card-title {
    color: #007bff;
    font-size: 1.4rem;
    margin-bottom: 0.75rem;
}

.guide-card .card-text {
    font-size: 0.95rem;
    color: #6c757d;
}

.guide-card .badge {
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Star Rating (for reviews) */
.star-rating .fas {
    color: #ffc107; /* Gold color for stars */
}

/* Footer Styles (Public and Admin) */
.footer {
    background-color: #e9ecef;
    border-top: 1px solid #dee2e6;
    padding: 1rem 0; /* Add some padding to the footer */
    text-align: center; /* Center content in footer */
}

/* Login Page Specific Styling */
body.login-body {
    background-color: #e9ecef; /* Override global background for login page */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
}


/* ==========================================================================
   Admin Dashboard Layout & Sidebar Styles
   ========================================================================== */

/* Admin Header Specific Styling (defined in includes/admin_header.php) */
header.navbar {
    z-index: 1020; /* Ensure admin header is above sidebar when collapsed */
}
.navbar-brand.col-md-3 { /* Targeting admin header brand */
    text-align: center;
}
.navbar-brand.col-md-3,
.navbar-nav .nav-item .nav-link { /* Admin header nav links */
    padding-right: 1rem;
    padding-left: 1rem;
}

/* Admin Sidebar */
.sidebar {
  position: fixed;
  top: 0; /* Initial top alignment (adjusted by padding-top below for fixed header) */
  bottom: 0;
  left: 0;
  z-index: 100; /* Behind the main content, but above some other elements */
  padding-top: 48px; /* Height of the fixed admin header */
  box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
  background-color: #f8f9fa; /* Lighter background for sidebar */
}

/* Adjust sidebar top for smaller screens (Bootstrap's default navbar height is ~56px) */
@media (max-width: 767.98px) {
  .sidebar {
    top: 56px; /* Ensure it starts below the mobile navbar height */
  }
}

.sidebar-sticky {
  height: calc(100vh - 48px); /* Calculate height to fill viewport below top padding */
  overflow-x: hidden;
  overflow-y: auto; /* Scrollable contents if too long */
}

.sidebar .nav-link {
  font-weight: 500;
  color: #333;
  padding: 0.75rem 1rem;
  border-left: 3px solid transparent; /* Visual cue for active link */
  transition: all 0.2s ease-in-out;
}

.sidebar .nav-link.active {
  color: #007bff;
  border-left-color: #007bff;
  background-color: #e9ecef; /* Light background for active state */
}

.sidebar .nav-link:hover {
  background-color: #f8f9fa;
  color: #007bff;
}

.sidebar .nav-item .fas {
  font-size: 1rem;
  width: 1.25rem;
  text-align: center;
}

/* Sidebar Headings (e.g., "Lookup Tables") */
.sidebar-heading {
    font-size: .75rem;
    padding-top: .5rem;
    padding-bottom: .5rem;
    color: #6c757d;
    text-transform: uppercase;
}

/* Main content area adjustment for fixed top header and sidebar */
main.col-md-9 {
  padding-top: 48px; /* Offset for the fixed admin header */
}

/* Push main content right on medium-large screens to sit next to sidebar */
@media (min-width: 768px) {
  main.col-md-9 {
    margin-left: auto !important; /* Push content right by sidebar width */
  }
}
