/* Golf Medal Pro App Styles */

.logo-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  vertical-align: middle;
  margin-right: 6px;
}

/* Language Select */
.lang-select {
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-bg);
  font-size: 0.85rem;
  cursor: pointer;
  margin-left: 1rem;
}

.lang-select:focus {
  outline: none;
  border-color: var(--color-accent);
}

/* RTL Support */
[dir="rtl"] .logo-icon {
  margin-right: 0;
  margin-left: 6px;
}

[dir="rtl"] .nav a {
  margin-left: 0;
  margin-right: 1.5rem;
}

[dir="rtl"] .lang-select {
  margin-left: 0;
  margin-right: 1rem;
}

[dir="rtl"] .settings-group {
  flex-direction: row-reverse;
}

[dir="rtl"] .score-row {
  flex-direction: row-reverse;
}

[dir="rtl"] .hole-selector {
  flex-direction: row-reverse;
}

[dir="rtl"] .name-input-row {
  flex-direction: row-reverse;
}

[dir="rtl"] .player-select-btn {
  text-align: right;
}

[dir="rtl"] .scores-table th {
  text-align: right;
}

[dir="rtl"] .help-content ul,
[dir="rtl"] .help-content ol {
  padding-left: 0;
  padding-right: 1.25rem;
}

[dir="rtl"] .lang-switch {
  margin-left: 0;
  margin-right: 1rem;
}

/* App Section */
.app-section {
  margin-bottom: 2.5rem;
}

.app-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

/* Settings Bar */
.settings-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
}

.settings-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.settings-group label {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

.settings-group select {
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 0.875rem;
  background: var(--color-bg);
  cursor: pointer;
}

.btn-settings,
.btn-help {
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-bg);
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-settings:hover,
.btn-help:hover {
  background: #e8f5e9;
}

/* Hole Selector */
.hole-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.hole-nav {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--color-accent);
  background: transparent;
  color: var(--color-accent);
  font-size: 1.5rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.hole-nav:hover:not(:disabled) {
  background: var(--color-accent);
  color: #fff;
}

.hole-nav:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.hole-display {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.hole-label {
  font-size: 1rem;
  color: var(--color-text-muted);
}

.hole-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-accent);
}

.hole-total {
  font-size: 1rem;
  color: var(--color-text-muted);
}

/* Hole Jump */
.hole-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.hole-jump-btn {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  font-size: 0.7rem;
  cursor: pointer;
  transition: all 0.15s;
}

.hole-jump-btn:hover {
  background: #e8f5e9;
}

.hole-jump-btn.active {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}

.hole-jump-btn.has-score {
  background: #c8e6c9;
  border-color: #81c784;
}

.hole-jump-btn.has-score.active {
  background: var(--color-accent);
  color: #fff;
}

/* Medal Input Section */
.medal-input-section {
  margin-bottom: 1.5rem;
}

.medal-input-section h3 {
  font-size: 1rem;
  margin: 0 0 0.75rem;
  color: var(--color-text);
}

.medal-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.5rem;
}

.medal-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.75rem 0.5rem;
  border: 2px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.2s;
}

.medal-btn span {
  font-size: 0.85rem;
  font-weight: 600;
}

.medal-btn small {
  font-size: 0.7rem;
  opacity: 0.8;
}

.medal-btn.diamond {
  background: linear-gradient(135deg, #e3f2fd, #bbdefb);
  border-color: #90caf9;
  color: #1565c0;
}
.medal-btn.diamond:hover { transform: scale(1.03); box-shadow: 0 2px 8px rgba(21,101,192,0.2); }

.medal-btn.gold {
  background: linear-gradient(135deg, #fff8e1, #ffecb3);
  border-color: #ffd54f;
  color: #f57f17;
}
.medal-btn.gold:hover { transform: scale(1.03); box-shadow: 0 2px 8px rgba(245,127,23,0.2); }

.medal-btn.silver {
  background: linear-gradient(135deg, #f5f5f5, #e0e0e0);
  border-color: #bdbdbd;
  color: #424242;
}
.medal-btn.silver:hover { transform: scale(1.03); box-shadow: 0 2px 8px rgba(66,66,66,0.2); }

.medal-btn.bronze {
  background: linear-gradient(135deg, #fbe9e7, #ffccbc);
  border-color: #ff8a65;
  color: #bf360c;
}
.medal-btn.bronze:hover { transform: scale(1.03); box-shadow: 0 2px 8px rgba(191,54,12,0.2); }

.medal-btn.iron {
  background: linear-gradient(135deg, #efebe9, #d7ccc8);
  border-color: #a1887f;
  color: #4e342e;
}
.medal-btn.iron:hover { transform: scale(1.03); box-shadow: 0 2px 8px rgba(78,52,46,0.2); }

/* Current Hole Scores */
.current-hole-scores {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: #fafafa;
  border-radius: 8px;
}

.current-hole-scores h3 {
  font-size: 1rem;
  margin: 0 0 0.75rem;
  color: var(--color-text);
}

.score-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid #eee;
}

.score-row:last-of-type {
  border-bottom: none;
}

.score-player-name {
  font-weight: 500;
  font-size: 0.95rem;
}

.score-input {
  width: 48px;
  height: 36px;
  text-align: center;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 1.1rem;
  font-weight: 600;
}

.score-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px rgba(0,77,64,0.15);
}

.btn-clear-hole {
  margin-top: 0.75rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid #e57373;
  border-radius: 6px;
  background: #ffebee;
  color: #c62828;
  font-size: 0.8rem;
  cursor: pointer;
}

.btn-clear-hole:hover {
  background: #ffcdd2;
}

/* Total Scores */
.total-scores-section {
  margin-bottom: 1.5rem;
}

.total-scores-section h3 {
  font-size: 1rem;
  margin: 0 0 0.75rem;
  color: var(--color-text);
}

.scores-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.scores-table th {
  padding: 0.5rem;
  text-align: left;
  border-bottom: 2px solid var(--color-border);
  font-weight: 600;
  color: var(--color-text-muted);
  font-size: 0.8rem;
}

.scores-table td {
  padding: 0.5rem;
  border-bottom: 1px solid #eee;
}

.scores-table .rank-medal {
  font-size: 1.1rem;
}

.scores-table .result-positive {
  color: #c5a059;
  font-weight: 600;
}

.scores-table .result-negative {
  color: #b71c1c;
  font-weight: 600;
}

.scores-table .result-zero {
  color: var(--color-text);
}

/* Action Buttons */
.app-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-history {
  flex: 1;
  padding: 0.6rem 1rem;
  border: 1px solid var(--color-accent);
  border-radius: 8px;
  background: transparent;
  color: var(--color-accent);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-history:hover {
  background: var(--color-accent);
  color: #fff;
}

.btn-reset {
  padding: 0.6rem 1rem;
  border: 1px solid #e57373;
  border-radius: 8px;
  background: transparent;
  color: #c62828;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-reset:hover {
  background: #c62828;
  color: #fff;
}

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: #fff;
  border-radius: 12px;
  padding: 1.5rem;
  max-width: 400px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-content.modal-large {
  max-width: 600px;
}

.modal-content h3 {
  margin: 0 0 1rem;
  font-size: 1.2rem;
  color: var(--color-accent);
}

.modal-content h4 {
  margin: 1rem 0 0.5rem;
  font-size: 1rem;
}

.help-content p,
.help-content ul,
.help-content ol {
  margin: 0.5rem 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.help-content ul,
.help-content ol {
  padding-left: 1.25rem;
}

.help-content li {
  margin-bottom: 0.25rem;
}

/* Player Select */
.player-select-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 1rem 0;
}

.player-select-btn {
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-bg);
  font-size: 0.95rem;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
}

.player-select-btn:hover {
  background: #e8f5e9;
  border-color: var(--color-accent);
}

/* Names Input */
.name-input-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.name-input-row label {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  min-width: 24px;
}

.name-input-row input {
  flex: 1;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 0.9rem;
}

.name-input-row input:focus {
  outline: none;
  border-color: var(--color-accent);
}

/* Modal Buttons */
.btn-modal-close,
.btn-modal-cancel,
.btn-modal-confirm {
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  transition: opacity 0.2s;
}

.btn-modal-close {
  width: 100%;
  margin-top: 1rem;
  background: var(--color-accent);
  color: #fff;
}

.btn-modal-cancel {
  width: 100%;
  background: #eee;
  color: var(--color-text);
}

.btn-modal-confirm {
  background: var(--color-accent);
  color: #fff;
}

.btn-modal-close:hover,
.btn-modal-confirm:hover {
  opacity: 0.9;
}

.btn-modal-cancel:hover {
  background: #ddd;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.modal-actions .btn-modal-cancel {
  flex: 1;
  width: auto;
}

.modal-actions .btn-modal-confirm {
  flex: 1;
}

/* History Table */
.history-table-wrapper {
  overflow-x: auto;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  min-width: 400px;
}

.history-table th,
.history-table td {
  padding: 0.35rem 0.5rem;
  border: 1px solid #eee;
  text-align: center;
}

.history-table th {
  background: #f5f5f5;
  font-weight: 600;
  position: sticky;
  top: 0;
}

.history-table .no-data {
  color: #bbb;
}

/* Responsive */
@media (max-width: 600px) {
  .settings-bar {
    flex-direction: column;
    align-items: stretch;
  }
  
  .settings-bar > * {
    width: 100%;
  }
  
  .settings-group {
    justify-content: space-between;
  }
  
  .medal-buttons {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .hole-number {
    font-size: 2rem;
  }
  
  .nav {
    font-size: 0.85rem;
  }
  
  .nav a {
    margin-left: 0.75rem;
  }
}

@media (max-width: 400px) {
  .medal-buttons {
    grid-template-columns: 1fr;
  }
}

/* Install Banner */
.install-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid var(--color-border);
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
  z-index: 999;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.install-banner-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: var(--max-width);
  width: 100%;
}

.install-banner-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  flex-shrink: 0;
}

.install-banner-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.install-banner-text strong {
  font-size: 0.95rem;
}

.install-banner-text span {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.btn-install {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 8px;
  background: var(--color-accent);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}

.btn-install:hover {
  opacity: 0.9;
}

.btn-dismiss {
  padding: 0.25rem 0.5rem;
  border: none;
  background: transparent;
  font-size: 1.2rem;
  color: var(--color-text-muted);
  cursor: pointer;
  line-height: 1;
}

.btn-dismiss:hover {
  color: var(--color-text);
}

.ios-guide .install-banner-text span {
  font-size: 0.75rem;
}
