:root {
  --primary-color: #1a472a;
  /* Deep Tennis Green */
  --secondary-color: #e8602d;
  /* Clay Court Orange */
  --accent-color: #d4e157;
  /* Tennis Ball Yellow - subtle use */
  --text-dark: #1f2937;
  --text-light: #f9fafb;
  --background-light: #ffffff;
  --background-off-white: #f3f4f6;
  --font-main: 'Outfit', sans-serif;
  --transition-speed: 0.3s;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  color: var(--text-dark);
  line-height: 1.6;
  background-color: var(--background-light);
}

a {
  text-decoration: none;
  color: inherit;
  transition: color var(--transition-speed);
}

ul {
  list-style: none;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Header */
#main-header {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  z-index: 1000;
  box-shadow: var(--shadow-sm);
  padding: 1rem 0;
  transition: transform 0.3s ease;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  letter-spacing: -0.02em;
}

.highlight {
  color: var(--secondary-color);
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-links a:not(.btn-primary) {
  font-weight: 500;
  color: var(--text-dark);
}

.nav-links a:hover:not(.btn-primary) {
  color: var(--secondary-color);
}

/* Buttons */
.btn-primary {
  background-color: var(--secondary-color);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  font-weight: 600;
  transition: transform 0.2s, box-shadow 0.2s;
  border: none;
  cursor: pointer;
  display: inline-block;
}

.btn-primary:hover {
  background-color: #d65223;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background-color: transparent;
  color: white;
  border: 2px solid white;
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background-color: white;
  color: var(--primary-color);
}

/* Hero Section */
#hero {
  height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  color: white;
  background-color: var(--primary-color);
  /* Fallback */
}

.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(26, 71, 42, 0.9) 0%, rgba(26, 71, 42, 0.7) 100%), url('https://images.unsplash.com/photo-1595435934249-5df7ed86e1c0?q=80&w=2942&auto=format&fit=crop') center/cover no-repeat;
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  animation: fadeIn Up 1s ease-out;
}

#hero h1 {
  font-size: 3.5rem;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  font-weight: 700;
}

.text-gradient {
  background: linear-gradient(to right, #ffffff, #e0e0e0);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

#hero p {
  font-size: 1.25rem;
  margin-bottom: 2.5rem;
  opacity: 0.9;
  max-width: 600px;
}

.hero-actions {
  display: flex;
  gap: 1rem;
}

/* Services */
#services {
  padding: 6rem 2rem;
  background-color: var(--background-off-white);
}

#services h2,
#contact h2 {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 3rem;
  color: var(--primary-color);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.service-card {
  background: white;
  padding: 2.5rem;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s, box-shadow 0.3s;
  border-top: 4px solid var(--secondary-color);
}

.service-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.service-card h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
}

/* Contact */
#contact {
  padding: 6rem 2rem;
}

#contact-form {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

input,
select,
textarea {
  padding: 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.2s;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(26, 71, 42, 0.1);
}

/* Footer */
footer {
  background-color: var(--primary-color);
  color: white;
  padding: 3rem 0;
  text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
  #hero h1 {
    font-size: 2.5rem;
  }

  .nav-links {
    display: none;
    /* Mobile menu implementation needed later if requested */
  }
}

/* Tab System */
.page-tab {
  animation: fadeIn 0.4s ease-in-out;
  padding-top: 6rem; /* Account for fixed header on new pages */
  min-height: 80vh;
}

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

#tab-main.page-tab {
  padding-top: 0; /* Hero section handles its own padding */
}

.nav-tab.active {
  color: var(--secondary-color);
  font-weight: 700;
  position: relative;
}

.nav-tab.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--secondary-color);
  border-radius: 2px;
}

/* Shared Page Styles */
.page-tab > h2 {
  text-align: center;
  font-size: 3rem;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.page-tab > .subtitle {
  text-align: center;
  font-size: 1.25rem;
  color: #6b7280;
  margin-bottom: 4rem;
}

/* Connections Page */
.connections-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  padding-bottom: 4rem;
}

.connection-card {
  background: white;
  padding: 2rem;
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  border: 1px solid #f3f4f6;
  transition: transform 0.3s, box-shadow 0.3s;
}

.connection-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.player-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  border-bottom: 2px solid #f3f4f6;
  padding-bottom: 1rem;
}

.player-info h3 {
  font-size: 1.5rem;
  color: var(--primary-color);
}

.ntrp-badge {
  background-color: var(--primary-color);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
}

.connection-card p {
  margin-bottom: 0.75rem;
}

.connection-card .btn-secondary {
  color: var(--primary-color);
  border-color: var(--primary-color);
  width: 100%;
  margin-top: 1rem;
  text-align: center;
}
.connection-card .btn-secondary:hover {
  background-color: var(--primary-color);
  color: white;
}

/* Advice / Blog Page */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2.5rem;
  padding-bottom: 4rem;
}

.blog-card {
  background: white;
  border-radius: 16px;
  padding: 2.5rem;
  box-shadow: var(--shadow-md);
  border-top: 4px solid var(--accent-color);
  transition: transform 0.3s;
  display: flex;
  flex-direction: column;
}

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

.blog-card h3 {
  font-size: 1.5rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
  line-height: 1.3;
}

.blog-card p {
  color: #4b5563;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.read-more {
  color: var(--secondary-color);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
}

.read-more:hover {
  text-decoration: underline;
}

/* Community Forums Page */
.forums-container {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  padding-bottom: 4rem;
  max-width: 900px;
  margin: 0 auto;
}

.forum-category {
  background: white;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.forum-category h3 {
  background-color: var(--primary-color);
  color: white;
  padding: 1.25rem 2rem;
  font-size: 1.25rem;
}

.thread-list {
  display: flex;
  flex-direction: column;
}

.thread-list li {
  padding: 1.25rem 2rem;
  border-bottom: 1px solid #f3f4f6;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 0.2s;
  cursor: pointer;
}

.thread-list li:hover {
  background-color: #f9fafb;
}

.thread-list li:last-child {
  border-bottom: none;
}

.thread-title {
  font-weight: 600;
  color: var(--text-dark);
}

.thread-meta {
  font-size: 0.875rem;
  color: #6b7280;
  background: #f3f4f6;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
}

/* Lessons Page */
.lessons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  padding-bottom: 4rem;
}

.coach-card {
  background: white;
  padding: 2rem;
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  border: 1px solid #e5e7eb;
  position: relative;
  overflow: hidden;
}

.coach-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 6px;
  background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
}

.coach-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.coach-header h3 {
  font-size: 1.5rem;
  color: var(--primary-color);
}

.rate {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--secondary-color);
}

.coach-card p {
  margin-bottom: 0.75rem;
}

.coach-card .bio {
  color: #6b7280;
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  font-style: italic;
}

.coach-card .btn-primary {
  width: 100%;
  text-align: center;
}

/* Shipping Estimator */
#shipping-estimator {
  padding: 4rem 2rem;
  background-color: var(--background-light);
  display: flex;
  justify-content: center;
}

.estimator-card {
  background: white;
  padding: 2.5rem;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  border: 1px solid #e5e7eb;
  text-align: center;
  max-width: 600px;
  width: 100%;
}

.estimator-card h2 {
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.estimator-card p {
  margin-bottom: 2rem;
  color: #4b5563;
}

.estimator-form {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}

#shipping-zip {
  width: 150px;
  text-align: center;
  font-size: 1.1rem;
  letter-spacing: 1px;
}

.shipping-result {
  min-height: 1.5rem;
  font-weight: 600;
  font-size: 1.1rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.shipping-result.success {
  color: var(--primary-color);
}


.shipping-result.error {
  color: var(--secondary-color);
}

/* Chatbot "Ace" Styles */
#chatbot-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 2000;
  font-family: var(--font-main);
}

/* FAB */
#chatbot-fab {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: transform 0.3s;
  padding: 0;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

#chatbot-fab:hover {
  transform: scale(1.1) rotate(10deg);
}

/* Pure CSS Tennis Ball */
.tennis-ball-icon {
  width: 100%;
  height: 100%;
  background-color: #d4e157;
  /* Tennis Ball Green */
  border-radius: 50%;
  position: relative;
  overflow: hidden;
  border: 2px solid #aebf2e;
}

.tennis-ball-icon .curve {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 4px solid white;
  border-radius: 50%;
  box-sizing: border-box;
}

.tennis-ball-icon .curve.top {
  top: -65%;
}

.tennis-ball-icon .curve.bottom {
  bottom: -65%;
}

/* Ace's Face */
.eyes {
  position: absolute;
  top: 35%;
  left: 20%;
  width: 60%;
  display: flex;
  justify-content: space-between;
  z-index: 2;
}

.eye {
  width: 8px;
  height: 8px;
  background: #333;
  border-radius: 50%;
  animation: blink 3s infinite;
}

.smile {
  position: absolute;
  bottom: 25%;
  left: 30%;
  width: 40%;
  height: 10px;
  border-bottom: 3px solid #333;
  border-radius: 50%;
}

@keyframes blink {

  0%,
  100% {
    transform: scaleY(1);
  }

  95% {
    transform: scaleY(1);
  }

  97% {
    transform: scaleY(0.1);
  }
}

/* Chat Window */
#chat-window {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 320px;
  height: 450px;
  background: white;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform-origin: bottom right;
  transition: transform 0.3s ease, opacity 0.3s ease;
  border: 1px solid #e5e7eb;
}

#chat-window.hidden {
  transform: scale(0);
  opacity: 0;
  pointer-events: none;
}

.chat-header {
  background: var(--primary-color);
  color: white;
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}

.avatar-small {
  width: 24px;
  height: 24px;
  background-color: #d4e157;
  border-radius: 50%;
  border: 2px solid white;
}

#close-chat {
  margin-left: auto;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

#chat-messages {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  background-color: #f9fafb;
}

.message {
  max-width: 80%;
  padding: 0.8rem;
  border-radius: 12px;
  font-size: 0.95rem;
  line-height: 1.4;
}

.message.bot {
  align-self: flex-start;
  background-color: white;
  border: 1px solid #e5e7eb;
  border-bottom-left-radius: 2px;
}

.message.user {
  align-self: flex-end;
  background-color: var(--secondary-color);
  color: white;
  border-bottom-right-radius: 2px;
}

.chat-input-area {
  padding: 1rem;
  border-top: 1px solid #e5e7eb;
  display: flex;
  gap: 0.5rem;
  background: white;
}

#chat-input {
  flex: 1;
  padding: 0.6rem;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  outline: none;
}

#chat-input:focus {
  border-color: var(--primary-color);
}

#send-chat {
  background: var(--primary-color);
  color: white;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

#send-chat:hover {
  background-color: #143620;
}