/* ==========================================================================
   TeacherVilla Main Stylesheet
   ========================================================================== */

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --secondary: #0f172a;
  --accent: #16a34a;
  --accent-hover: #15803d;
  --gold: #f59e0b;
  --slate-bg: #f8fafc;
  --border-color: #e2e8f0;
  --text-dark: #1e293b;
  --text-muted: #64748b;
  --white: #ffffff;
  --radius: 8px;
  --shadow-sm: 0 1px 3px 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 25px -5px rgba(0, 0, 0, 0.15);
}

/* Reset & Global */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-dark);
  background-color: var(--slate-bg);
  line-height: 1.5;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

a {
  text-decoration: none;
  color: inherit;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: 1rem;
}

.bg-white { background-color: var(--white); }
.bg-slate { background-color: #f1f5f9; }
.text-accent { color: var(--accent); }
.icon-gold { color: var(--gold); }

.section-padding {
  padding: 4rem 0;
}

.section-header {
  margin-bottom: 2.5rem;
}

.section-header.center { text-align: center; }

.section-header h2 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--secondary);
}

.section-header p {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-top: 0.25rem;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Announcement Top Bar */
.top-announcement {
  background: var(--secondary);
  color: #94a3b8;
  font-size: 0.875rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid #1e293b;
}

.top-bar-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.top-announcement span {
  color: var(--white);
}

.top-links {
  display: flex;
  gap: 1.25rem;
}

.top-links a:hover {
  color: var(--white);
}

/* Header & Navigation */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 900;
}

.header-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.brand-area {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-dark);
  cursor: pointer;
}

.brand-logo {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.5px;
}

.logo-accent {
  color: var(--secondary);
}

.main-nav {
  display: flex;
  gap: 1.5rem;
}

.nav-item {
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.5rem 0.25rem;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-item:hover, .nav-item.active {
  color: var(--primary);
}

.auth-buttons {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--white);
}
.btn-primary:hover { background-color: var(--primary-hover); }

.btn-outline {
  background: transparent;
  border-color: var(--border-color);
  color: var(--text-dark);
}
.btn-outline:hover { background-color: #f1f5f9; }

.btn-accent {
  background-color: var(--accent);
  color: var(--white);
}
.btn-accent:hover { background-color: var(--accent-hover); }

.btn-full { width: 100%; }

/* Hero Section */
.hero-section {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: var(--white);
  padding: 4.5rem 0 5.5rem;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.35rem 1rem;
  border-radius: 50px;
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.hero-section h1 {
  font-size: 2.75rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: #94a3b8;
  max-width: 700px;
  margin: 0 auto 2.5rem;
}

/* Search Box Card */
.search-card {
  background: var(--white);
  border-radius: 12px;
  padding: 1.25rem;
  max-width: 900px;
  margin: 0 auto;
  box-shadow: var(--shadow-lg);
  color: var(--text-dark);
}

.search-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
}

.tab-btn {
  background: none;
  border: none;
  padding: 0.5rem 1rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tab-btn.active {
  background: #eff6ff;
  color: var(--primary);
}

.search-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.input-wrap {
  flex: 1;
  min-width: 220px;
  display: flex;
  align-items: center;
  background: var(--slate-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 0 1rem;
}

.input-wrap i {
  color: var(--text-muted);
  margin-right: 0.6rem;
}

.input-wrap input {
  width: 100%;
  padding: 0.75rem 0;
  border: none;
  outline: none;
  background: transparent;
}

.btn-search {
  background: var(--accent);
  color: var(--white);
  padding: 0.75rem 1.75rem;
}
.btn-search:hover { background: var(--accent-hover); }

.quick-tags {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.quick-tags button {
  background: #f1f5f9;
  border: none;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.8rem;
  cursor: pointer;
  color: var(--text-dark);
}
.quick-tags button:hover { background: #e2e8f0; }

/* Category Cards */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1.25rem;
}

.cat-card {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.cat-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-size: 1.4rem;
}

.icon-blue { background: #dbeafe; color: #2563eb; }
.icon-purple { background: #f3e8ff; color: #9333ea; }
.icon-green { background: #dcfce7; color: #16a34a; }
.icon-amber { background: #fef3c7; color: #d97706; }
.icon-red { background: #fee2e2; color: #dc2626; }
.icon-teal { background: #ccfbf1; color: #0d9488; }

.cat-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.cat-card p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Tutors Grid & Card */
.tutors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.5rem;
}

.tutor-card {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}

.tutor-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.tutor-header {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.tutor-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
}

.tutor-info h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.tutor-location {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.badge-mode {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: #e2e8f0;
  margin-top: 0.4rem;
}

.badge-mode.online { background: #dcfce7; color: #15803d; }
.badge-mode.home { background: #dbeafe; color: #1d4ed8; }

.tutor-body {
  flex: 1;
  margin-bottom: 1.25rem;
}

.tutor-headline {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  color: #334155;
}

.subjects-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.sub-tag {
  background: #f1f5f9;
  color: var(--secondary);
  font-size: 0.8rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-weight: 500;
}

.tutor-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-color);
  padding-top: 0.75rem;
}

.tutor-rate {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--accent);
}

.tutor-exp {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Jobs Feed Section */
.jobs-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.job-card {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  transition: border-color 0.2s;
}

.job-card:hover {
  border-color: var(--primary);
}

.job-details h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.job-tags-inline {
  display: flex;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.job-desc {
  font-size: 0.9rem;
  color: #475569;
}

.job-action {
  text-align: right;
  min-width: 140px;
}

.job-budget {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--secondary);
  margin-bottom: 0.5rem;
}

/* Coin System Cards */
.coin-steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.coin-step-card {
  background: var(--white);
  padding: 2rem 1.5rem;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  position: relative;
}

.step-num {
  width: 36px;
  height: 36px;
  background: var(--primary);
  color: var(--white);
  border-radius: 50%;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.coin-step-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.coin-step-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Footer */
.site-footer {
  background: var(--secondary);
  color: #94a3b8;
  padding-top: 4rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 2rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid #1e293b;
}

.footer-logo { color: var(--white); }

.brand-col p {
  margin-top: 1rem;
  font-size: 0.9rem;
  max-width: 320px;
}

.footer-col h4 {
  color: var(--white);
  font-size: 1rem;
  margin-bottom: 1.25rem;
}

.footer-col ul { list-style: none; }

.footer-col ul li { margin-bottom: 0.6rem; }

.footer-col ul li a {
  font-size: 0.9rem;
  transition: color 0.2s;
}

.footer-col ul li a:hover { color: var(--white); }

.footer-bottom { padding: 1.5rem 0; }

.bottom-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.social-links {
  display: flex;
  gap: 1rem;
}

.social-links a {
  font-size: 1.1rem;
  color: #94a3b8;
}

.social-links a:hover { color: var(--white); }

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  padding: 1rem;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--white);
  border-radius: 12px;
  width: 100%;
  max-width: 440px;
  padding: 2rem;
  position: relative;
  box-shadow: var(--shadow-lg);
}

.modal-card.modal-lg {
  max-width: 650px;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  background: none;
  border: none;
  font-size: 1.75rem;
  color: var(--text-muted);
  cursor: pointer;
}

.modal-header {
  margin-bottom: 1.5rem;
}

.modal-header h3 {
  font-size: 1.4rem;
  font-weight: 800;
}

.modal-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  outline: none;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--primary);
}

.form-row {
  display: flex;
  gap: 1rem;
}

.form-row .form-group { flex: 1; }

.modal-footer {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.modal-footer a {
  color: var(--primary);
  font-weight: 600;
  margin-left: 0.3rem;
}

/* Coin Unlock Box */
.coin-unlock-box {
  background: var(--slate-bg);
  border: 1px dashed var(--border-color);
  padding: 1.25rem;
  border-radius: var(--radius);
  text-align: center;
  margin-bottom: 1.5rem;
}

.coin-cost {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.unlock-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
  .mobile-toggle { display: block; }

  .main-nav {
    display: none;
    position: absolute;
    top: 70px;
    left: 0;
    width: 100%;
    background: var(--white);
    flex-direction: column;
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow-md);
    border-bottom: 1px solid var(--border-color);
  }

  .main-nav.show { display: flex; }

  .hero-section h1 { font-size: 2rem; }

  .job-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .job-action {
    width: 100%;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--border-color);
    padding-top: 0.75rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }
}