/* =========================
   Global Layout
========================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}


body {
  
  flex-direction: column !important;
    overflow-x: hidden;
  margin: 0;
  font-family: Arial, sans-serif;
  display: grid;
  grid-template-rows: auto 1fr auto; /* header | main | footer */
  grid-template-columns: 15% 1fr;  /* sidebar | content */
  grid-template-areas: 
    "header header"
    "sidebar main"
    "footer footer";
  height: 100dvh;
    background: url("./roses.jpeg");
  background-size: cover;
}

main {
  flex: 1;
  
}

/* =========================
   Header
========================= */
header {
  grid-area: header;
  background: #1a365d;
  color: white;
 padding: 10px 20px;
  text-align: center;
  font-size: 20px;
  font-weight: bold;
  display: flex;              /* Arrange items in a row */
  justify-content: space-between; /* Push logo to the right */
  align-items: center;        /* Vertically center items */
}
#sacam {
  height: 100px;               /* Bigger size */
  width: 100px;                /* Make width equal height for round shape */
  border-radius: 10%;         /* Makes it circular */
  object-fit: cover;          /* Ensures image fits well */
}
img, video, iframe {
  max-width: 100%;
  height: auto;
}
/* =========================
   Sidebar
========================= */
#sidebar {
  grid-area: sidebar;
  background: #1a365d;
  color: #ecf0f1;
  padding: 20px;
  overflow-y: auto;
  
}
#sidebar h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}
#sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
#sidebar ul li {
  margin: 10px 0;
}
#sidebar ul li a {
  color: #ecf0f1;
  text-decoration: none;
  display: block;
  padding: 8px;
  border-radius: 6px;
  transition: background 0.2s;
}
#sidebar ul li a:hover {
  background: #2c3e50;
}

/* =========================
   Main Content
========================= */
main {
  grid-area: main;
  color: #000;
  padding: 20px;
  overflow-y: auto;
  background: transparent; /* instead of #f4f4f4 */
  box-sizing: border-box;
   background: url("./roses.jpeg");
   background-size: cover;
}

/* =========================
   Sections
========================= */
.section {
  display: none; /* hidden by default */
  margin-bottom: 30px;
  padding: 15px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #fff;
}
.section.active {
  display: block; /* show only active section */
}

/* =========================
   Forms
========================= */
form {
  max-width: 500px;
  margin: auto;
  padding: 20px;
  background: white;
  border: 1px solid #ccc;
  border-radius: 8px;
}

label {
  display: block;
  margin-top: 10px;
  font-weight: bold;
}
input, select, textarea {
  width: 100%;
  padding: 8px;
  margin-top: 5px;
  border: 1px solid #ccc;
  border-radius: 5px;
  box-sizing: border-box;
}
button {
  margin-top: 15px;
  padding: 10px;
  width: 100%;
  background: teal;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}
button:hover {
  background: darkcyan;
}

/* =========================
   Grid Form
========================= */
.grid-form {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 15px;
}
.grid-form label {
  display: flex;
  flex-direction: column;
}
.grid-form button {
  grid-column: span 2;
  background: #27ae60;
}
.grid-form button:hover {
  background: #219150;
}

/* =========================
   Report Grid
========================= */
.report-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 10px;
  padding: 10px;
  background-color: #f9f9f9;
  border-radius: 8px;
  overflow-x: auto;
}
.report-grid table {
  grid-column: 1 / -1;
  width: 100%;
  border-collapse: collapse;
}
.report-grid th,
.report-grid td {
  padding: 8px 12px;
  border: 1px solid #ccc;
  text-align: left;
}
.report-grid tr:nth-child(even) {
  background-color: #f1f1f1;
}
.report-grid th {
  background-color: #0077cc;
  color: white;
  position: sticky;
  top: 0;
}

/* =========================
   Workers List
========================= */
.workers-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 300px;
}
.worker-item {
  display: flex;
  align-items: center;
  gap: 10px;
}
.worker-item input[type="checkbox"] {
  margin: 0;
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #0077cc;
}
.worker-item span {
  font-size: 1rem;
  color: #333;
  line-height: 1.4;
}

/* =========================
   Footer
========================= */
footer {
  grid-area: footer;
  background: #1a365d;
  color: white;
  text-align: center;
  padding: 10px;
 font-size: 1rem;
  text-emphasis-color: #b0b8c4;
}

/*=====================
marquee
======================== */
.marquee {
  width: 100%;
  overflow: hidden;
  background: #003366;
  padding: 10px;
  color: white;
  font-size: 18px;
  font-weight: bold;
}

.marquee-text {
  display: inline-block;
  white-space: nowrap;
  padding-left: 100%;
  animation: scrollText 12s linear infinite, fadeInOut 4s ease-in-out infinite alternate;
}

.marquee-img {
  height: 40px;   /* adjust size */
  vertical-align: middle;
  margin-right: 10px;
}

/* Scrolling effect */
@keyframes scrollText {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

/* Fade effect */
@keyframes fadeInOut {
  0%   { opacity: 0; }
  50%  { opacity: 1; }
  100% { opacity: 0; }
}

/* =========================
   Mobile Responsiveness
========================= */
/* =========================
   MOBILE RESPONSIVENESS FIX
   ========================= */
@media (max-width: 768px) {
  /* 1. Disable grid layout on body */
  body {
    display: flex !important;
    flex-direction: column !important;
    grid-template-areas: none !important;
    grid-template-rows: auto 1fr auto !important;
    grid-template-columns: 1fr !important;
    min-height: 100dvh;
    overflow-x: hidden;
  }

  /* 2. Reset all layout areas */
  header, main, footer {
    grid-area: unset !important;
    width: 100% !important;
    padding: 10px !important;
  }

  /* 3. Hide sidebar completely */
 /* Style sidebar for mobile */
#sidebar {
  position: fixed;
  top: 60px; /* Below header */
  left: 0;
  width: 250px;
  height: calc(100vh - 60px);
  z-index: 1000;
  background: #1a365d;
  padding: 20px;
  box-shadow: 2px 0 5px rgba(0,0,0,0.3);
  transition: transform 0.3s ease;
}

#sidebar.active {
  display: block;
}

/* Optional: Slide-in animation */
#sidebar {
  transform: translateX(-100%);
}

#sidebar.active {
  transform: translateX(0);
}
  /* 4. Show hamburger menu (if you add JS later) */
  #menu-toggle {
    display: block !important;
  }

  /* 5. Make ALL forms stack vertically */
  .grid-form {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  /* 6. Ensure form fields are full-width & touch-friendly */
  .grid-form label {
    display: block !important;
    margin-bottom: 6px !important;
  }

  .grid-form input,
  .grid-form textarea,
  .grid-form select {
    width: 100% !important;
    padding: 12px !important;
    font-size: 16px !important; /* Prevents iOS zoom */
    min-height: 44px !important; /* Easy to tap */
    box-sizing: border-box !important;
  }

  /* 7. Full-width buttons */
  .grid-form button {
    width: 100% !important;
    padding: 14px !important;
    grid-column: span 1 !important;
  }

  /* 8. Fix tables */
  .report-grid table,
  table {
    display: block !important;
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  th, td {
    white-space: nowrap;
    padding: 8px !important;
  }

  /* 9. Remove background image on mobile (faster load) */
  body, main {
    background-image: none !important;
    background-color: #f8f9fa;
  }

  /* 10. Adjust header */
  header {
    flex-direction: column !important;
    text-align: center !important;
    gap: 8px !important;
  }

  #sacam {
    height: 60px !important;
    width: 60px !important;
  }
  footer {
  grid-area: unset !important;
  width: 100% !important;
  text-align: center !important;
  padding: 12px 10px !important;
  font-size: 14px !important;
  white-space: normal !important; /* Prevents overflow */
  box-sizing: border-box;
}
}

button:focus,
input:focus,
a:focus {
  outline: 2px solid #0077cc;
  outline-offset: 2px;
}
