/* Mobile-first responsive navigation */
nav details.dropdown {
  display: inline-block;
}

/* Base navigation styles for better mobile layout */
nav.container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

nav.container > ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
  gap: 0.5rem;
}

nav.container > ul:first-child {
  flex: 1 1 auto;
  min-width: 200px;
}

nav.container > ul:last-child {
  flex: 0 1 auto;
  justify-content: flex-end;
}

/* Navigation logo */
.nav-logo {
  height: 120px;
  width: auto;
  max-width: 100%;
}

/* Navigation responsive styles */
@media (max-width: 768px) {
  nav.container {
    padding: 0.5rem;
    flex-direction: column;
    align-items: flex-start;
  }

  nav.container > ul:first-child {
    width: 100%;
    margin-bottom: 0.5rem;
  }

  nav.container > ul:first-child a {
    font-size: 0.9rem;
  }

  .nav-logo {
    height: 60px !important;
  }

  nav.container > ul:last-child {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  nav.container > ul:last-child li {
    margin: 0;
  }

  nav details.dropdown ul {
    position: absolute;
    right: 0;
    left: auto;
    min-width: 200px;
    z-index: 1000;
  }
}

/* Table responsive wrapper */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1rem;
}

.table-responsive table {
  min-width: 600px;
  margin-bottom: 0;
}

/* Mobile table adjustments */
@media (max-width: 768px) {
  .table-responsive table {
    font-size: 0.875rem;
  }

  .table-responsive th,
  .table-responsive td {
    padding: 0.5rem;
  }
}

/* Grid responsive adjustments */
@media (max-width: 768px) {
  .grid {
    grid-template-columns: 1fr !important;
    gap: 1rem;
  }
}

/* WebSocket indicator mobile adjustment */
@media (max-width: 768px) {
  #websocket-indicator {
    top: 10px;
    right: 10px;
    padding: 6px 10px;
    font-size: 12px;
  }
}

/* global ranking */

table tbody tr.highlight,
table tbody tr.highlight td {
    background-color: rgba(255, 215, 0, 0.2) !important;
}

table tbody tr.highlight td {
    font-weight: bold;
    border-top: 2px solid rgba(255, 215, 0, 0.5);
    border-bottom: 2px solid rgba(255, 215, 0, 0.5);
}

table tbody tr.highlight td:first-child {
    border-left: 4px solid #ffd700;
}

table tbody tr.highlight td:last-child {
    border-right: 4px solid #ffd700;
}

/* Chat message styles */

.youtube-message {
  background-color: #f8e9e2;
  border-left: 4px solid #ff0000;
  padding: 8px;
  margin-bottom: 8px;
  border-radius: 4px;
}

.user-message {
  background-color: #e9f0f8;
  border-left: 4px solid #3498db;
  padding: 8px;
  margin-bottom: 8px;
  border-radius: 4px;
}

.system-message {
  background-color: #f0f0f0;
  border-left: 4px solid #95a5a6;
  padding: 8px;
  margin-bottom: 8px;
  border-radius: 4px;
  font-style: italic;
}

.message-time {
  color: #7f8c8d;
  font-size: 0.8em;
  float: right;
}

/* Chat container */
#messages {
  max-height: 500px;
  overflow-y: auto;
  padding: 10px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  margin-bottom: 10px;
  list-style-type: none;
}

/* WebSocket indicator styles */
#websocket-indicator {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 10px 15px;
  border-radius: 5px;
  color: white;
  font-weight: bold;
  font-size: 14px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
}

#websocket-icon {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  transition: background-color 0.3s ease;
}

/* Connection status block next to title */
#connection-status-block {
  display: inline-block;
  margin-left: 15px;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: normal;
  vertical-align: middle;
  transition: all 0.3s ease;
  animation: fadeIn 0.3s ease;
}

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

/* Availability management styles */
.status-badge {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.85em;
  font-weight: 600;
}

.status-highly {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.status-maybe {
  background-color: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}

.status-unavailable {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.inline-form {
  display: inline;
  margin: 0;
  padding: 0;
}

.inline-form button {
  margin: 0;
  padding: 4px 8px;
  font-size: 0.85em;
}

.current-timezone {
  background-color: #e7f3ff;
  border: 1px solid #b3d9ff;
  border-radius: 4px;
  padding: 12px;
  margin-bottom: 16px;
}

.availability-list {
  margin-bottom: 20px;
}

.availability-list table {
  margin-bottom: 0;
}

.action-buttons {
  margin-top: 16px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Form validation styles */
small.error {
  color: #dc3545;
  font-weight: 600;
}

input[aria-invalid="true"] {
  border-color: #dc3545;
}

.error-message {
	color: #d63031;
	background-color: #ffeaa7;
	padding: 0.5rem;
	border-radius: 0.25rem;
	margin: 0.5rem 0;
	border: 1px solid #d63031;
}

.success-message {
	padding: 0.5rem;
	border-radius: 0.25rem;
	margin: 0.5rem 0;
	border: 1px solid #00b894;
}

/* Availability Management Mobile Styles */
@media (max-width: 768px) {
  .day-selector {
    grid-template-columns: repeat(4, 1fr) !important;
  }

  .day-btn {
    padding: 0.5rem 0.25rem !important;
    font-size: 0.75rem !important;
  }

  .status-selector {
    grid-template-columns: 1fr !important;
  }

  .status-option {
    padding: 0.75rem !important;
  }

  .current-timezone {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
  }

  article header h2 {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .timezone-form fieldset.grid {
    grid-template-columns: 1fr !important;
  }
}

