/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Header Controls */
.header-controls {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  gap: 10px;
  align-items: center;
}

.language-picker {
  display: flex;
  align-items: center;
  height: 100%;
}

/* Style for the inline form to make it blend with the rest of the UI */
.inline-form {
  display: inline-flex;
  margin: 0;
  padding: 0;
  height: 100%;
}

.auth-controls {
  display: flex;
  align-items: center;
  height: 100%;
}

/* Calendar day forms should maintain the grid layout */
.calendar-day-form {
  display: contents; /* Use contents to avoid disrupting the grid layout */
}

.language-button, .nav-arrow, .today-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #6c757d;
  color: white;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  border: none; /* Remove default button border */
  height: 38px; /* Fixed height */
  line-height: 1;
  box-sizing: border-box;
}

.language-button:hover, .nav-arrow:hover, .today-button:hover {
  background-color: #5a6268;
  color: white;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Calendar day button styles */
button.calendar-day {
  border: none;
  background: none;
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

.logout-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #dc3545;
  color: white;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  height: 38px; /* Fixed height */
  line-height: 1;
  box-sizing: border-box;
}

.logout-button:hover {
  background-color: #bd2130;
  color: white;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.calendar-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.calendar-container h1 {
  text-align: center;
}

.flash-notice {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
  padding: 15px;
  margin: 10px 0;
  border-radius: 5px;
  text-align: center;
  font-weight: bold;
}

.flash-alert {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
  padding: 15px;
  margin: 10px 0;
  border-radius: 5px;
  text-align: center;
  font-weight: bold;
}

.date-picker-section {
  margin: 20px 0;
  text-align: center;
}

.date-form {
  display: inline-block;
}

.date-input {
  padding: 10px;
  font-size: 16px;
  border: 2px solid #ddd;
  border-radius: 5px;
  margin-right: 10px;
}

.btn {
  padding: 10px 20px;
  font-size: 16px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.btn-primary {
  background-color: #28a745;
  color: white;
}

.btn-primary:hover {
  background-color: #1e7e34;
}

.selected-date {
  text-align: center;
  margin: 20px 0;
  padding: 20px;
  background-color: #f8f9fa;
  border-radius: 5px;
}

.calendar-grid {
  margin-top: 30px;
}

.calendar-grid h3 {
  text-align: center;
}

.month-navigation {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.month-navigation h3 {
  margin: 0 20px;
  font-size: 1.5em;
  font-weight: bold;
}

/* Bottom Section Layout - Day count left, buttons center */
.bottom-section {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  margin: 10px 0 15px 0;
}

/* Day Count Display */
.day-count-container {
  position: absolute;
  left: 0;
  top: 0;
}

.day-count {
  display: inline-block;
  padding: 5px 0;
  background-color: transparent;
  color: #495057;
  border: none;
  border-radius: 0;
  font-size: 16px;
  font-weight: 500;
  box-shadow: none;
}

.day-count.selecting {
  background-color: transparent;
  color: #856404;
  animation: pulse 1.5s ease-in-out infinite alternate;
}

@keyframes pulse {
  from {
    opacity: 0.8;
  }
  to {
    opacity: 1;
  }
}

.today-button-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.today-button {
  display: block;
  padding: 12px 24px;
  background-color: #28a745;
  color: white;
  text-decoration: none;
  border-radius: 25px;
  font-weight: bold;
  font-size: 16px;
  transition: background-color 0.2s, transform 0.1s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.today-button:hover {
  background-color: #218838;
  color: white;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.clear-button {
  display: block;
  padding: 12px 24px;
  background-color: #dc3545;
  color: white;
  text-decoration: none;
  border-radius: 25px;
  font-weight: bold;
  font-size: 16px;
  transition: background-color 0.2s, transform 0.1s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.clear-button:hover {
  background-color: #c82333;
  color: white;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.save-range-form {
  display: block;
}

.save-range-button {
  display: block;
  padding: 12px 24px;
  background-color: #007bff;
  color: white;
  text-decoration: none;
  border: none;
  border-radius: 25px;
  font-weight: bold;
  font-size: 16px;
  transition: background-color 0.2s, transform 0.1s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  cursor: pointer;
}

.save-range-button:hover {
  background-color: #0056b3;
  color: white;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.nav-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background-color: #007bff;
  color: white;
  text-decoration: none;
  border-radius: 50%;
  font-size: 20px;
  font-weight: bold;
  transition: background-color 0.2s;
}

.nav-arrow:hover {
  background-color: #0056b3;
  color: white;
  text-decoration: none;
}

.calendar {
  border: 1px solid #ddd;
  border-radius: 5px;
  overflow: hidden;
}

.calendar-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background-color: #f8f9fa;
}

.day-header {
  padding: 10px;
  text-align: center;
  font-weight: bold;
  border-right: 1px solid #ddd;
}

.day-header:last-child {
  border-right: none;
}

.calendar-body {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.calendar-day {
  padding: 15px;
  text-align: center;
  text-decoration: none;
  color: #333;
  border-right: 1px solid #eee;
  border-bottom: 1px solid #eee;
  transition: background-color 0.2s;
  cursor: pointer;
  user-select: none;
}

.calendar-day:hover {
  background-color: #e9ecef;
}

.calendar-day.other-month {
  color: #999;
  background-color: #f8f9fa;
  cursor: pointer;
}

.calendar-day.other-month:hover {
  background-color: #e9ecef;
  color: #666;
}

.calendar-day.range-start {
  background-color: #28a745;
  color: white;
  font-weight: bold;
}

.calendar-day.range-end {
  background-color: #28a745;
  color: white;
  font-weight: bold;
}

.calendar-day.in-range {
  background-color: #b3e5c7;
  color: #333;
}

.calendar-day.booked {
  background-color: #ffcccb;
  color: #721c24;
  cursor: not-allowed;
}

.calendar-day.booked:hover {
  background-color: #ffcccb;
  cursor: not-allowed;
}

.calendar-day.would-conflict {
  background-color: #fff3cd;
  color: #856404;
  cursor: not-allowed;
}

.calendar-day.would-conflict:hover {
  background-color: #fff3cd;
  cursor: not-allowed;
}

.calendar-day.today {
  font-weight: bold;
  border: 2px solid #ffc107;
}

.calendar-day.today.range-start,
.calendar-day.today.range-end {
  background-color: #1e7e34;
  border: 2px solid #ffc107;
}

.calendar-day.today.in-range {
  background-color: #99d9b3;
  border: 2px solid #ffc107;
}

.selected-range-display {
  text-align: center;
  margin: 20px 0;
  padding: 15px;
  background-color: #d4edda;
  border: 1px solid #c3e6cb;
  border-radius: 5px;
  color: #155724;
}

.selection-instructions {
  text-align: center;
  margin: 20px 0;
  padding: 15px;
  background-color: #d1ecf1;
  border: 1px solid #bee5eb;
  border-radius: 5px;
  color: #0c5460;
}

.calendar-day:nth-child(7n) {
  border-right: none;
}

.calendar-day.today:nth-child(7n) {
  border-right: 2px solid #ffc107;
}

/* Confirmation Toast */
.confirmation-toast {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.confirmation-content {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
  padding: 20px;
  width: 90%;
  max-width: 400px;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.confirmation-content h3 {
  text-align: center;
  margin-top: 0;
  color: #333;
  margin-bottom: 15px;
}

.date-range-display {
  padding: 15px;
  background-color: #f8f9fa;
  border-radius: 5px;
  margin-bottom: 20px;
  text-align: left;
  font-size: 16px;
  line-height: 1.5;
}

.confirmation-buttons {
  display: flex;
  justify-content: space-between;
}

.btn-secondary {
  background-color: #6c757d;
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
  transition: background-color 0.2s;
}

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

.btn-success {
  background-color: #28a745;
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
  transition: background-color 0.2s;
}

.btn-success:hover {
  background-color: #218838;
}

@media (max-width: 768px) {
  .calendar-container {
    padding: 10px;
  }
  
  .calendar-day {
    padding: 10px 5px;
    font-size: 14px;
  }
  
  .date-input {
    width: 100%;
    margin-bottom: 10px;
    margin-right: 0;
  }
  
  .btn {
    width: 100%;
  }
  
  /* Fix header controls overlap on mobile */
  .header-controls {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 1000;
    flex-direction: row;
    gap: 5px;
    align-items: center;
  }
  
  .language-button {
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 20px;
    height: 38px;
    box-sizing: border-box;
  }
  
  .logout-button {
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 20px;
    height: 38px;
    box-sizing: border-box;
  }
  
  /* Add top margin to calendar container to prevent overlap */
  .calendar-container {
    padding: 60px 10px 10px 10px;
  }
  
  .calendar-container h1 {
    margin-top: 0;
    font-size: 24px;
  }
  
  /* Fix mobile layout for bottom section */
  .bottom-section {
    flex-direction: column;
    align-items: center;
    gap: 15px;
  }
  
  .day-count-container {
    position: static;
    order: 1;
    margin-bottom: 10px;
  }
  
  .today-button-container {
    order: 2;
  }
}
