/* ==========================================================================
   CSS Custom Properties for Organization Colors
   Master Palette (Essential Branding)
   ========================================================================== */
:root {
  --master-color-1: #E6BB52;  /* Primary accent (e.g., gold) */
  --master-color-2: #000000;  /* Primary background or text (e.g., black) */
  
  /* ==========================================================================
     Secondary Support Palette (Complementary)
     ========================================================================== */
  --support-color-1: #ffffff;  /* Main background (e.g., white) */
  --support-color-2: #cccccc;  /* Secondary background (e.g., light gray) */
  --support-color-3: #333333;  /* Text/Details (e.g., dark gray) */
  --support-color-4: #ff0000;  /* Accent (e.g., red) – use sparingly */
}

/* ==========================================================================
   GENERAL RESET & BASE STYLES
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body, h1, h2, h3, p, ul, li, a {
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  background-color: var(--support-color-1);
  color: var(--master-color-2);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}

.folder-icon {
height:50px;
}

.accordion-header .btn {
  background-color: var(--master-color-2);
  color: var(--master-color-1);
}

.accordion-header .btn:hover {
  background-color: var(--master-color-1);
  color: var(--master-color-2);
}

.btn-sm {
width: 100%;
}

/* ==========================================================================
   HEADER & NAVIGATION
   ========================================================================== */
nav.navbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  background-color: var(--master-color-2);
  color: var(--master-color-1);
  border-bottom: 3px solid var(--master-color-1);
  box-shadow: 0px 2px 5px rgba(0,0,0,0.2);
}

/* ==========================================================================
   CALENDAR & LAYOUT
   ========================================================================== */
.calendar-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 150px);
  overflow-x: hidden;
  width: 100%;
}

.calendar {
  width: 100%;
  height: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.calendar th, .calendar td {
  border: 1px solid var(--master-color-1);
  text-align: left;
  vertical-align: top;
  padding: 10px;
}

.calendar th {
  background-color: var(--master-color-1);
  color: var(--master-color-2);
  font-weight: bold;
  text-transform: uppercase;
}

.calendar td {
  background-color: var(--support-color-1);
  color: var(--master-color-2);
  position: relative;
  height: calc((100vh - 200px) / 6);
}

.calendar td:hover {
  background-color: #f5f5f5;
}

.calendar td.today {
  background-color: #d3d3d3;
  color: var(--master-color-2);
  font-weight: bold;
  border: 2px solid var(--master-color-1);
}

.calendar td.outside-month {
  /* For example, use a 10% darker shade of support-color-3 */
  background-color: #<?php
    function darkenHex($hex, $percent = 10) {
      $hex = ltrim($hex, '#');
      $r = hexdec(substr($hex, 0, 2));
      $g = hexdec(substr($hex, 2, 2));
      $b = hexdec(substr($hex, 4, 2));
      $r = max(0, $r - round($r * $percent / 100));
      $g = max(0, $g - round($g * $percent / 100));
      $b = max(0, $b - round($b * $percent / 100));
      return sprintf("%02X%02X%02X", $r, $g, $b);
    }
    echo darkenHex(getenv('SUPPORT_COLOR_3') ?: "333333", 10);
  ?>;
  color: var(--master-color-2);
  font-weight: bold;
  border: 2px solid var(--master-color-1);
}

/* ==========================================================================
   COMPONENTS: TILES & CARDS
   ========================================================================== */
.workshift-tile {
  border-radius: 3px;
  margin: 2px;
  padding: 2px;
}

.shift-text-container {
  display: flex;
  justify-content: space-between;
  padding: 0 10px;
}

.add-shift {
  position: absolute;
  top: 5px;
  right: 5px;
  color: var(--support-color-3);
  font-size: 18px;
  font-weight: bold;
  text-decoration: none;
}

.add-shift:hover {
  color: var(--support-color-4);
}

/* Example event tile classes for different types */
.event-ip {
  background-color: #165400;
  color: #ffffff;
  padding: 5px;
  border-radius: 4px;
  margin-bottom: 5px;
}

.event-ip:hover {
  background-color: #7EC464;
  color: #000000;
}

.event-ps {
  background-color: var(--master-color-2);
  color: #ffffff;
  padding: 5px;
  border-radius: 4px;
  margin-bottom: 5px;
}

.event-ps:hover {
  background-color: #595959;
}

.event-pr {
  background-color: #781000;
  color: #ffffff;
  padding: 5px;
  border-radius: 4px;
  margin-bottom: 5px;
}

.event-pr:hover {
  background-color: #B55547;
}

.event-other {
  background-color: #004FA3;
  color: #ffffff;
  padding: 5px;
  border-radius: 4px;
  margin-bottom: 5px;
}

.event-other:hover {
  background-color: #5685B8;
}

/* Generic Event Tile */
.event-tile {
  display: block;
  margin-top: 5px;
  padding: 5px;
  font-size: 0.9rem;
  color: var(--support-color-1);
  background-color: var(--master-color-2);
  border-radius: 5px;
  text-align: left;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  transition: all 0.3s ease;
}

.event-tile:hover {
  background-color: #595959;
}

/* Report Tile */
.report-tile {
  display: block;
  margin-top: 5px;
  padding: 5px;
  font-size: 0.85rem;
  color: var(--master-color-2);
  background-color: #ffc107;
  border-radius: 5px;
  text-align: left;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  transition: all 0.3s ease;
}

.report-tile:hover {
  background-color: #e0a800;
  color: #ffffff;
}

/* ==========================================================================
   MODAL STYLING
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.modal-content {
  background: var(--support-color-1);
  padding: 20px;
  border-radius: 8px;
  max-width: 600px;
  width: 90%;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  position: relative;
  text-align: left;
}

.close-button {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  font-size: 20px;
  font-weight: bold;
  color: var(--master-color-2);
  cursor: pointer;
}

/* Enhanced Form Modal */
.form-modal {
  border-radius: 8px;
  padding: 20px;
}

.form-modal .modal-header {
  background-color: var(--master-color-1);
  border-bottom: none;
  padding: 15px 20px;
}

.form-modal .modal-title {
  color: var(--master-color-2);
  font-weight: bold;
}

.form-modal .modal-body {
  padding: 20px;
  background-color: #f9f9f9;
}

.form-modal .form-label {
  font-weight: bold;
  margin-bottom: 5px;
  color: #333;
  display: block;
}

.form-modal .form-control {
  margin-bottom: 15px;
  border-radius: 4px;
  border: 1px solid #ccc;
}

.form-modal .modal-footer {
  background-color: #f1f1f1;
  border-top: none;
  padding: 15px 20px;
}

.form-modal .btn-primary {
  background-color: var(--master-color-1);
  border: none;
  color: var(--master-color-2);
}

.form-modal .btn-primary:hover {
  background-color: #d6aa48;
  color: var(--master-color-2);
}

.form-modal .btn-secondary {
  background-color: #6c757d;
  border: none;
  color: #fff;
}

.form-modal .btn-secondary:hover {
  background-color: #5a6268;
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 768px) {
  .calendar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1px;
  }
  .calendar-header {
    display: none;
  }
  .calendar td {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }
}

/* ==========================================================================
   UTILITY CLASSES & MISCELLANEOUS
   ========================================================================== */
.card-body li {
  list-style-type: none;
}

/* Additional Event and Report Tile Hover Effects */
.event-tile:hover,
.report-tile:hover {
  /* Already defined above */
}

/* ==========================================================================
   Tentative Event Styling for Logged-in Users
   ========================================================================== */
.event-tentative {
    background-color: #cccccc !important; /* Grey background */
    border: 2px solid currentColor !important; /* Outline using the text color (client category color) */
}