/* Reset and General Styles */
* {
  box-sizing: border-box;
}
body, h1, h2, label {
  margin: 0;
  padding: 0;
  font-family: 'Helvetica Neue', Arial, sans-serif;
}

body {
  background: linear-gradient(to bottom, #f5f7fa 0%, #c3cfe2 100%);
  background-attachment: fixed;
  color: #333;
  line-height: 1.6;
  min-height: 100vh;
}

/* Modern Navbar Styles */
.navbar {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
}

.navbar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.1);
  pointer-events: none;
}

.navbar a {
  color: white;
  padding: 16px 24px;
  text-decoration: none;
  display: inline-block;
  font-weight: 500;
  font-size: 15px;
  transition: all 0.3s ease;
  position: relative;
  border-radius: 0;
}

.navbar a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 80%;
  height: 3px;
  background: white;
  transition: transform 0.3s ease;
  border-radius: 2px;
}

.navbar a:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.navbar a:hover::after,
.navbar a.active::after {
  transform: translateX(-50%) scaleX(1);
}

.navbar a.active {
  background: rgba(255, 255, 255, 0.2);
  font-weight: 600;
}

.navbar span {
  color: white;
  padding: 16px 20px;
  font-size: 14px;
  font-weight: 500;
}

.navbar .user-info {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-left: auto;
  padding-right: 20px;
}

.navbar .user-info span {
  padding: 0;
  font-size: 13px;
  opacity: 0.9;
}

.navbar .user-info a {
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  font-size: 13px;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.navbar .user-info a:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(0);
}

.navbar .user-info a::after {
  display: none;
}

/* Main Header */
h1 {
  color: #2d3748;
  font-size: 32px;
  margin: 30px 0;
  text-align: center;
  font-weight: 700;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Form and Sections */
form {
  background-color: #fff;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  max-width: 900px;
  margin: 30px auto;
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.section {
  background-color: #f8f8f8;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
}

/* Columns and Containers */
.column, .wine-info-container .column {
  padding: 0 15px;
}

.wine-info-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}

/* Typography and Text Elements */
h2 {
  color: #4a5568;
  font-size: 24px;
  margin-bottom: 20px;
  text-align: center;
  font-weight: 600;
  letter-spacing: -0.3px;
}

label {
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 10px;
  display: block;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Inputs and Buttons */
input[type="text"], input[type="number"], select {
  width: 100%;
  padding: 12px 16px;
  margin-bottom: 20px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  background-color: #fff;
  font-size: 15px;
  transition: all 0.3s ease;
}

input[type="text"]:focus, input[type="number"]:focus, select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  transform: translateY(-1px);
}

input[readonly] {
  background-color: #f7fafc;
  cursor: not-allowed;
  color: #4a5568;
}

button {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  padding: 14px 28px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

button:active {
  transform: translateY(0);
}

/* Leaderboard Table Styles */
table {
  width: 90%;
  border-collapse: collapse;
  margin: 25px auto;
  font-size: 0.9em;
  min-width: 400px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.15);
}

table thead tr {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #ffffff;
  text-align: left;
}

table th,
table td {
  padding: 12px 15px;
}

table tbody tr {
  border-bottom: 1px solid #dddddd;
}

table tbody tr:nth-of-type(even) {
  background-color: #f3f3f3;
}

table tbody tr:last-of-type {
  border-bottom: 2px solid #667eea;
}

table tbody tr.active-row {
  font-weight: bold;
  color: #667eea;
}


/* Responsive Design */
@media (max-width: 768px) {
  .wine-info-container .column {
    width: 100%;
    padding: 0;
  }

  .navbar {
    flex-wrap: wrap;
    padding: 10px 0;
  }

  .navbar a {
    padding: 12px 16px;
    font-size: 14px;
  }

  .navbar .user-info {
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    padding-right: 10px;
  }

  .navbar .user-info span {
    font-size: 12px;
  }

  .navbar .user-info a {
    padding: 6px 12px;
    font-size: 12px;
  }

  h1 {
    font-size: 24px;
    margin: 20px 0;
  }

  form {
    padding: 20px;
    margin: 20px 10px;
  }
}

.submit-button-container {
  text-align: center;
  margin-top: 20px; /* Adjust as needed */
}

/* Info Icon Styles */
.info-icon {
  cursor: pointer;
  display: inline-block;
  margin-left: 5px;
  color: #0073e6; /* Match the blue theme */
  font-size: 1em; /* Adjust size as needed */
}

/* Tooltip Styles */
.tooltip {
  display: none;
  background-color: #0073e6; /* Blue background */
  color: #ffffff; /* White text for better contrast */
  border: 1px solid #005bae; /* Darker blue border for some contrast */
  padding: 8px; /* Slightly reduced padding */
  margin-top: 5px;
  position: absolute;
  z-index: 1;
  width: 300px; /* Wider text box */
  font-size: 0.9em; /* Smaller font size */
  border-radius: 4px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

.tooltip::after {
  content: "";
  position: absolute;
  top: -10px; /* Adjust based on actual tooltip top margin */
  left: 20px;
  border-width: 0 10px 10px 10px;
  border-style: solid;
  border-color: transparent transparent #0073e6 transparent;
}


/* Responsive Design Adjustments for Tooltips */
@media (max-width: 768px) {
  .tooltip {
    width: 90%; /* Make tooltips wider on smaller screens */
    left: 5%;  /* Center align the tooltip */
    transform: translateX(-5%);
  }
}

#totalComment {
  font-weight: bold;
  margin-left: 10px;
  color: #0073e6; /* Adjust the color to fit your design */
}

textarea {
  width: 100%;
  padding: 8px;
  margin-bottom: 15px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: inherit;
  resize: vertical;
}

textarea:focus {
  outline: none;
  border-color: #4CAF50;
  box-shadow: 0 0 5px rgba(76, 175, 80, 0.2);
}

/* Wine Number Selector - Full Width Container */
.wine-number-selector-container {
  width: 100%;
  max-width: 1200px;
  margin: 30px auto;
  padding: 0 20px;
}

.wine-number-selector-container > label {
  display: block;
  text-align: center;
  margin-bottom: 15px;
  font-size: 16px;
  font-weight: 600;
  color: #2d3748;
}

.wine-number-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  padding: 20px;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  border: 2px solid #e2e8f0;
  width: 100%;
  min-height: 80px;
  box-sizing: border-box;
}

.nav-button {
  padding: 12px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 24px;
  transition: all 0.3s ease;
  min-width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
  flex-shrink: 0;
}

.nav-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.nav-button:active {
  transform: translateY(0);
}

.nav-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.wine-number-input-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  flex-shrink: 0;
}

.wine-number-direct-input {
  width: 60px;
  padding: 8px;
  border: none;
  background: transparent;
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  color: #2d3748;
  outline: none;
}

.wine-number-direct-input:focus {
  background: #f7fafc;
  border-radius: 4px;
}

.wine-number-separator {
  color: #a0aec0;
  font-weight: 500;
}

.wine-number-max {
  color: #718096;
  font-size: 14px;
}

.tab-numbers {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  flex: 1;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  padding: 0 10px;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e0 transparent;
}

.tab-numbers::-webkit-scrollbar {
  height: 6px;
}

.tab-numbers::-webkit-scrollbar-track {
  background: transparent;
}

.tab-numbers::-webkit-scrollbar-thumb {
  background: #cbd5e0;
  border-radius: 3px;
}

.tab-number {
  padding: 8px 14px;
  background-color: #f7fafc;
  color: #4a5568;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  min-width: 44px;
  text-align: center;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
  position: relative;
}

.tab-number:hover {
  background-color: #edf2f7;
  border-color: #cbd5e0;
  transform: translateY(-1px);
}

/* Scored wines - green background */
.tab-number.scored {
  background-color: #c6f6d5;
  border-color: #68d391;
  color: #22543d;
}

.tab-number.scored:hover {
  background-color: #9ae6b4;
  border-color: #48bb78;
}

/* Not scored wines - red background */
.tab-number.not-scored {
  background-color: #fed7d7;
  border-color: #fc8181;
  color: #742a2a;
}

.tab-number.not-scored:hover {
  background-color: #feb2b2;
  border-color: #f56565;
}

/* Active state overrides */
.tab-number.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-color: #667eea;
  font-weight: 600;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.tab-number.active.scored {
  background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
  border-color: #38a169;
}

.tab-number.active.not-scored {
  background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
  border-color: #e53e3e;
}

.tab-number.active:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(102, 126, 234, 0.4);
}

.tab-number.active.scored:hover {
  box-shadow: 0 6px 12px rgba(72, 187, 120, 0.4);
}

.tab-number.active.not-scored:hover {
  box-shadow: 0 6px 12px rgba(245, 101, 101, 0.4);
}

/* Style for ellipsis */
.tab-numbers span {
  color: #a0aec0;
  font-weight: 500;
  padding: 0 4px;
  display: flex;
  align-items: center;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .wine-number-selector-container {
    padding: 0 10px;
    margin: 20px auto;
  }

  .wine-number-selector {
    padding: 15px 10px;
    gap: 10px;
    min-height: 70px;
  }

  .nav-button {
    min-width: 40px;
    height: 40px;
    font-size: 20px;
    padding: 8px 12px;
  }

  .wine-number-input-wrapper {
    padding: 6px 12px;
  }

  .wine-number-direct-input {
    width: 50px;
    font-size: 16px;
  }

  .tab-numbers {
    gap: 4px;
    padding: 0 5px;
  }

  .tab-number {
    padding: 6px 10px;
    min-width: 36px;
    font-size: 12px;
  }
}
