/* BoatShare - Nautical Theme */
@import url('https://fonts.googleapis.com/css2?family=Crimson+Text:wght@400;600;700&family=Inter:wght@300;400;500;600&display=swap');

:root {
  --bg: #0a1628;
  --bg2: #0d1f3c;
  --card: #1a2f4a;
  --card2: #1e3a5f;
  --accent: #4fc3f7;
  --accent2: #00bcd4;
  --gold: #ffd700;
  --text: #e8f4f8;
  --muted: #90caf9;
  --border: #1e3a5f;
  --success: #4caf50;
  --danger: #ef5350;
  --warning: #ff9800;
  --radius: 10px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
}

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

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── Navbar ── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  height: 64px;
  background: rgba(10, 22, 40, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.navbar .logo {
  font-family: 'Crimson Text', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}

.navbar .search-bar {
  flex: 1;
  max-width: 480px;
  position: relative;
}

.navbar .search-bar input {
  width: 100%;
  padding: 8px 16px 8px 40px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.navbar .search-bar input:focus { border-color: var(--accent); }
.navbar .search-bar .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}

.navbar .nav-links {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.navbar .nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 6px 12px;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}

.navbar .nav-links a:hover { color: var(--text); background: var(--card); }
.navbar .nav-links .btn-nav { color: var(--accent); border: 1px solid var(--accent); }
.navbar .nav-links .btn-nav:hover { background: var(--accent); color: var(--bg); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  color: var(--bg);
  font-weight: 600;
}
.btn-primary:hover { filter: brightness(1.1); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(79,195,247,0.3); }

.btn-secondary {
  background: var(--card2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { filter: brightness(0.9); }

.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--muted); }

.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-full { width: 100%; justify-content: center; }

/* ── Hero ── */
.hero {
  position: relative;
  padding: 80px 24px;
  background: linear-gradient(135deg, var(--bg2) 0%, #0c2040 50%, var(--bg) 100%);
  text-align: center;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent2), var(--accent), var(--accent2));
}

.hero h1 {
  font-family: 'Crimson Text', serif;
  font-size: clamp(2rem, 5vw, 3.5rem);
  color: var(--text);
  margin-bottom: 12px;
}

.hero p { color: var(--muted); font-size: 1.1rem; }

/* ── Layout ── */
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.page { padding: 32px 24px; max-width: 1280px; margin: 0 auto; }

.layout-with-sidebar {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
}

/* ── Sidebar / Filters ── */
.sidebar {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border);
  height: fit-content;
  position: sticky;
  top: 80px;
}

.sidebar h3 {
  font-family: 'Crimson Text', serif;
  font-size: 1.1rem;
  color: var(--accent);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.filter-group { margin-bottom: 20px; }
.filter-group label { display: block; font-size: 0.8rem; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }

/* ── Cards ── */
.card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }

.boat-card { cursor: pointer; }
.boat-card .boat-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: linear-gradient(135deg, var(--bg2) 0%, var(--card2) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}

.boat-card .boat-img img { width: 100%; height: 100%; object-fit: cover; }
.boat-card .card-body { padding: 16px; }
.boat-card .card-title { font-size: 1rem; font-weight: 600; margin-bottom: 4px; }
.boat-card .card-location { font-size: 0.85rem; color: var(--muted); margin-bottom: 8px; }
.boat-card .card-meta { display: flex; justify-content: space-between; align-items: center; }
.boat-card .price { color: var(--accent); font-weight: 600; font-size: 0.95rem; }
.boat-card .capacity { color: var(--muted); font-size: 0.8rem; }

/* ── Grid ── */
.boats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

/* ── Stars ── */
.stars { color: var(--gold); font-size: 0.85rem; }
.stars .empty { color: var(--border); }
.rating-row { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.rating-count { color: var(--muted); font-size: 0.8rem; }

/* ── Inputs ── */
input, textarea, select {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 10px 14px;
  font-size: 0.9rem;
  font-family: 'Inter', sans-serif;
  width: 100%;
  outline: none;
  transition: border-color 0.2s;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
input::placeholder, textarea::placeholder { color: var(--muted); }
select option { background: var(--bg2); }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 6px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ── Badges ── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-success { background: rgba(76,175,80,0.2); color: var(--success); border: 1px solid var(--success); }
.badge-danger { background: rgba(239,83,80,0.2); color: var(--danger); border: 1px solid var(--danger); }
.badge-info { background: rgba(79,195,247,0.2); color: var(--accent); border: 1px solid var(--accent); }
.badge-muted { background: rgba(144,202,249,0.1); color: var(--muted); border: 1px solid var(--border); }

/* ── Modal ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 32px;
  max-width: 540px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}
.modal h2 { font-family: 'Crimson Text', serif; color: var(--accent); margin-bottom: 20px; }
.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  background: none; border: none;
  color: var(--muted); font-size: 1.2rem;
  cursor: pointer;
}
.modal-close:hover { color: var(--text); }

/* ── Tabs ── */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.tab-btn {
  padding: 12px 20px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Chat ── */
.chat-panel {
  display: flex;
  flex-direction: column;
  height: 400px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.msg-bubble {
  max-width: 70%;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 0.85rem;
}
.msg-bubble.sent {
  align-self: flex-end;
  background: var(--accent2);
  color: var(--bg);
}
.msg-bubble.received {
  align-self: flex-start;
  background: var(--card2);
  color: var(--text);
}
.msg-bubble .msg-name { font-size: 0.75rem; opacity: 0.7; margin-bottom: 2px; }
.chat-input-row {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border);
  background: var(--bg2);
}
.chat-input-row input { flex: 1; margin: 0; }

/* ── Alert ── */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}
.alert-error { background: rgba(239,83,80,0.15); border: 1px solid var(--danger); color: #ff8a80; }
.alert-success { background: rgba(76,175,80,0.15); border: 1px solid var(--success); color: #a5d6a7; }
.alert-info { background: rgba(79,195,247,0.15); border: 1px solid var(--accent); color: var(--accent); }

/* ── Boat Detail ── */
.boat-hero {
  position: relative;
  height: 400px;
  background: linear-gradient(135deg, var(--bg2), var(--card2));
  overflow: hidden;
}
.boat-hero img { width: 100%; height: 100%; object-fit: cover; }
.boat-hero-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 6rem;
  background: linear-gradient(135deg, var(--bg2) 0%, var(--card2) 50%, var(--bg) 100%);
}
.boat-hero-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 24px;
  background: linear-gradient(transparent, rgba(10,22,40,0.9));
}
.boat-hero-overlay h1 { font-family: 'Crimson Text', serif; font-size: 2rem; }
.boat-hero-overlay .location { color: var(--muted); }

.boat-detail-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
}

.booking-card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 24px;
  position: sticky;
  top: 80px;
  height: fit-content;
}
.booking-card .price-big { font-size: 1.5rem; font-weight: 700; color: var(--accent); margin-bottom: 16px; }
.booking-card .price-big span { font-size: 0.85rem; color: var(--muted); font-weight: 400; }

.price-breakdown { background: var(--bg2); padding: 12px; border-radius: 8px; margin: 12px 0; font-size: 0.85rem; }
.price-breakdown .row { display: flex; justify-content: space-between; padding: 4px 0; color: var(--muted); }
.price-breakdown .row.total { color: var(--text); font-weight: 600; border-top: 1px solid var(--border); margin-top: 8px; padding-top: 8px; }

/* ── Map ── */
#map, #map-full { border-radius: var(--radius); border: 1px solid var(--border); }

/* ── Section ── */
.section { margin-bottom: 32px; }
.section h2 { font-family: 'Crimson Text', serif; font-size: 1.4rem; color: var(--accent); margin-bottom: 16px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }

/* ── Review card ── */
.review-card { padding: 16px; border-bottom: 1px solid var(--border); }
.review-card:last-child { border-bottom: none; }
.review-card .reviewer { font-weight: 600; margin-bottom: 4px; }
.review-card .review-date { font-size: 0.78rem; color: var(--muted); margin-bottom: 6px; }
.review-card .comment { font-size: 0.9rem; color: var(--muted); }

/* ── Earnings chart ── */
.bar-chart { display: flex; align-items: flex-end; gap: 8px; height: 120px; margin-top: 12px; }
.bar { flex: 1; background: linear-gradient(to top, var(--accent2), var(--accent)); border-radius: 4px 4px 0 0; min-height: 4px; transition: height 0.5s; }
.bar-labels { display: flex; gap: 8px; margin-top: 6px; }
.bar-label { flex: 1; text-align: center; font-size: 0.7rem; color: var(--muted); }

/* ── Table ── */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.data-table th { color: var(--muted); text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-weight: 500; text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.5px; }
.data-table td { padding: 10px 12px; border-bottom: 1px solid rgba(30,58,95,0.5); }
.data-table tr:hover td { background: rgba(79,195,247,0.03); }

/* ── Auth pages ── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, #0d2040 0%, var(--bg) 70%);
}
.auth-card {
  background: var(--card);
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 40px;
  width: 100%;
  max-width: 420px;
}
.auth-card .logo { text-align: center; font-family: 'Crimson Text', serif; font-size: 2rem; color: var(--accent); margin-bottom: 8px; }
.auth-card h1 { text-align: center; font-size: 1.2rem; color: var(--muted); font-weight: 400; margin-bottom: 32px; }

.role-toggle { display: flex; gap: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin-bottom: 16px; }
.role-toggle label { flex: 1; text-align: center; padding: 10px; cursor: pointer; font-size: 0.9rem; transition: all 0.2s; }
.role-toggle input[type="radio"] { display: none; }
.role-toggle input:checked + label { background: var(--accent); color: var(--bg); font-weight: 600; }

/* ── Leaflet override ── */
.leaflet-container { background: var(--bg2) !important; }
.leaflet-popup-content-wrapper { background: var(--card) !important; border: 1px solid var(--border) !important; color: var(--text) !important; }
.leaflet-popup-tip { background: var(--card) !important; }

/* ── Divider ── */
.divider { border: none; border-top: 1px solid var(--border); margin: 24px 0; }

/* ── Loading ── */
.loading { text-align: center; padding: 48px; color: var(--muted); }
.loading i { font-size: 2rem; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Dashboard page ── */
.dashboard-header {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 24px;
}
.dashboard-header h1 { font-family: 'Crimson Text', serif; font-size: 1.8rem; }
.dashboard-header p { color: var(--muted); margin-top: 4px; }

.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 32px; }
.stat-card { background: var(--card); border-radius: var(--radius); padding: 20px; border: 1px solid var(--border); }
.stat-card .stat-value { font-size: 1.8rem; font-weight: 700; color: var(--accent); }
.stat-card .stat-label { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 4px; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .boat-detail-layout { grid-template-columns: 1fr; }
  .booking-card { position: static; }
  .layout-with-sidebar { grid-template-columns: 1fr; }
  .sidebar { position: static; }
}

@media (max-width: 768px) {
  .navbar .search-bar { display: none; }
  .boats-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
  .form-row { grid-template-columns: 1fr; }
  .hero { padding: 48px 16px; }
  .tabs { overflow-x: auto; }
  .tab-btn { white-space: nowrap; }
}

@media (max-width: 480px) {
  .boats-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 24px 16px; }
  .modal { padding: 20px 16px; }
}
