/* Main Styles */
:root {
  --primary-color: #2c5282;
  --secondary-color: #87ceeb;
  --border-color: #ddd;
  --highlight-color: #f5f5f5;
  --success-color: #27ae60;
  --error-color: #e74c3c;
  --text-color: #333;
  --light-text: #777;
  --header-bg: #1a3a5f;
  --header-text: #ffffff;
  --menu-hover: #2c5282;
  --footer-bg: #1a3a5f;
  --footer-text: #ffffff;
}

body {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: #f0f5fa;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

h1, h2, h3 {
  color: var(--primary-color);
  margin-top: 0;
}

/* Header & Navigation */
.main-header {
  background-color: var(--header-bg);
  color: var(--header-text);
  padding: 10px 0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  /* position: sticky; top: 0; z-index: 1001; */ /* Removed sticky header for now to simplify layout fixing */
}

.main-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px; /* Original padding */
}

.logo a {
  color: var(--header-text);
  font-size: 1.5rem;
  font-weight: bold;
  text-decoration: none;
  transition: color 0.3s;
}

.logo a:hover {
  color: var(--secondary-color);
}

.main-nav ul {
  list-style-type: none;
  padding: 0;
  margin: 0;
  display: flex; /* Restored for horizontal menu items */
}

/* Styles for Permanent Top Bar Navigation */
.main-nav {
  /* No longer a sidebar, part of the header flow */
}

.main-nav ul#adminMenuItems { /* Target the specific ul */
  list-style-type: none;
  padding: 0;
  margin: 0;
  display: flex; /* Ensure items are horizontal */
  align-items: center; /* Vertically align items */
}

.main-nav ul#adminMenuItems li {
  position: relative; /* For potential future dropdowns, though not used now */
  margin-left: 10px; /* Spacing between menu items */
}

.main-nav ul#adminMenuItems li:first-child {
  margin-left: 0;
}

.main-nav ul#adminMenuItems a {
  color: var(--header-text);
  text-decoration: none;
  padding: 8px 12px; /* Adjusted padding for top bar items */
  display: block;
  border-radius: 4px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.main-nav ul#adminMenuItems a:hover,
.main-nav ul#adminMenuItems a.active {
  background-color: var(--menu-hover);
  color: white;
}

.current-hotel {
  display: flex;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.1);
  padding: 8px 15px; /* Adjusted padding for consistency */
  border-radius: 4px;
  font-size: 0.9em;
  margin-left: auto; /* Push this item to the far right of the flex container */
  /* Removed fixed height and line-height to allow natural flow */
}

.current-hotel span {
  white-space: nowrap; /* Prevent text from wrapping */
}

/* Main Content Area */
.main-content {
  flex: 1; /* Restored */
  padding: 20px 0; /* Original padding */
}

/* Footer */
.main-footer {
  background-color: var(--footer-bg);
  color: var(--footer-text);
  padding: 15px 0;
  text-align: center;
  margin-top: auto; /* Restored */
}

.main-footer p {
  margin: 0;
  font-size: 0.9em;
}

/* Form Layout */
.questionnaire-form {
  background-color: #fff;
  border-radius: 5px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 20px;
  margin-bottom: 30px;
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
  font-family: Arial, sans-serif;
}

.form-intro {
  margin-bottom: 30px;
  text-align: center;
}

.satisfaction-levels {
  margin-bottom: 20px;
}

.rating-legend {
  display: flex;
  justify-content: center;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  margin: 10px auto;
  max-width: 600px;
}

.rating-item {
  flex: 1;
  text-align: center;
  padding: 10px;
  border-right: 1px solid var(--border-color);
}

.rating-item:last-child {
  border-right: none;
}

.rating-number {
  font-weight: bold;
  color: var(--primary-color);
  font-size: 1.2em;
  padding: 5px;
  border-bottom: 1px solid var(--border-color);
}

.rating-text {
  padding: 5px;
  font-size: 0.9em;
}

.form-content {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.content-left, .content-right {
  flex: 1;
  min-width: 300px;
}

/* Form Controls */
.form-group {
  margin-bottom: 15px;
}

label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}

input[type="text"],
input[type="date"],
textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background-color: #f9f9f9;
  box-sizing: border-box;
}

.checkbox-group, .radio-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.checkbox-group label, .radio-group label {
  display: flex;
  align-items: center;
  font-weight: normal;
}

.checkbox-group input, .radio-group input {
  margin-right: 10px;
}

/* Target the wrapper for each checkbox and its label (from MULTI_CHOICE in Jinja) */
.form-check {
  display: flex;         /* Aligns the input and label horizontally */
  align-items: center;   /* Vertically centers them */
}

/* Adjust the checkbox input within .form-check */
.form-check .form-check-input {
  margin-right: 8px;   /* Adds space between the checkbox and the text label */
  margin-top: 0;       /* Reset any default vertical margins */
  margin-bottom: 0;    /* Reset any default vertical margins */
}

/* Adjust the label within .form-check */
.form-check .form-check-label {
  font-weight: normal; /* Keep consistent with other labels */
  margin-bottom: 0;    /* The parent .form-check or .checkbox-group handles spacing */
}

/* Rating Sections */
.section, .rating-section, .feedback-section {
  margin-bottom: 30px;
  padding: 15px;
  border: 1px solid #1a3a5f;
  border-radius: 4px;
  background-color: #f0f5fa;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.section h3, .rating-section h3, .feedback-section h3 {
  margin-top: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid #1a3a5f;
  color: #1a3a5f;
  font-size: 18px;
  text-transform: uppercase;
  text-align: center;
}

.rating-row {
  display: flex;
  margin-bottom: 10px;
  align-items: center;
}

.rating-label {
  flex: 2;
  padding-right: 15px;
  font-weight: bold;
  color: #1a3a5f;
}

.rating-inputs {
  flex: 3;
  display: flex;
  justify-content: space-between;
  column-gap: 3px;
}

.rating-input {
  text-align: center;
  border: 1px solid #e0d7c5;
  background-color: #f2ebda;
  padding: 5px;
  flex: 1;
  position: relative;
}

.rating-input input[type="radio"] {
  margin: 0 auto;
  display: block;
  cursor: pointer;
  width: 20px;
  height: 20px;
}

.rating-input label {
  font-weight: bold;
  margin: 0;
  color: #1a3a5f;
  font-size: 14px;
}

/* Submit Button */
.form-footer {
  margin-top: 30px;
  text-align: center;
}

.submit-button {
  background-color: #1a3a5f;
  color: white;
  border: none;
  padding: 12px 40px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 18px;
  font-weight: bold;
  transition: background-color 0.3s;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  text-transform: uppercase;
}

.submit-button:hover {
  background-color: #2c5282;
}

/* Confirmation and Error Messages */
.confirmation-message {
  background-color: var(--success-color);
  color: white;
  padding: 20px;
  text-align: center;
  border-radius: 4px;
  margin: 20px 0;
}

.error-message {
  background-color: var(--error-color);
  color: white;
  padding: 20px;
  text-align: center;
  border-radius: 4px;
  margin: 20px 0;
}

/* Dashboard styles */
.dashboard {
  background-color: #fff;
  border-radius: 5px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 20px;
  margin-bottom: 30px;
}

/* Responsive */
@media (max-width: 768px) {
  body {
    overflow-x: hidden;
    max-width: 100vw;
  }
  
  .container {
    max-width: 100vw;
    overflow-x: hidden;
    box-sizing: border-box;
  }
  
  .form-content {
    flex-direction: column;
  }
  
  .rating-row {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .rating-label {
    margin-bottom: 10px;
    width: 100%;
  }
  
  .rating-inputs {
    width: 100%;
    display: flex;
    justify-content: space-between;
  }
  
  .rating-input {
    flex: 1;
    min-width: auto;
    margin: 0 2px;
    padding: 8px 3px;
  }
  
  .rating-input label {
    font-size: 0.9em;
  }
  
  .main-header {
    width: 100%;
    max-width: 100vw;
  }
  
  .main-header .container {
    /* flex-direction: column; */ /* Header items remain row */
    padding: 10px; /* Adjust padding if needed */
    /* width: 100%; */ /* Container is already full width in header */
  }

  /* Mobile Navigation - Adjustments for permanent top bar */
  body {
    /* display: flex; flex-direction: column; */ /* Already default for mobile in original styles */
  }

  .main-header .container {
    flex-direction: column; /* Stack logo and nav on mobile */
    align-items: flex-start; /* Align items to the start */
  }
  
  .main-nav {
    margin-top: 10px;
    width: 100%;
  }
  
  .main-nav ul#adminMenuItems { /* Target specific ul */
    flex-direction: column; /* Stack menu items vertically on mobile */
    width: 100%;
  }
  
  .main-nav ul#adminMenuItems li {
    margin-left: 0;
    margin-top: 5px; /* Spacing between vertical items */
    width: 100%;
  }
  
  .main-nav ul#adminMenuItems a {
    padding: 10px 14px; /* Restore original padding for vertical items */
    background-color: rgba(255, 255, 255, 0.1); /* Slight background for items */
    border-bottom: 1px solid rgba(255,255,255,0.05);
  }
   .main-nav ul#adminMenuItems li:last-child a {
    border-bottom: none;
  }
  
  .current-hotel {
    margin-top: 10px;
    margin-left: 0; /* No left margin on mobile */
    width: 100%;
    justify-content: center;
    padding: 8px;
    box-sizing: border-box;
  }
  
  /* Remove old dropdown-menu specific mobile styles as they are no longer relevant */
  /* .dropdown-menu { ... } */
  /* .dropdown-menu li { ... } */
  /* .dropdown-menu a { ... } */

  .rating-legend {
    display: flex;
    flex-wrap: wrap;
  }
  
  .rating-item {
    min-width: 60px;
    padding: 8px 4px;
  }
  
  .rating-number {
    font-size: 1em;
  }
  
  .rating-text {
    font-size: 0.8em;
  }
  
  .form-group {
    margin-bottom: 20px;
  }
  
  .section, .rating-section {
    padding: 10px;
  }
  
  .admin-dashboard,
  .admin-hotels {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    box-sizing: border-box;
  }
  
  .admin-cards,
  .hotel-list-container,
  .hotel-grid {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }
  
  .admin-card,
  .hotel-card {
    width: 100%;
    box-sizing: border-box;
  }
  
  .summary-stats, 
  .chart-row {
    flex-direction: column;
  }
  
  .chart-card, 
  .stat-card {
    min-width: 100%;
    margin: 0 0 20px;
  }
  
  .tabs {
    flex-wrap: wrap;
  }
  
  /* Fix list styles in mobile */
  ul, ol {
    padding-left: 20px;
  }
  
  li {
    list-style-position: inside;
  }
}
