/**
 * CribStash - Main CSS Stylesheet
 * This file contains all the styling for the CribStash application
 */

/* ===== GLOBAL STYLES ===== */
:root {
  --primary-color: #4a6da7;
  --secondary-color: #f8f9fa;
  --accent-color: #ff6b6b;
  --text-color: #333333;
  --light-gray: #e9ecef;
  --dark-gray: #6c757d;
  --success-color: #28a745;
  --danger-color: #dc3545;
  --warning-color: #ffc107;
  --info-color: #17a2b8;
  --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --border-radius: 0.25rem;
}

body {
  font-family: 'Roboto', Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: #f5f5f5;
  margin: 0;
  padding: 0;
}

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

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: #3a5580;
  text-decoration: underline;
}

.btn {
  display: inline-block;
  font-weight: 400;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  user-select: none;
  border: 1px solid transparent;
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  border-radius: var(--border-radius);
  transition: all 0.15s ease-in-out;
  cursor: pointer;
}

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

.btn-primary:hover {
  background-color: #3a5580;
  border-color: #3a5580;
}

.btn-secondary {
  color: var(--text-color);
  background-color: var(--secondary-color);
  border-color: #dae0e5;
}

.btn-secondary:hover {
  background-color: #e2e6ea;
  border-color: #dae0e5;
}

.btn-danger {
  color: white;
  background-color: var(--danger-color);
  border-color: var(--danger-color);
}

.btn-danger:hover {
  background-color: #c82333;
  border-color: #bd2130;
}

.btn-success {
  color: white;
  background-color: var(--success-color);
  border-color: var(--success-color);
}

.btn-success:hover {
  background-color: #218838;
  border-color: #1e7e34;
}

.btn-block {
  display: block;
  width: 100%;
}

/* ===== HEADER & NAVIGATION ===== */
.navbar {
  background-color: white;
  box-shadow: var(--box-shadow);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--primary-color);
}

.navbar-nav {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-item {
  margin-left: 1.5rem;
}

.nav-link {
  color: var(--text-color);
  font-weight: 500;
}

.nav-link:hover {
  color: var(--primary-color);
}

.navbar-toggler {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
}

/* ===== HERO SECTION ===== */
.hero {
  background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('../images/hero-bg.jpg');
  background-size: cover;
  background-position: center;
  color: white;
  text-align: center;
  padding: 5rem 0;
  margin-bottom: 2rem;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.2rem;
  max-width: 600px;
  margin: 0 auto 2rem;
}

.search-form {
  max-width: 600px;
  margin: 0 auto;
  background-color: rgba(255, 255, 255, 0.9);
  padding: 1.5rem;
  border-radius: var(--border-radius);
}

.search-form input {
  width: 70%;
  padding: 0.5rem;
  border: 1px solid #ced4da;
  border-radius: var(--border-radius);
  margin-right: 0.5rem;
}

/* ===== SPACE CARDS ===== */
.spaces-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.space-card {
  background-color: white;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--box-shadow);
  transition: transform 0.3s ease;
}

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

.space-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.space-card-body {
  padding: 1rem;
}

.space-card-title {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.space-card-location {
  color: var(--dark-gray);
  margin-bottom: 0.5rem;
}

.space-card-price {
  font-weight: bold;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

/* ===== SPACE DETAILS PAGE ===== */
.space-details {
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  padding: 2rem;
  margin-bottom: 2rem;
}

.space-gallery {
  margin-bottom: 2rem;
}

.main-image-container {
  margin-bottom: 1rem;
}

.main-image-container img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  border-radius: var(--border-radius);
}

.thumbnails {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
}

.space-thumbnail {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--border-radius);
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.space-thumbnail:hover,
.space-thumbnail.active {
  opacity: 1;
}

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

.space-location {
  color: var(--dark-gray);
  margin-bottom: 1rem;
}

.space-price {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.space-description {
  margin-bottom: 2rem;
}

.space-features {
  margin-bottom: 2rem;
}

.space-features h3 {
  margin-bottom: 1rem;
}

.features-list {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.5rem;
}

.features-list li {
  padding-left: 1.5rem;
  position: relative;
}

.features-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--success-color);
}

/* ===== BOOKING FORM ===== */
.booking-form {
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  padding: 1.5rem;
}

.booking-form h3 {
  margin-bottom: 1rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-control {
  display: block;
  width: 100%;
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text-color);
  background-color: white;
  background-clip: padding-box;
  border: 1px solid #ced4da;
  border-radius: var(--border-radius);
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
  border-color: var(--primary-color);
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(74, 109, 167, 0.25);
}

.total-price {
  font-size: 1.25rem;
  font-weight: bold;
  margin-top: 1rem;
  margin-bottom: 1rem;
}

/* ===== USER FORMS ===== */
.auth-container {
  max-width: 500px;
  margin: 2rem auto;
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  padding: 2rem;
}

.auth-container h2 {
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-links {
  text-align: center;
  margin-top: 1rem;
}

/* ===== ALERTS ===== */
.alert {
  padding: 0.75rem 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
  border-radius: var(--border-radius);
}

.alert-success {
  color: #155724;
  background-color: #d4edda;
  border-color: #c3e6cb;
}

.alert-danger {
  color: #721c24;
  background-color: #f8d7da;
  border-color: #f5c6cb;
}

.alert-warning {
  color: #856404;
  background-color: #fff3cd;
  border-color: #ffeeba;
}

.alert-info {
  color: #0c5460;
  background-color: #d1ecf1;
  border-color: #bee5eb;
}

/* ===== FOOTER ===== */
.footer {
  background-color: #343a40;
  color: white;
  padding: 3rem 0;
  margin-top: 3rem;
}

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

.footer-section h3 {
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: #adb5bd;
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: white;
  text-decoration: none;
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  margin-top: 2rem;
  border-top: 1px solid #495057;
}

/* ===== RESPONSIVE STYLES ===== */
@media (max-width: 768px) {
  .navbar-nav {
    display: none;
    flex-direction: column;
    width: 100%;
    padding: 1rem 0;
  }
  
  .navbar-nav.show {
    display: flex;
  }
  
  .nav-item {
    margin-left: 0;
    margin-bottom: 0.5rem;
  }
  
  .navbar-toggler {
    display: block;
  }
  
  .search-form input {
    width: 60%;
  }
  
  .hero h1 {
    font-size: 2rem;
  }
  
  .hero p {
    font-size: 1rem;
  }
  
  .main-image-container img {
    height: 300px;
  }
}

@media (max-width: 576px) {
  .search-form {
    padding: 1rem;
  }
  
  .search-form input {
    width: 100%;
    margin-right: 0;
    margin-bottom: 0.5rem;
  }
  
  .search-form .btn {
    width: 100%;
  }
  
  .space-details {
    padding: 1rem;
  }
  
  .main-image-container img {
    height: 250px;
  }
  
  .auth-container {
    padding: 1.5rem;
  }
}

/* ===== UTILITY CLASSES ===== */
.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.text-primary {
  color: var(--primary-color);
}

.text-success {
  color: var(--success-color);
}

.text-danger {
  color: var(--danger-color);
}

.text-warning {
  color: var(--warning-color);
}

.text-info {
  color: var(--info-color);
}

.bg-light {
  background-color: var(--secondary-color);
}

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }

.ml-1 { margin-left: 0.25rem; }
.ml-2 { margin-left: 0.5rem; }
.ml-3 { margin-left: 1rem; }
.ml-4 { margin-left: 1.5rem; }
.ml-5 { margin-left: 3rem; }

.mr-1 { margin-right: 0.25rem; }
.mr-2 { margin-right: 0.5rem; }
.mr-3 { margin-right: 1rem; }
.mr-4 { margin-right: 1.5rem; }
.mr-5 { margin-right: 3rem; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }
.p-5 { padding: 3rem; }

.rounded {
  border-radius: var(--border-radius);
}

.shadow {
  box-shadow: var(--box-shadow);
}

.is-invalid {
  border-color: var(--danger-color);
}

.error-message {
  color: var(--danger-color);
  font-size: 0.8rem;
  margin-top: 0.25rem;
}
.card-img, .card-img-bottom, .card-img-top {
  height: 12em;
  object-fit: cover;
  object-position: center;
}

#spaceImageCarousel .carousel-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}