/* Main styles for FireFrontIC */

/* Show scrollbar only when needed to prevent empty scrollbar track */
html {
  overflow-y: auto;
  height: 100%;
}

body {
  height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  overflow: hidden; /* Prevent body scroll */
}

/* Main content wrapper - scrollable area between navbar and footer */
.main-content-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  background-color: #f8f9fa; /* Light gray background */
  display: flex;
  flex-direction: column;
}

/* Container inside scrollable area */
.main-content-scroll > .container {
  flex: 1;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

/* Footer - at bottom with reduced height */
.footer {
  flex-shrink: 0; /* Don't shrink */
  padding: 0.15rem 0 !important; /* Minimal padding */
  font-size: 0.7rem; /* Even smaller font size */
  line-height: 1 !important;
}

.footer .container,
.footer .container-fluid {
  padding: 0 1rem;
}

.footer .row {
  margin: 0; /* Remove default row margins */
}

.footer p {
  margin: 0 !important; /* Remove all margins */
  padding: 0 !important; /* Remove all padding */
  font-weight: 300; /* Thinner text */
  line-height: 1.1 !important; /* Very tight line height */
  font-size: 0.7rem !important; /* Ensure font size is applied */
}

/* Dashboard layout */
.dashboard-container {
  display: flex;
}

.sidebar {
  width: 250px;
  min-height: calc(
    100vh - 70px - 70px
  ); /* Viewport height minus navbar and footer */
  position: sticky;
  top: 70px;
}

.main-content {
  flex-grow: 1;
  padding: 20px;
}

/* Incident status indicators */
.status-indicator {
  width: 10px;
  height: 10px;
  display: inline-block;
  border-radius: 50%;
  margin-right: 5px;
}

.status-new {
  background-color: #0d6efd; /* Bootstrap primary */
}

.status-active {
  background-color: #dc3545; /* Bootstrap danger */
}

.status-contained {
  background-color: #ffc107; /* Bootstrap warning */
}

.status-controlled {
  background-color: #0dcaf0; /* Bootstrap info */
}

.status-closed {
  background-color: #198754; /* Bootstrap success */
}

/* Cards */
.card {
  transition: transform 0.2s;
  margin-bottom: 20px;
}

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

/* Map container */
.map-container {
  height: 400px;
  border-radius: 5px;
  margin-bottom: 20px;
}

/* Semi-transparent hover effect for map overlays */
.map-overlay-control,
.map-controls,
.info-box,
.info-panel,
.layer-control,
.legend,
.fire-legend,
.controls,
.leaflet-control-zoom,
.leaflet-control-layers,
.leaflet-control-fullscreen,
.leaflet-control-geocoder,
.leaflet-draw-toolbar,
.leaflet-control {
  opacity: 0.5;
  transition: opacity 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.map-overlay-control:hover,
.map-controls:hover,
.info-box:hover,
.info-panel:hover,
.layer-control:hover,
.legend:hover,
.fire-legend:hover,
.controls:hover,
.leaflet-control-zoom:hover,
.leaflet-control-layers:hover,
.leaflet-control-fullscreen:hover,
.leaflet-control-geocoder:hover,
.leaflet-draw-toolbar:hover,
.leaflet-control:hover {
  opacity: 1;
}

/* Keep full opacity when interacting with form elements */
.map-controls:focus-within,
.layer-control:focus-within,
.controls:focus-within,
.leaflet-control:focus-within {
  opacity: 1;
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 30px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: #dee2e6;
}

.timeline-item {
  position: relative;
  margin-bottom: 20px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -30px;
  top: 5px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: #0d6efd;
}

.timeline-date {
  font-size: 0.85rem;
  color: #6c757d;
}

/* Table styles */
.table-responsive {
  border-radius: 5px;
  overflow: hidden;
}

/* Form styles */
.form-card {
  max-width: 800px;
  margin: 0 auto;
}

/* Navbar styles */
.navbar {
  min-height: 70px;
  padding: 0.5rem 1rem;
  flex-shrink: 0; /* Don't shrink */
  position: relative !important; /* Override Bootstrap's fixed positioning */
}

.navbar-brand-wrapper {
  display: flex;
  align-items: center;
}

.navbar-brand {
  display: flex !important;
  align-items: center;
  text-decoration: none;
  padding: 0;
  margin-right: 0.5rem;
}

.navbar-brand:hover {
  transform: scale(1.1);
  transition: all 0.3s ease;
}

.brand-icon {
  font-size: 2.5rem;
  margin-right: 0.75rem;
  color: #ff6b35;
  transition: color 0.3s ease;
}

.navbar-brand:hover .brand-icon {
  color: #ff8c5a;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-main {
  font-size: 1.4rem;
  font-weight: 700;
  color: #ffffff;
}

.brand-sub {
  font-size: 0.7rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.8);
}

/* Mobile dropdown menu */
.navbar-mobile-menu {
  margin-top: 0.5rem;
  min-width: 250px;
}

.navbar-mobile-menu .dropdown-item {
  padding: 0.75rem 1.25rem;
}

.navbar-mobile-menu .dropdown-item i {
  width: 1.5rem;
  text-align: center;
  margin-right: 0.5rem;
}

/* Navigation items */
.navbar-nav .nav-link {
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.navbar-nav .nav-link i {
  font-size: 1.2rem;
  margin-right: 0.5rem;
  transition: transform 0.3s ease;
}

.navbar-nav .nav-link:hover {
  transform: scale(1.1);
}

/* Icon-only mode on medium screens */
@media (min-width: 768px) and (max-width: 1065px) {
  /* Keep navbar default alignment */

  /* Make container flex in a row */
  .navbar .container-fluid {
    display: flex;
    flex-wrap: nowrap;
    align-items: center; /* Keep items centered vertically */
    /* justify-content: flex-start; */
    justify-content: left;
    transition: all 0.3s ease;
    white-space: nowrap;
  }

  /* Force navbar to stay on one line */
  .navbar-collapse {
    flex-grow: 0;
    display: inline-flex !important; /* Use inline-flex to prevent full width */
    flex-basis: auto;
    margin: 0; /* Remove all margins */
    padding: 0; /* Remove all padding */
    align-items: center; /* Center items vertically */
  }

  .navbar-nav {
    flex-direction: row;
    align-items: center;
    height: 100%;
    margin: 0; /* Remove all margins */
    padding: 0; /* Remove all padding */
    min-height: 40px; /* Fixed minimum height to prevent shifts */
  }

  /* Keep user menu right-aligned */
  .navbar-nav.ms-auto {
    /* margin-left: auto !important; */
    /* margin-right: 0; */
  }

  /* Remove nav-item styling to match large screen behavior */

  /* Adjust brand wrapper to allow items beside it */
  .navbar-brand-wrapper {
    flex-grow: 0;
    margin-right: 0;
    display: flex;
    align-items: center;
  }

  .nav-text {
    /* Hide text but keep in flow */
    display: inline-block;
    max-width: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: max-width 0.3s ease, margin 0.3s ease;
    vertical-align: middle;
  }

  .navbar-nav .nav-link {
    padding: 0rem 0.5rem 0rem 0.5rem; /* Keep same padding as large screen */
    /* position: relative; */
    overflow: visible;
    display: flex;
    align-items: center;
    height: auto;
    line-height: 1; /* Prevent line-height changes */
    /* transition: all 0.3s ease; */
    /* white-space: nowrap; */
  }

  .navbar-nav .nav-link i {
    margin-right: 0;
    /* margin-top: 0; */
    font-size: 1.2rem; /* Keep same size as large screen */
    transition: transform 0.3s ease;
    display: inline-flex; /* Ensure consistent rendering */
    align-items: center;
    /* vertical-align: middle; */
  }

  /* Hover effect for icon-only mode */
  .navbar-nav .nav-link:hover {
    /* background-color: rgba(255, 255, 255, 0.1);
    border-radius: 0.25rem; */
    transition: all 0.3s ease;
    overflow: visible;
  }

  .navbar-nav .nav-link:hover .nav-text {
    max-width: 200px; /* Expand to show text */
    margin-left: 0.5rem; /* Add space between icon and text */
    margin-right: 0rem; /* Add space between icon and text */
    transition: all 0.3s ease;
  }

  .navbar-nav .nav-link:hover i {
    transform: scale(1.1);
  }

  /* Ensure dropdown menus work properly */
  .navbar-nav .dropdown {
    position: static;
  }

  .navbar-nav .dropdown-menu {
    position: absolute;
    top: 5rem;
    left: auto;
    right: auto; /* Changed this from "0" to fix dropdown menu alignment */
  }
}

/* Full width - show icons and text */
/* @media (min-width: 992px) { */
@media (min-width: 1065px) {
  .navbar-brand:hover {
    text-decoration: none;
  }
}

/* Tablet and Desktop - make brand clickable for navigation */
@media (min-width: 768px) {
  .navbar-brand {
    cursor: pointer;
    transition: opacity 0.2s ease;
  }
  
  .navbar-brand:hover {
    opacity: 0.9;
    transform: scale(1.05);
  }
}

/* Small screens - brand is clickable dropdown */
@media (max-width: 767px) {
  .navbar-brand {
    cursor: pointer;
  }

  .navbar-brand::after {
    content: "";
    display: inline-block;
    margin-left: 0.5rem;
    vertical-align: middle;
    border-top: 0.3em solid;
    border-right: 0.3em solid transparent;
    border-bottom: 0;
    border-left: 0.3em solid transparent;
  }
}

/* Responsive adjustments */
@media (max-width: 767px) {
  .sidebar {
    width: 100%;
    position: static;
    min-height: auto;
  }

  .dashboard-container {
    flex-direction: column;
  }

  .map-container {
    height: 300px;
  }

  .brand-icon {
    font-size: 2rem;
  }

  .brand-main {
    font-size: 1.2rem;
  }

  .brand-sub {
    font-size: 0.6rem;
  }
}
