/* ============================================================
   GearPool Design System
   Extends the landing page palette across all app pages
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=DM+Sans:wght@400;500;600&display=swap');

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

:root {
  --green-dark: #1a3a2a;
  --green-mid: #2d6a4f;
  --green-light: #52b788;
  --green-glow: #95d5b2;
  --cream: #faf8f5;
  --sand: #e8e0d4;
  --charcoal: #1a1a1a;
  --warm-gray: #6b6560;
  --white: #ffffff;
  --red: #e74c3c;
  --red-light: #ffeaea;
  --yellow: #f39c12;
  --yellow-light: #fff8e1;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(26,58,42,0.08);
  --shadow-lg: 0 12px 40px rgba(26,58,42,0.12);
  --transition: all 0.2s ease;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--cream);
  color: var(--charcoal);
  overflow-x: hidden;
  min-height: 100vh;
}

/* ---- Typography ---- */
h1, h2, h3, h4 {
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: -0.5px;
  color: var(--green-dark);
}

h1 { font-size: 2.2rem; font-weight: 700; }
h2 { font-size: 1.8rem; font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 600; }
a { color: var(--green-mid); text-decoration: none; }
a:hover { color: var(--green-light); }

/* ---- App Nav ---- */
.app-nav {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 100;
  padding: 0.9rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(250, 248, 245, 0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

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

.nav-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--green-dark);
  letter-spacing: -0.5px;
  text-decoration: none;
}
.nav-logo span { color: var(--green-light); }

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

.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--warm-gray);
  transition: var(--transition);
  padding: 0.3rem 0;
}
.nav-links a:hover { color: var(--green-dark); }
.nav-links a.active { color: var(--green-dark); border-bottom: 2px solid var(--green-light); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-user {
  font-size: 0.85rem;
  color: var(--warm-gray);
  font-weight: 500;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.4rem;
  border-radius: 100px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--green-dark);
  color: var(--white);
}
.btn-primary:hover { background: var(--green-mid); color: var(--white); }

.btn-secondary {
  background: rgba(82, 183, 136, 0.12);
  color: var(--green-mid);
  border: 1px solid rgba(82, 183, 136, 0.25);
}
.btn-secondary:hover { background: rgba(82, 183, 136, 0.2); color: var(--green-mid); }

.btn-ghost {
  background: transparent;
  color: var(--warm-gray);
}
.btn-ghost:hover { color: var(--green-dark); background: var(--sand); }

.btn-success {
  background: var(--green-light);
  color: var(--white);
}
.btn-success:hover { background: var(--green-mid); color: var(--white); }

.btn-danger {
  background: transparent;
  color: var(--red);
  border: 1px solid rgba(231, 76, 60, 0.25);
}
.btn-danger:hover { background: var(--red-light); color: var(--red); }

.btn-sm {
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 0.8rem 2rem;
  font-size: 1rem;
}

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

/* ---- Layout ---- */
.page-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 5.5rem 2rem 3rem;
  min-height: 100vh;
}

.page-header {
  margin-bottom: 2rem;
}

.page-header h1 {
  margin-bottom: 0.5rem;
}

.page-header p {
  color: var(--warm-gray);
  font-size: 1rem;
  line-height: 1.5;
}

/* ---- Cards ---- */
.card {
  background: var(--white);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(82, 183, 136, 0.2);
}

.card-body {
  padding: 1.25rem;
}

/* ---- Listing Cards ---- */
.listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.listing-card {
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}

.listing-card:hover { color: inherit; }

.listing-card .card-image {
  width: 100%;
  height: 200px;
  background: var(--sand);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.listing-card .card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.listing-card .card-image .placeholder-icon {
  font-size: 3rem;
  opacity: 0.4;
}

.listing-card .card-body h3 {
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
  color: var(--green-dark);
  line-height: 1.3;
}

.listing-card .card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.75rem;
}

.listing-price {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--green-dark);
}

.listing-price small {
  font-weight: 400;
  font-size: 0.8rem;
  color: var(--warm-gray);
}

.listing-owner {
  font-size: 0.8rem;
  color: var(--warm-gray);
}

/* ---- Category Badge ---- */
.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 100px;
  background: rgba(82, 183, 136, 0.12);
  color: var(--green-mid);
}

.badge-pending { background: var(--yellow-light); color: var(--yellow); }
.badge-approved { background: rgba(82, 183, 136, 0.12); color: var(--green-mid); }
.badge-declined { background: var(--red-light); color: var(--red); }

/* ---- Forms ---- */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--green-dark);
  margin-bottom: 0.4rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--sand);
  border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  color: var(--charcoal);
  background: var(--white);
  transition: var(--transition);
  outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--green-light);
  box-shadow: 0 0 0 3px rgba(82, 183, 136, 0.15);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

.form-group .hint {
  font-size: 0.8rem;
  color: var(--warm-gray);
  margin-top: 0.3rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* ---- Filter Bar ---- */
.filter-bar {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 2rem;
}

.filter-bar .search-input {
  flex: 1;
  min-width: 200px;
  padding: 0.65rem 1rem 0.65rem 2.5rem;
  border: 1px solid var(--sand);
  border-radius: 100px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b6560' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E") no-repeat 0.85rem center;
  outline: none;
  transition: var(--transition);
}

.filter-bar .search-input:focus {
  border-color: var(--green-light);
  box-shadow: 0 0 0 3px rgba(82, 183, 136, 0.12);
}

.filter-pill {
  padding: 0.5rem 1rem;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid var(--sand);
  background: var(--white);
  color: var(--warm-gray);
  cursor: pointer;
  transition: var(--transition);
  font-family: 'DM Sans', sans-serif;
}

.filter-pill:hover {
  border-color: var(--green-light);
  color: var(--green-mid);
}

.filter-pill.active {
  background: var(--green-dark);
  color: var(--white);
  border-color: var(--green-dark);
}

/* ---- Image Upload ---- */
.image-upload-area {
  border: 2px dashed var(--sand);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--white);
}

.image-upload-area:hover {
  border-color: var(--green-light);
  background: rgba(82, 183, 136, 0.04);
}

.image-upload-area .upload-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  opacity: 0.5;
}

.image-upload-area p {
  color: var(--warm-gray);
  font-size: 0.9rem;
}

.image-preview-grid {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.image-preview {
  width: 100px;
  height: 100px;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  border: 1px solid var(--sand);
}

.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-preview .remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ---- Detail Page ---- */
.detail-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2.5rem;
  align-items: start;
}

.detail-gallery {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--sand);
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
}

.detail-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-gallery .placeholder-icon {
  font-size: 5rem;
  opacity: 0.3;
}

.detail-info h1 {
  margin-bottom: 0.5rem;
}

.detail-price {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 1rem;
}

.detail-price small {
  font-weight: 400;
  font-size: 1rem;
  color: var(--warm-gray);
}

.detail-meta {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.detail-meta-item {
  font-size: 0.9rem;
  color: var(--warm-gray);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.detail-description {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--charcoal);
  margin-bottom: 2rem;
  white-space: pre-wrap;
}

.rental-form-card {
  background: var(--white);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.rental-form-card h3 {
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.price-summary {
  background: rgba(82, 183, 136, 0.06);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
}

.price-summary .price-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--warm-gray);
  margin-bottom: 0.3rem;
}

.price-summary .price-total {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--green-dark);
  padding-top: 0.5rem;
  border-top: 1px solid var(--sand);
  margin-top: 0.5rem;
}

/* ---- Tabs ---- */
.tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--sand);
  margin-bottom: 2rem;
}

.tab-btn {
  padding: 0.75rem 1.5rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--warm-gray);
  background: none;
  border: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
}

.tab-btn:hover { color: var(--green-dark); }
.tab-btn.active {
  color: var(--green-dark);
  border-bottom-color: var(--green-light);
}

/* ---- Request Cards ---- */
.request-card {
  background: var(--white);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  transition: var(--transition);
}

.request-card:hover {
  box-shadow: var(--shadow-sm);
}

.request-card .request-thumb {
  width: 80px;
  height: 80px;
  border-radius: var(--radius);
  background: var(--sand);
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.request-card .request-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.request-card .request-info {
  flex: 1;
}

.request-card .request-info h4 {
  font-size: 1rem;
  margin-bottom: 0.3rem;
}

.request-card .request-dates {
  font-size: 0.85rem;
  color: var(--warm-gray);
  margin-bottom: 0.3rem;
}

.request-card .request-message {
  font-size: 0.85rem;
  color: var(--charcoal);
  font-style: italic;
  margin-bottom: 0.5rem;
}

.request-card .request-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

/* ---- Alerts ---- */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.alert-error {
  background: var(--red-light);
  color: var(--red);
  border: 1px solid rgba(231, 76, 60, 0.2);
}

.alert-success {
  background: rgba(82, 183, 136, 0.12);
  color: var(--green-mid);
  border: 1px solid rgba(82, 183, 136, 0.25);
}

.alert-info {
  background: rgba(45, 106, 79, 0.06);
  color: var(--green-dark);
  border: 1px solid rgba(45, 106, 79, 0.15);
}

/* ---- Auth Pages ---- */
.auth-container {
  max-width: 440px;
  margin: 0 auto;
  padding: 6rem 2rem 3rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-card {
  background: var(--white);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-md);
}

.auth-card h1 {
  text-align: center;
  margin-bottom: 0.5rem;
  font-size: 1.8rem;
}

.auth-card .auth-sub {
  text-align: center;
  color: var(--warm-gray);
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

.auth-card .auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--warm-gray);
}

/* ---- Empty State ---- */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
}

.empty-state .empty-icon {
  font-size: 4rem;
  opacity: 0.3;
  margin-bottom: 1rem;
}

.empty-state h3 {
  color: var(--warm-gray);
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--warm-gray);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

/* ---- Loading ---- */
.loading-spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 3rem;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--sand);
  border-top-color: var(--green-light);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---- Image Gallery Thumbnails ---- */
.gallery-thumbs {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.gallery-thumb {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition);
}

.gallery-thumb.active { border-color: var(--green-light); }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ---- Site Footer Nav ---- */
.site-footer-nav {
  background: var(--green-dark);
  color: rgba(255,255,255,0.7);
  padding: 2.5rem 2rem;
  margin-top: 0;
}

.site-footer-nav .footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

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

.site-footer-nav .footer-links a {
  color: rgba(255,255,255,0.65);
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s;
}

.site-footer-nav .footer-links a:hover {
  color: var(--green-glow);
}

.site-footer-nav .footer-copy {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.35);
}

@media (max-width: 600px) {
  .site-footer-nav { padding: 2rem 1.25rem; }
  .site-footer-nav .footer-links { gap: 0.5rem 1.25rem; }
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .app-nav { padding: 0.9rem 1rem; }
  .nav-links { gap: 1rem; }
  .page-container { padding: 5rem 1rem 2rem; }
  .auth-container { padding: 5rem 1rem 2rem; max-width: 100%; }
  .auth-card { padding: 1.5rem; }
  .auth-card h1 { font-size: 1.5rem; }
  .detail-layout { grid-template-columns: 1fr; gap: 1.5rem; }
  .listing-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
  .form-row { grid-template-columns: 1fr; }
  .filter-bar { flex-direction: column; }
  .filter-bar .search-input { width: 100%; }
  .request-card { flex-direction: column; }
  .request-card .request-thumb { width: 100%; height: 120px; }
}

@media (max-width: 480px) {
  .listing-grid { grid-template-columns: 1fr; }
  .nav-left { gap: 1rem; }
  .nav-links a { font-size: 0.8rem; }
  h1 { font-size: 1.8rem; }
  .auth-container { padding: 4rem 1rem 2rem; }
  .auth-card { padding: 1.25rem; }
  .auth-card h1 { font-size: 1.3rem; }
  .auth-card .auth-sub { font-size: 0.85rem; }
  .form-row { grid-template-columns: 1fr; gap: 0.5rem; }
  .btn { padding: 0.5rem 1rem; font-size: 0.85rem; }
  .btn-lg { padding: 0.65rem 1.5rem; font-size: 0.95rem; }
  .form-group label { font-size: 0.8rem; }
  .form-group input, .form-group select, .form-group textarea { font-size: 0.9rem; }
}
