/* Components - Reusable UI elements */

/* Import admin stats components */
@import "admin-stats.css";

/* Import shared components */
@import "accordion.css";

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.5rem;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: visible;
}

.button::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.3s, height 0.3s;
}


.button.primary {
  background-color: var(--color-accent-orange);
  color: white;
  border: 2px solid var(--color-accent-orange);
}


.button.secondary {
  background-color: var(--color-secondary-grey-medium);
  color: var(--color-text-inverted);
  border: 2px solid var(--color-secondary-grey-medium);
}

}

.button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Forms */
form {
  border-radius: 8px;
  margin-bottom: 2rem;
}

.form-group {
  margin-bottom: 1.5rem;
  position: relative;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--color-primary-text);
}

.form-group small {
  display: block;
  margin-top: 0.25rem;
  color: var(--color-secondary-grey-medium);
  font-size: 0.875rem;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="email"],
select,
textarea {
  width: 100%;
  padding: 0.8rem;
  border: 2px solid var(--color-secondary-grey-medium);
  border-radius: 4px;
  background-color: var(--color-primary-bg);
  color: var(--color-primary-text);
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-accent-orange);
  box-shadow: 0 0 0 2px rgba(255, 111, 0, 0.2);
}

/* Improve select dropdown usability and appearance */
select {
  font-size: 1.1rem;
  min-width: 160px;
  z-index: 1002;
}

select option {
  font-size: 1.1rem;
}

/* Number Input Controls */
.number-input-control {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background-color: var(--color-secondary-grey-dark);
  padding: 1rem;
  border-radius: 12px;
  border: 3px solid var(--color-secondary-grey-medium);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  max-width: 400px;
  margin: 0 auto;
}

.number-input-control input[type="number"] {
  width: 120px;
  height: 80px;
  text-align: center;
  font-size: 2rem;
  font-weight: bold;
  -moz-appearance: textfield;
  background-color: var(--color-primary-bg);
  border: 3px solid var(--color-secondary-grey-medium);
  border-radius: 8px;
  padding: 0.5rem;
  color: var(--color-primary-text);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.number-input-control input[type="number"]::-webkit-outer-spin-button,
.number-input-control input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.number-input-control button {
  width: 80px;
  height: 80px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: bold;
  border: 3px solid var(--color-accent-orange);
  background-color: var(--color-accent-orange);
  color: #000000;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 8px;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

  transform: translateY(-2px);
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.2);
}

.number-input-control button:active:not(:disabled) {
  background-color: #e65c00;
  color: #000000;
  border-color: #e65c00;
  transform: translateY(1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.number-input-control button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  background-color: var(--color-secondary-grey-medium);
  border-color: var(--color-secondary-grey-medium);
  color: var(--color-primary-text);
}

/* Flash Messages */
.flash-message {
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: slideIn 0.3s ease-out;
  position: relative;
}

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

.flash-message.success {
  background-color: var(--color-success-bg);
  color: var(--color-success-text);
  border: 1px solid var(--color-success-border);
}

.flash-message.error {
  background-color: var(--color-error-bg);
  color: var(--color-error-text);
  border: 1px solid var(--color-error-border);
}

.flash-message .close-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  background: none;
  border: none;
  color: var(--color-secondary-grey-medium);
  font-size: 2rem;
  cursor: pointer;
  padding: 0.25em 0.5em;
  min-width: 2.2rem;
  min-height: 2.2rem;
  line-height: 1;
  border-radius: 50%;
  z-index: 2;
  transition: color 0.2s, background 0.2s;
}

  outline: none;
}

/* Cards */
.feature-card {
  background-color: var(--color-secondary-grey-dark);
  padding: 2rem;
  border-radius: 8px;
  transition: transform 0.2s;
}

.feature-card:hover {
  transform: translateY(-5px);
}

.feature-card h2 {
  color: var(--color-accent-orange);
  margin-bottom: 1rem;
}

/* Stats Cards */
.stats-card {
  background: #222;
  border-radius: 16px;
  padding: 18px 12px;
  margin-bottom: 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  max-width: 350px;
  margin-left: auto;
  margin-right: auto;
}

.stat-block {
  display: flex;
  align-items: center;
  border-radius: 6px;
  padding: 16px 18px;
  margin: 0;
  gap: 18px;
  justify-content: flex-start;
  background: #222;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(80, 80, 80, 0.3);
}

.stat-icon {
  font-size: 2em;
  color: var(--color-accent-orange);
  flex-shrink: 0;
  min-width: 2.2em;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1;
}

.stat-label {
  color: #fff;
  font-size: 1.1em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.stat-sub-label {
  color: var(--color-secondary-grey-medium);
  font-size: 0.8em;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0.2px;
  margin-bottom: 8px;
  font-style: italic;
}

.stat-value {
  color: var(--color-accent-orange);
  font-size: 1em;
  font-weight: bold;
  line-height: 1.1;
  text-align: center;
}

.stat-explanation {
  color: var(--color-secondary-grey-medium);
  font-size: 10px;
  margin-top: 2px;
  font-style: italic;
}

/* Admin Stats Cards */
.stats-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background-color: #393939;
  border-radius: 10px;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.stat-card-icon {
  background: linear-gradient(
    135deg,
    rgba(255, 111, 0, 0.9),
    rgba(255, 111, 0, 0.7)
  );
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 1rem;
  color: #fff;
  font-size: 1.5rem;
}

.stat-card-content {
  flex: 1;
}

.stat-card-title {
  color: var(--color-secondary-grey-medium);
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.stat-card-value {
  color: #fff;
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.stat-card-subtitle {
  color: var(--color-secondary-grey-medium);
  font-size: 0.8rem;
}

/* System health cards (similar to stat cards) */
.system-health-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.system-health-card {
  background-color: #393939;
  border-radius: 10px;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.system-health-card-icon {
  background: linear-gradient(
    135deg,
    rgba(0, 123, 255, 0.9),
    rgba(0, 123, 255, 0.7)
  );
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 1rem;
  color: #fff;
  font-size: 1.5rem;
}

.system-health-card-content {
  flex: 1;
}

.system-health-card-title {
  color: var(--color-secondary-grey-medium);
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.system-health-card-value {
  color: #fff;
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.system-health-card-subtitle {
  color: var(--color-secondary-grey-medium);
  font-size: 0.8rem;
}

/* Chart container */
.chart-container {
  background-color: #393939;
  border-radius: 10px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.chart-container h3 {
  color: var(--color-accent-orange);
  margin-top: 0;
  margin-bottom: 1.5rem;
  font-size: 1.2rem;
}

.chart-wrapper {
  height: 300px;
  position: relative;
}

/* Webkit (Chrome, Safari, Edge) calendar icon styling */
input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(80%) sepia(25%) saturate(1000%) hue-rotate(140deg)
    brightness(87%) contrast(90%);
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

/* Firefox date input styling */
@-moz-document url-prefix() {
  input[type="date"] {
    position: relative;
  }

  input[type="date"]::after {
    content: "\1F4C5"; /* Unicode calendar icon */
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-accent-blue);
    pointer-events: none;
  }
}

/* Total Putts Configured display - match stat-value style for consistency */
#total-putts-display {
  text-align: center;
  color: var(--color-accent-orange);
  font-size: 1em;
  font-weight: bold;
  line-height: 1.1;
  margin-bottom: 0.5em;
}

#total-putts-label {
  text-align: center;
}

#total-putts-display .total-putts-xx {
  font-size: 2em;
  font-weight: bold;
  color: inherit;
  transition: color 0.2s, font-size 0.2s;
}

#total-putts-display .total-putts-suffix {
  display: inline-block;
  font-size: 1em;
  color: inherit;
}

#total-putts-display.total-putts-met .total-putts-suffix {
  display: none;
}
#total-putts-display.total-putts-met .total-putts-xx {
  color: orange;
  font-size: 2.5em;
}

/* Profile Page Cards */
.profile-card {
  background-color: var(--color-secondary-grey-dark);
  padding: 2rem;
  border-radius: 10px;
  margin-bottom: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  border: 1px solid rgba(80, 80, 80, 0.3);
}

.profile-card h3 {
  color: var(--color-accent-orange);
  margin-bottom: 1.25rem;
  font-size: 1.2rem;
  font-weight: 600;
}

/* Add spacing between cards */
.profile-form .profile-card + .profile-card {
  margin-top: 1.5rem;
}

.weather-stamp {
  font-size: 14px;
  color: dimgrey;
}

/* Center the CTA section and its buttons on the home page */
.cta-section {
  text-align: center;
  padding: 2rem 1rem;
  margin: 2rem 0;
}

.cta-section p {
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
  color: var(--text-color-primary);
}

.cta-buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.primary-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.secondary-actions {
  display: flex;
  justify-content: center;
}

.separator {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--text-color-secondary);
  font-size: 0.9rem;
  margin: 0.5rem 0;
}

.separator::before,
.separator::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid var(--color-secondary-grey-medium);
  margin: 0 1rem;
}

/* Button Styles */
.button {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  text-align: center;
  min-width: 120px;
}

.button.tertiary {
  background-color: var(--color-secondary-grey-dark);
  color: var(--color-text-inverted);
  border: 2px solid var(--color-secondary-grey-medium);
  padding: 0.75rem 2rem;
}

}

/* Responsive adjustments */
@media (max-width: 480px) {
  .primary-actions {
    flex-direction: column;
    width: 100%;
  }

  .primary-actions .button {
    width: 100%;
  }

  .button.tertiary {
    width: 100%;
  }
}

/* Fix for select dropdowns inside profile-card and button containers */
.profile-card,
.profile-card * {
  overflow: visible !important;
}

/* Center the profile page's bottom button and add more padding */
.profile-form .btn,
.profile-form .button {
  display: block;
  margin: 2rem auto 0 auto;
  padding: 1rem 2.5rem;
  text-align: center;
  font-size: 1.1rem;
}

/* Profile page: increase spacing between fields for mobile usability */
.profile-card input,
.profile-card select,
.profile-card label,
.profile-card small,
.profile-card textarea {
  margin-bottom: 1.1rem;
}

/* Add extra margin above ZIP Code label if .note is present */
.profile-card .note + label[for="zipcode"] {
  margin-top: 1.2rem;
  display: block;
}

@media (max-width: 600px) {
  .profile-card input,
  .profile-card select,
  .profile-card label,
  .profile-card small,
  .profile-card textarea {
    margin-bottom: 1.3rem;
  }
  .profile-card .note + label[for="zipcode"] {
    margin-top: 1.5rem;
  }
}

/* Grayed out style for disabled/read-only input fields */
input[disabled],
input[readonly],
select[disabled],
textarea[disabled] {
  background-color: #2a2a2a !important;
  color: #888 !important;
  border-color: #444 !important;
  cursor: not-allowed;
  opacity: 1;
}

.required {
  color: #ff6f00;
  font-weight: bold;
  margin-left: 0.18em;
  font-size: 1.1em;
  vertical-align: middle;
}

/* PDGA Rating Display */
.pdga-logo {
  display: block;
  margin: 40px auto 1.5rem;
  max-width: 200px;
  height: auto;
  filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.8));
}

.pdga-rating-display {
  margin: 0.5rem 0 1rem;
  padding: 0.75rem 1rem 1.25rem;
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  text-align: center;
}

.rating-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
}

.rating-value {
  font-size: 1.8rem;
  font-weight: 600;
  color: #ff6f00;
  margin-bottom: 12px;
}

.rating-change-date {
  font-size: 1rem;
  color: var(--text-color-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
}

.rating-change {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.95rem;
  font-weight: 500;
}

.rating-change.positive {
  background-color: rgba(76, 175, 80, 0.2);
  color: #4caf50;
}

.rating-change.negative {
  background-color: rgba(244, 67, 54, 0.2);
  color: #f44336;
}

.rating-error {
  color: #f44336;
  font-size: 0.9rem;
  font-style: italic;
}

/* PDGA Rating History Graph */
.rating-history-graph {
  margin-top: 1.5rem;
  padding: 1rem;
  background-color: var(--color-secondary-grey-dark);
  border-radius: 8px;
  border: 1px solid var(--color-secondary-grey-medium);
  height: 300px;
  position: relative;
}

.rating-history-graph canvas {
  width: 100% !important;
  height: 100% !important;
}

@media (max-width: 600px) {
  .rating-history-graph {
    height: 250px;
    padding: 0.75rem;
  }
}

/* Under Average Grid Layout */
.under-average-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  width: 100%;
  padding: 4px 0;
}

.under-average-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.under-average-item:last-child {
  border-bottom: none;
}

.under-average-item .target-label {
  color: var(--color-secondary-grey-medium);
  font-size: 0.9em;
  white-space: nowrap;
}

.under-average-item .target-value {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--color-accent-orange);
}

/* Game Card Component */
.game-card {
  background: var(--color-secondary-grey-dark);
  border-radius: 8px;
  margin-bottom: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.game-header {
  padding: 15px 20px;
}

.game-header h3 {
  margin: 0;
  color: var(--color-accent-orange);
  font-size: 18px;
  font-weight: 600;
}

.game-content {
  padding: 20px;
}

.game-content .form-group {
  margin-bottom: 20px;
}

.game-content .form-group:last-child {
  margin-bottom: 0;
}

/* Strike Control Component */
.strike-control {
  display: flex;
  gap: 40px;
  align-items: center;
  justify-content: space-between;
  margin: 15px 0;
  padding: 0 20px;
}

.strike-icon {
  font-size: 64px;
  color: #ccc;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 12px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.strike-icon:hover {
  color: #ff6b6b;
  background-color: #f8f9fa;
}

.strike-icon.active {
  color: #ffffff;
  background-color: #ff0000;
}

.strike-icon.disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.saves-control.disabled {
  opacity: 0.5;
  pointer-events: none;
}

.saves-control.disabled input,
.saves-control.disabled button {
  opacity: 0.5;
  cursor: not-allowed;
}
