/*
  World Security Solution CRM
  Dark green and white theme for an elegant, modern look. The layout uses
  a single-page structure with navigation links to switch between sections.
  The site is responsive and adapts to different screen sizes using
  relative units and flexbox.
*/

/* CSS reset for consistent styling across browsers */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: #022a17; /* darkest background */
  color: #e0e8e3; /* light text color */
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Container to center content and add horizontal padding */
.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
}

/* Header styling */
.header {
  background-color: #014421; /* dark green */
  border-bottom: 4px solid #1aa269; /* accent stripe */
  color: #fff;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.logo h1 {
  font-size: 1.6rem;
  margin-bottom: 0.25rem;
  font-weight: 700;
}

.subtitle {
  font-size: 0.8rem;
  color: #b0d7c4;
}

/* Navigation styling */
.navigation ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

.navigation a {
  color: #e0e8e3;
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.3s, color 0.3s;
}

.navigation a:hover,
.navigation a.active {
  color: #ffffff;
  border-bottom-color: #1aa269;
}

/* Hero banner */
.hero {
  position: relative;
  background-size: cover;
  background-position: center;
  height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin-bottom: 2rem;
}

.hero-overlay {
  background: rgba(0, 0, 0, 0.55);
  padding: 2rem;
  border-radius: 8px;
}

.hero h2 {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
  color: #ffffff;
}

.hero p {
  font-size: 1rem;
  color: #d0e5d8;
}

/* Section styling */
.section {
  display: none; /* hidden by default */
  margin-bottom: 2rem;
}

.section.active {
  display: block;
}

/* Stats cards */
.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  flex: 1 1 30%;
  background-color: #023a20;
  padding: 1rem;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.stat-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: #b0d7c4;
}

.stat-card p {
  font-size: 1.5rem;
  color: #ffffff;
  font-weight: bold;
}

/* Table styling */
.table-container {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.data-table th,
.data-table td {
  padding: 0.75rem;
  text-align: left;
}

.data-table th {
  background-color: #014421;
  color: #ffffff;
  font-weight: 600;
}

.data-table tbody tr:nth-child(odd) {
  background-color: #023a20;
}

.data-table tbody tr:nth-child(even) {
  background-color: #012b19;
}

.data-table tbody tr:hover {
  background-color: #035b32;
}

.data-table td {
  color: #e0e8e3;
  border-bottom: 1px solid #014421;
}

.data-table td:last-child {
  text-align: center;
}

/* Form styling */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  margin-bottom: 0.4rem;
  font-weight: 500;
  color: #b0d7c4;
}

.form-group input,
.form-group select {
  padding: 0.5rem;
  border: 1px solid #055d33;
  border-radius: 4px;
  background-color: #022a17;
  color: #e0e8e3;
  font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #1aa269;
  box-shadow: 0 0 4px rgba(26, 162, 105, 0.6);
}

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
}

.btn {
  padding: 0.6rem 1rem;
  border: 1px solid #055d33;
  border-radius: 4px;
  background-color: #014421;
  color: #ffffff;
  cursor: pointer;
  transition: background-color 0.3s, border-color 0.3s;
}

.btn.primary {
  background-color: #1aa269;
  border-color: #1aa269;
  color: #012b19;
  font-weight: 600;
}

.btn:hover {
  background-color: #0c6040;
  border-color: #0c6040;
}

.btn.primary:hover {
  background-color: #23b573;
  border-color: #23b573;
  color: #012b19;
}

/* Additional button style for secondary actions */
.btn.secondary {
  background-color: #023a20;
  border-color: #055d33;
  color: #b0d7c4;
}

.btn.secondary:hover {
  background-color: #035b32;
  border-color: #035b32;
  color: #ffffff;
}

/* Product items within Add Entry and Business Calculator */
.product-items,
.business-products {
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

.product-items h3,
.business-products h4 {
  margin-bottom: 0.5rem;
  color: #b0d7c4;
}

/* Product row container */
.product-row,
.business-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr auto;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

.product-row input,
.business-row input {
  width: 100%;
}

.remove-product {
  background-color: transparent;
  border: none;
  color: #ff6b6b;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0;
}

.remove-product:hover {
  color: #ff8787;
}

/* Monthly summary styling */
.monthly-summary {
  margin-bottom: 1rem;
  background-color: #023a20;
  padding: 0.75rem;
  border-radius: 6px;
  color: #d0e5d8;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.monthly-summary p {
  margin: 0;
}

/* Simple calculator styling */
.calculator {
  margin-top: 2rem;
  background-color: #023a20;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.calculator h3 {
  margin-bottom: 0.5rem;
  color: #b0d7c4;
}

.calc-display {
  margin-bottom: 0.5rem;
}

.calc-display input {
  width: 100%;
  padding: 0.5rem;
  font-size: 1.2rem;
  border: 1px solid #055d33;
  border-radius: 4px;
  background-color: #012b19;
  color: #e0e8e3;
}

.calc-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.calc-btn {
  padding: 0.6rem;
  font-size: 1.1rem;
  border: 1px solid #055d33;
  border-radius: 4px;
  background-color: #014421;
  color: #ffffff;
  cursor: pointer;
}

.calc-btn.operator {
  background-color: #035b32;
}

.calc-btn.equals {
  grid-column: span 4;
  background-color: #1aa269;
  color: #012b19;
  font-weight: bold;
}

.calc-btn:hover {
  background-color: #0c6040;
}

.calc-btn.equals:hover {
  background-color: #23b573;
}

/* Business calculator summary */
.business-summary {
  margin-top: 1rem;
  background-color: #023a20;
  padding: 0.75rem;
  border-radius: 6px;
  color: #d0e5d8;
}

.business-summary p {
  margin: 0.25rem 0;
}

/* Adjust form-actions for calculators */
#businessCalcForm .form-actions {
  margin-top: 1rem;
  display: flex;
  gap: 1rem;
}

/* Responsive adjustments for product rows */
@media (max-width: 768px) {
  .product-row,
  .business-row {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: auto;
    gap: 0.5rem;
  }
  .product-row > input:nth-child(3),
  .product-row > input:nth-child(4),
  .product-row > input:nth-child(5),
  .product-row > button,
  .business-row > input:nth-child(3),
  .business-row > input:nth-child(4),
  .business-row > input:nth-child(5),
  .business-row > button {
    grid-column: span 2;
  }
}

/* Filters section */
.filters {
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filters label {
  color: #b0d7c4;
}

/* Style month input in filters to match other form inputs */
.filters input[type="month"] {
  padding: 0.4rem 0.5rem;
  border: 1px solid #055d33;
  border-radius: 4px;
  background-color: #022a17;
  color: #e0e8e3;
  font-size: 1rem;
}

/* Footer */
.footer {
  margin-top: auto;
  background-color: #014421;
  color: #b0d7c4;
  text-align: center;
  padding: 1rem;
  font-size: 0.9rem;
  border-top: 4px solid #1aa269;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .stat-card {
    flex: 1 1 100%;
  }
  .navigation ul {
    gap: 1rem;
  }
  .hero {
    height: 200px;
  }
  .hero h2 {
    font-size: 1.8rem;
  }
}

/* Hamburger Menu Styles */
.hamburger {
  display: none;
  cursor: pointer;
  background: none;
  border: none;
}

.bar {
  display: block;
  width: 25px;
  height: 3px;
  margin: 5px auto;
  transition: all 0.3s ease-in-out;
  background-color: #ffffff;
}

/* Media Queries for Tablet and Mobile */
@media (max-width: 768px) {
  .header-container {
    padding: 1rem;
    position: relative;
  }
  
  .hamburger {
    display: block;
    z-index: 1001; /* Ensure it's above the menu */
  }

  .hamburger.active .bar:nth-child(2) {
    opacity: 0;
  }

  .hamburger.active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }

  .hamburger.active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  .navigation {
    position: fixed;
    left: -100%;
    top: 0; 
    /* Adjust top to be below header if you want, or 0 for full overlay. 
       Let's do a slide-in from left that covers part of the screen or full screen.
       Used top: 70px to sit below header usually, but let's make it a dedicated drawer.
    */
    top: 0;
    width: 100%;
    height: 100vh; /* full viewport height */
    background-color: #014421; /* Match header background */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
    z-index: 1000;
    padding-top: 60px; /* Space for the close button if inside, or just header height */
  }

  .navigation.active {
    left: 0;
  }

  .navigation ul {
    flex-direction: column;
    width: 100%;
    text-align: center;
    gap: 2rem;
  }

  .navigation a {
    font-size: 1.5rem;
    display: block;
    padding: 1rem;
  }

  /* Adjust Hero for Mobile */
  .hero {
    height: 200px;
    padding: 0 1rem;
  }
  
  .hero h2 {
    font-size: 1.5rem;
  }

  /* Adjust Stats Cards */
  .stats {
    flex-direction: column;
  }
  
  .stat-card {
    width: 100%; /* Full width on mobile */
  }

  /* Table Horizontal Scroll */
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
    border: 1px solid #055d33; /* subtle border to indicate boundary */
    border-radius: 4px;
  }
  
  /* Form Grids to Stack */
  .form-grid {
    grid-template-columns: 1fr;
  }

  /* Calculator Buttons */
  .calc-buttons {
    gap: 0.25rem;
  }
  
  .calc-btn {
    padding: 0.8rem; /* larger touch target */
  }
}