/* ======================
   Base Styles Outside
   ====================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}


body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* ======================
   Header & Navigation
   ====================== */
   
header {
    
  background: #0077b6; /* For older browsers */
    color: white;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
}

header h1 {
    margin-bottom: 0.5rem;
}

nav {
    display: flex;
    gap: 1rem;
}

@media (max-width: 767px) {
  nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around; /* Evenly distributes space */
    width: 100%;
  }
  
  nav a {
    flex: 1; /* Makes items grow to fill space */
    min-width: max-content; /* Prevents text from breaking awkwardly */
    text-align: center;
      }
}

nav a {
    color: white;
    text-decoration: none;
}

nav a:hover {
    text-decoration: underline;
}

/* ======================
   Main Content
   ====================== */
main {
    width: 90%;
    max-width: 1200px;
    margin: 0; /* auto; */
    padding: 1rem;
}

/* ======================
   Alerts & Messages
   ====================== */
.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
}

.error {
    background-color: #ffcccc;
    color: #cc0000;
}

.success {
    background-color: #ccffcc;
    color: #006600;
}

/* ======================
   Forms
   ====================== */
form {
    max-width: 500px;
    margin: 2rem auto;
    padding: 1rem;
    background: white;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 1rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

button, .btn {
    display: inline-block;
    background: #0077b6;
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 1rem;
}

button:hover, .btn:hover {
    background: #005f92;
}

.btn-danger {
    background: #dc3545;
}

.btn-danger:hover {
    background: #bb2d3b;
}

button[name="delete_member"] {
  border: none;
  background: none;
  padding: 0;
  width: 16px;
  height: 16px;
  font-size: 16px;
  line-height: 0;
  color: red;
  cursor: pointer;
}

.filter-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    background: white;
    padding: 1rem;
    border-radius: 4px;
    box-shadow: 0 0 5px rgba(0,0,0,0.1);
}

/* ======================
   Tables - UPDATED FOR SCHEDULE
   ====================== */
.schedule-table {
    width: 100%;
    table-layout: fixed; /* Critical for fixed columns */
    border-collapse: collapse;
    margin-bottom: 2rem;
}

/* Column Width Distribution (6 columns) */
.schedule-table th:nth-child(1),
.schedule-table td:nth-child(1) {
    width: 12%; /* Time column */
}

.schedule-table th:not(:nth-child(1)),
.schedule-table td:not(:nth-child(1)) {
    width: 17.6%; /* 5 equal-width location columns */
}

/* change padding 27/04/2025 from 12px 8px to 2px 2px
/* Cell Styling */
.schedule-table th,
.schedule-table td {
    border: 1px solid #ddd;
    padding: 12px 8px;
    text-align: center;
    vertical-align: middle;
    height: auto;
    min-height: 60px; /* Minimum row height */
}

.schedule-table th {
    background-color: #0077b6;
    color: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Booking Content */
.booking {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 60px;
    justify-content: center;
}

.booking strong {
    display: block;
    margin-bottom: 4px;
}

.booking-notes {
    display: block;
    margin-top: 6px;
    padding: 6px;
    font-size: 0.95rem;
    line-height: 1.4;
    background-color: #f8f9fa;
    border-radius: 4px;
    word-break: break-word;
}

.book-btn {
    display: inline-block;
    padding: 8px 12px;
    background: #28a745;
    color: white;
    border-radius: 4px;
    text-decoration: none;
    margin-top: 4px;
}

.recurring-badge {
    background: #2196F3;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    display: inline-block;
    margin-top: 4px;
}

.clickable-team {
    color: #0066cc;
    text-decoration: underline;
    cursor: pointer;
    padding: 0 2px;
}

/* Popup styling (same as before) */

.team-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.popup-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    width: 80%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}
.close-popup {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
}
#popupTeamMembers {
    margin-top: 15px;
}
#popupTeamMembers li {
    padding: 5px 0;
    border-bottom: 1px solid #eee;
}

/* ======================
   Date Navigation
   ====================== */
.date-navigation {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.date-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-arrow {
    display: inline-block;
    padding: 5px 10px;
    background: #2196F3;
    color: white;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    font-size: 16px;
    transition: background 0.3s;
}

.today-btn {
    padding: 5px 10px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 6px;
    text-decoration: none;
    color: #333;
    font-weight: 500;
}

.help-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 1em;
}

.faq-index ul {
    list-style: none;
    padding-left: 0;
}

.faq-index ul li {
    margin: 0.5em 0;
}

.help-image {
    max-width: 100%;
    height: auto;
    border: 1px solid #ccc;
    margin-top: 10px;
    margin-bottom: 20px;
}


/* ======================
   Responsive Styles (Outside))
   ====================== */
@media (max-width: 768px) {
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 0 8px;
        width: 100%;
        box-sizing: border-box;
    }
}

    /* Base table layout */
    .schedule-table {
        min-width: 680px; /* Slightly wider for POCO's aspect ratio */
    }

    /* Cell optimizations */
    .schedule-table td {
        padding: 8px 3px;
        min-height: 44px;
        line-height: 1.3;
    }

    /* Text truncation */
    .booking strong {
        display: inline-block;
    /*    max-width: 20vw; *//* Slightly wider for 1080px screens */
        overflow: hidden;
    /*    text-overflow: ellipsis; */
        white-space: nowrap;
        font-size: 0.95rem;
    text-overflow: clip !important; /* Disable ellipsis (...) */
    max-width: none !important;    /* Remove max-width restrictions */
    }

    /* Notes optimization */
    .booking-notes {
        font-size: 0.78rem;
        line-height: 1.2;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        margin-top: 2px;
    }

    /* POCO-specific adjustments (1080x2400) */
    @media (min-width: 412px) and (max-width: 480px) {
        .booking strong {
            max-width: 24vw; /* More space for FHD+ resolution */
        }
        
        .schedule-table td {
            padding: 9px 4px;
        }
    }

    /* Smaller phone fallback */
    @media (max-width: 411px) {
        .booking strong {
            max-width: 18vw;
        }
        
        .book-btn {
            padding: 5px 8px;
            font-size: 0.75rem;
        }
    }


/* Reduce spacing inside the table */
.schedule-table td,
.schedule-table th {
  padding: 4px 6px; /* Was probably 10px+ before */
  font-size: 0.9rem; /* Slightly smaller */
  line-height: 1.2;
}

/* Remove margin between table rows */
.schedule-table tr {
  margin: 0;
}

/* Make the container more compact */
.schedule-container {
  padding: 10px;
  max-width: 100%;
}

/* Tighter layout around headings and buttons */
.schedule-header h2,
.schedule-header h3 {
  margin: 0.5rem 0;
}

.button {
  margin: 0.25rem;
  padding: 4px 8px;
  font-size: 0.85rem;
}



/* Optional: shrink arrows on small screens if needed */
@media (max-width: 600px) {
  .today-btn {
    padding: 6px 12px;
    font-size: 0.9rem;
  }

  .nav-arrow {
    font-size: 1.2rem;
    padding: 6px 8px;
  }

  .nav-wrapper {
    gap: 8px;
  }
}

.date-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.day-nav {
    display: flex;
    align-items: center;
}

.nav-arrow {
    font-size: 1.2rem;  /* Slightly smaller arrows */
    margin: 0px 0px;
   }

.today-btn {
    font-size: 0.95rem;  /* Slightly smaller text */
    padding: 0.2rem 0.6rem;  /* Less padding for a more compact button */
    border-radius: 4px;  /* Optional: slight rounding for polish */
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .nav-arrow {
        font-size: 1.1rem;
    }

    .today-btn {
        font-size: 0.9rem;
        padding: 0.2rem 0.5rem;
    }
}



/* Indoor Responsive Table Adjustments (Matching Outdoor) */

@media only screen and (max-width: 1200px) {
    /* Large screen adjustments for table container */
    .table-container {
        width: 90vw; /* Use 90% of the viewport width */
        margin: 0 auto;
    }
    table {
        font-size: 16px; /* Adjust font size for better readability on large tablets and below */
        padding: 8px 12px;
    }
}

@media only screen and (max-width: 992px) {
    /* Medium screen (tablets) adjustments */
    .table-container {
        width: 85vw; /* Ensure it scales properly */
    }
    table {
        font-size: 15px; /* Slightly smaller font */
        padding: 6px 10px; /* Adjust padding for tablets */
    }
}

@media only screen and (max-width: 768px) {
    /* Small screens (phones in landscape) */
    .table-container {
        width: 100vw; /* Full screen width for mobile */
    /*    padding: 5vw 2vw;  Add some padding for mobile devices */
    }
    table {
        font-size: 16px; /* Decrease font size */
        padding: 4px 8px; /* Adjust table padding */
    }
}

@media only screen and (max-width: 480px) {
    /* Very small screens (phones in portrait) */
    .table-container {
        width: 100vw; /* Full width for mobile phones */
     /*   padding: 4vw 2vw; */
    }
    table {
        font-size: 16px; /* Further decrease font size for mobile */
        padding: 2px 6px; /* Reduce padding for very small devices */
    }
    td, th {
        padding: 4px 6px; /* Adjust cell padding */
    }
}
@media (max-width: 480px) {
    .help-container {
        padding: 10px;
    }
    
    h1 {
        font-size: 24px;
    }
    
    section h2 {
        font-size: 20px;
        margin-top: 20px;
    }
}


/* Add loading state styles */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.time-btn.loading {
    position: relative;
}

.time-btn.loading::after {
    content: '';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

/* Chart container styles */
.graph-container {
    display: grid;
    gap: 30px;
}

.graph-section {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    position: relative;
}

.graph-section h3 {
    margin-bottom: 20px;
    color: #333;
    text-align: center;
}

/* Ensure the graph sections don't grow too tall */
.graph-section {
    max-height: 400px;
    overflow: hidden;
}

.chart-container {
    height: 300px;
    min-height: 250px;
    max-height: 350px;
}

/* Make charts responsive but constrained */
canvas {
    max-height: 300px !important;
    min-height: 250px !important;
    height: 300px !important;
    width: 100% !important;
}




/* Container for positioning */
.more-wrapper {
    position: relative;
    display: inline-block;
}

/* The popup dropdown */
.more-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: #0077b6;
    border: 1px solid #005f8a;
    border-radius: 4px;
    min-width: 180px;
    z-index: 1000;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.more-menu a {
    display: block;
    padding: 10px 12px;
    color: #fff;
    text-decoration: none;
    border-bottom: 1px solid #ffffff33;
}

.more-menu a:hover {
    background-color: #005f8a;
}

.more-menu.hidden {
    display: none;
}


/* Container for positioning */
.more-wrapper {
    position: relative;
    display: inline-block;
}

/* Hide the dropdown by default */
.more-menu {
    display: none;
}

/* Show the dropdown when toggled */
.more-menu:not(.hidden) {
    display: block;
}

/* For tablets and below: Ensure "More..." stays hidden until clicked */
@media (max-width: 768px) {
    .more-wrapper {
        display: inline-block;  /* Keeps the wrapper inline */
    }

    /* Optional: Adjust the size or positioning if needed */
    .more-menu {
        min-width: 150px;
    }
}

/* Optional: For larger screens (Desktop), you may adjust visibility */
@media (min-width: 769px) {
    .more-menu {
        /* Always show dropdown or any additional styling here */
    }
}

/* Keep all other existing styles below this line */