/* SBOit - Base Styles (placeholder - design colors TBD) */

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary: #64748b;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #f59e0b;
  --bg: #f8fafc;
  --bg-white: #ffffff;
  --text: #1e293b;
  --text-light: #64748b;
  --border: #e2e8f0;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

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

/* Navbar */
.navbar {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  text-decoration: none;
  letter-spacing: -0.5px;
}

.navbar-links { display: flex; align-items: center; gap: 1.25rem; }
.navbar-links a { color: var(--text); text-decoration: none; font-size: 0.9rem; font-weight: 500; }
.navbar-links a:hover { color: var(--primary); }

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-lg { padding: 0.75rem 2rem; font-size: 1rem; }
.btn-full { width: 100%; text-align: center; }

/* Hero */
.hero {
  text-align: center;
  padding: 4rem 0 3rem;
}
.hero h1 { font-size: 3rem; font-weight: 800; letter-spacing: -1px; margin-bottom: 0.75rem; }
.hero p { font-size: 1.25rem; color: var(--text-light); margin-bottom: 2rem; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; }

/* Categories */
.categories { padding: 2rem 0 3rem; }
.categories h2 { text-align: center; margin-bottom: 2rem; font-size: 1.75rem; }
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}
.category-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-decoration: none;
  color: var(--text);
  transition: all 0.15s;
  text-align: center;
}
.category-card:hover { border-color: var(--primary); box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.category-card h3 { font-size: 1.1rem; margin-bottom: 0.25rem; }
.category-card p { font-size: 0.85rem; color: var(--text-light); }

/* How It Works */
.how-it-works { padding: 2rem 0 4rem; }
.how-it-works h2 { text-align: center; margin-bottom: 2rem; font-size: 1.75rem; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2rem; }
.step { text-align: center; }
.step-number {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--primary); color: white;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.25rem; font-weight: 700; margin-bottom: 0.75rem;
}
.step h3 { margin-bottom: 0.5rem; }
.step p { color: var(--text-light); font-size: 0.9rem; }

/* Auth Forms */
.auth-form {
  max-width: 440px;
  margin: 3rem auto;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
}
.auth-form h2 { text-align: center; margin-bottom: 1.5rem; }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 0.25rem; }
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="tel"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  transition: border-color 0.15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.form-group small { color: var(--text-light); font-size: 0.8rem; }
.form-check { display: flex; align-items: center; gap: 0.5rem; }
.form-check input { width: auto; }
.form-check label { font-weight: normal; margin-bottom: 0; }

/* Alerts */
.alert { padding: 0.75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: 0.9rem; }
.alert-error { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: var(--success); border: 1px solid #bbf7d0; }

/* Auth Links */
.auth-links { text-align: center; margin-top: 1.5rem; font-size: 0.9rem; }
.auth-links a { color: var(--primary); text-decoration: none; }
.auth-links a:hover { text-decoration: underline; }

/* Error Page */
.error-page { text-align: center; padding: 4rem 0; }
.error-page h1 { font-size: 5rem; color: var(--text-light); }
.error-page p { margin: 1rem 0 2rem; color: var(--text-light); }

/* Footer */
.footer {
  background: var(--text);
  color: #cbd5e1;
  padding: 3rem 0 1.5rem;
  margin-top: 3rem;
}
.footer-content { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2rem; margin-bottom: 2rem; }
.footer-section h4 { color: white; margin-bottom: 0.75rem; }
.footer-section a { display: block; color: #cbd5e1; text-decoration: none; margin-bottom: 0.25rem; font-size: 0.9rem; }
.footer-section a:hover { color: white; }
.footer-section p { font-size: 0.9rem; }
.footer-bottom { border-top: 1px solid #334155; padding-top: 1rem; text-align: center; font-size: 0.85rem; }

/* Browse Layout */
.browse-header { margin-bottom: 1.5rem; }
.browse-header h1 { margin-bottom: 1rem; }
.filter-bar { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.browse-layout { display: grid; grid-template-columns: 220px 1fr; gap: 2rem; }
.category-sidebar h3 { margin-bottom: 0.75rem; }
.category-sidebar ul { list-style: none; }
.category-sidebar li { margin-bottom: 0.25rem; }
.category-sidebar a { color: var(--text); text-decoration: none; font-size: 0.9rem; padding: 0.25rem 0; display: block; }
.category-sidebar a:hover, .category-sidebar a.active { color: var(--primary); font-weight: 600; }

/* Listing Grid */
.listing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.25rem; }
.listing-card { background: var(--bg-white); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: all 0.15s; }
.listing-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.listing-card a { text-decoration: none; color: var(--text); }
.listing-card-img { position: relative; aspect-ratio: 4/3; background: #f1f5f9; overflow: hidden; }
.listing-card-img img { width: 100%; height: 100%; object-fit: cover; }
.listing-card-img .no-image { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--text-light); }
.listing-type-badge { position: absolute; top: 0.5rem; left: 0.5rem; background: var(--primary); color: white; padding: 0.2rem 0.6rem; border-radius: 4px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; }
.listing-type-badge.large { position: static; font-size: 0.85rem; padding: 0.3rem 0.75rem; }
.listing-type-badge.small { position: static; font-size: 0.7rem; padding: 0.15rem 0.5rem; }
.listing-card-body { padding: 1rem; }
.listing-card-body h3 { font-size: 1rem; margin-bottom: 0.25rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.listing-location { font-size: 0.85rem; color: var(--text-light); }
.listing-price { font-size: 1.1rem; font-weight: 700; color: var(--primary); margin-top: 0.5rem; }

/* Listing Detail */
.listing-detail { display: grid; grid-template-columns: 1fr 400px; gap: 2rem; margin: 2rem 0; }
.gallery-main { border-radius: var(--radius); overflow: hidden; background: #f1f5f9; }
.gallery-main img { width: 100%; max-height: 500px; object-fit: contain; }
.no-image-lg { display: flex; align-items: center; justify-content: center; min-height: 300px; color: var(--text-light); font-size: 1.2rem; }
.gallery-thumbs { display: flex; gap: 0.5rem; margin-top: 0.75rem; overflow-x: auto; }
.gallery-thumb { width: 80px; height: 60px; object-fit: cover; border-radius: 4px; cursor: pointer; border: 2px solid transparent; }
.gallery-thumb:hover { border-color: var(--primary); }
.listing-info { background: var(--bg-white); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; }
.listing-info-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.listing-info-header h1 { font-size: 1.5rem; }
.price-display { margin: 1rem 0; }
.price-display label { display: block; font-size: 0.85rem; color: var(--text-light); }
.price-display .price { font-size: 2rem; font-weight: 800; color: var(--primary); }
.auction-timer { margin: 0.75rem 0; }
.auction-timer label { font-size: 0.85rem; color: var(--text-light); display: block; }
.bid-actions { display: flex; gap: 0.75rem; margin-top: 1rem; }
.sealed-bid-info { background: #f0f9ff; border: 1px solid #bae6fd; border-radius: var(--radius); padding: 1rem; margin: 1rem 0; }
.specs-table { width: 100%; border-collapse: collapse; margin-top: 0.5rem; }
.specs-table td { padding: 0.4rem 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.specs-table td:first-child { font-weight: 600; width: 140px; color: var(--text-light); }
.item-specs-detail, .listing-description, .listing-contact { margin-top: 1.5rem; }
.item-specs-detail h3, .listing-description h3, .listing-contact h3 { margin-bottom: 0.5rem; }
.view-count { font-size: 0.85rem; color: var(--text-light); margin-top: 1.5rem; }

/* Dashboard */
.dashboard-header { display: flex; align-items: center; justify-content: space-between; margin: 1.5rem 0; }
.dashboard-section { margin-bottom: 2rem; }
.dashboard-section h2 { margin-bottom: 1rem; }
.empty-state { text-align: center; padding: 3rem; background: var(--bg-white); border: 1px solid var(--border); border-radius: var(--radius); }
.empty-state p { color: var(--text-light); margin-bottom: 1rem; }

/* Project Cards */
.project-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.project-card { background: var(--bg-white); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.project-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; }
.project-card-header h3 { font-size: 1.1rem; }
.project-card p { font-size: 0.9rem; margin-bottom: 0.25rem; }

/* Badges */
.badge { display: inline-block; padding: 0.2rem 0.6rem; border-radius: 4px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; }
.badge-assigned, .badge.ASSIGNED { background: #dbeafe; color: #1d4ed8; }
.badge-progress, .badge.IN_PROGRESS { background: #fef3c7; color: #b45309; }
.badge-completed, .badge.COMPLETED { background: #d1fae5; color: #065f46; }
.badge.CREATED { background: #f1f5f9; color: #475569; }
.badge.CANCELED { background: #fee2e2; color: #991b1b; }
.badge.DRAFT { background: #f1f5f9; color: #475569; }
.badge.PENDING_VERIFICATION { background: #fef3c7; color: #b45309; }
.badge.VERIFIED { background: #dbeafe; color: #1d4ed8; }
.badge.ACTIVE { background: #d1fae5; color: #065f46; }
.badge.ENDED { background: #e2e8f0; color: #475569; }
.badge.SOLD { background: #d1fae5; color: #065f46; }

/* Project Detail */
.project-detail { margin: 1.5rem 0; }
.project-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.25rem; margin-bottom: 1.5rem; }
.detail-section { background: var(--bg-white); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.detail-section h3 { font-size: 0.9rem; color: var(--text-light); margin-bottom: 0.5rem; text-transform: uppercase; letter-spacing: 0.5px; }
.project-actions { margin: 1.5rem 0; display: flex; gap: 0.75rem; }
.item-specs { font-size: 0.9rem; color: var(--text-light); margin-top: 0.5rem; }

/* Upload Section */
.upload-section { background: var(--bg-white); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; margin: 1.5rem 0; }
.upload-section h2 { margin-bottom: 1rem; }

/* Photo Grid */
.media-gallery { margin: 1.5rem 0; }
.media-gallery h2 { margin-bottom: 1rem; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.75rem; }
.photo-grid.small { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.photo-card { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.photo-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.photo-info { padding: 0.5rem; font-size: 0.8rem; display: flex; justify-content: space-between; align-items: center; }
.btn-link { background: none; border: none; cursor: pointer; font-size: 0.8rem; color: var(--primary); }
.btn-link.danger { color: var(--danger); }

/* Tables */
.listing-table { overflow-x: auto; }
.listing-table table { width: 100%; border-collapse: collapse; background: var(--bg-white); border-radius: var(--radius); overflow: hidden; }
.listing-table th { background: #f8fafc; text-align: left; padding: 0.75rem; font-size: 0.85rem; font-weight: 600; color: var(--text-light); text-transform: uppercase; border-bottom: 2px solid var(--border); }
.listing-table td { padding: 0.75rem; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.listing-table tr:hover { background: #f8fafc; }
.btn-sm { padding: 0.25rem 0.75rem; font-size: 0.8rem; }

/* Stats Grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card { background: var(--bg-white); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; text-align: center; }
.stat-number { font-size: 2.5rem; font-weight: 800; color: var(--primary); }
.stat-label { font-size: 0.9rem; color: var(--text-light); margin-top: 0.25rem; }

/* Admin Nav */
.admin-nav { display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* Form Pages */
.form-page { max-width: 800px; margin: 2rem auto; }
.form-page h1 { margin-bottom: 0.5rem; }
.listing-form fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.5rem; background: var(--bg-white); }
.listing-form legend { font-weight: 700; font-size: 1.1rem; padding: 0 0.5rem; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
.form-actions { display: flex; gap: 1rem; align-items: center; margin-top: 1rem; }
.form-inline { display: flex; gap: 0.75rem; align-items: flex-end; }

/* Breadcrumb */
.breadcrumb { font-size: 0.9rem; color: var(--text-light); margin: 1rem 0; }
.breadcrumb a { color: var(--primary); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* Pagination */
.pagination { display: flex; align-items: center; justify-content: center; gap: 1rem; margin: 2rem 0; }

/* Success Button */
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #15803d; }

/* Alert Info */
.alert-info { background: #f0f9ff; color: #0369a1; border: 1px solid #bae6fd; }

/* Edit Header */
.listing-edit-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.edit-photos { margin-bottom: 1.5rem; }
.edit-photos h3 { margin-bottom: 0.75rem; }

/* Search */
.search-form { margin-bottom: 2rem; }
.search-bar { display: flex; gap: 0.75rem; margin-bottom: 1rem; }
.search-input { flex: 1; padding: 0.75rem 1rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: 1rem; }
.search-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.search-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.75rem; }
.search-filters .form-group label { font-size: 0.8rem; font-weight: 600; }
.search-filters .form-group select,
.search-filters .form-group input { padding: 0.4rem 0.5rem; font-size: 0.85rem; }
.search-results-count { color: var(--text-light); font-size: 0.9rem; margin-bottom: 1rem; }

/* Bid Forms */
.bid-forms { margin-top: 1rem; }
.bid-form-inline { display: flex; gap: 0.75rem; align-items: flex-end; margin-bottom: 0.75rem; }
.bid-form-stack { margin-bottom: 0.75rem; }
.bid-form-stack .form-group { margin-bottom: 0.75rem; }
.bid-input { width: 100%; padding: 0.6rem 0.75rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: 1.1rem; font-weight: 600; }
.bid-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.bid-count { font-size: 0.9rem; color: var(--text-light); margin: 0.25rem 0; }
.bid-amount-cell { font-weight: 700; color: var(--primary); }

/* Badge - bid statuses */
.badge.WON { background: #d1fae5; color: #065f46; }
.badge.LOST { background: #fee2e2; color: #991b1b; }
.badge.OUTBID { background: #fef3c7; color: #b45309; }
.badge.RETRACTED { background: #e2e8f0; color: #475569; }

/* Responsive */
@media (max-width: 768px) {
  .hero h1 { font-size: 2rem; }
  .hero-actions { flex-direction: column; align-items: center; }
  .navbar .container { flex-wrap: wrap; }
  .navbar-links { flex-wrap: wrap; gap: 0.75rem; }
  .browse-layout { grid-template-columns: 1fr; }
  .category-sidebar { display: none; }
  .listing-detail { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .bid-form-inline { flex-direction: column; align-items: stretch; }
}
