/* ============================================
   Availay.ai Demo Site - Global Styles
   Design System from DA specifications
   ============================================ */

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

/* CSS Custom Properties - Color Palette */
:root {
  /* Primary Colors */
  --midnight-blue: #0F1C2E;
  --signal-teal: #2ED3C6;
  --warm-sand: #F5F3EE;
  
  /* Utility Colors */
  --charcoal: #1E1E1E;
  --muted: #DADFE6;
  --success: #1FBF75;
  --warning: #F5A524;
  
  /* Typography */
  --font-heading: 'DM Sans', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  
  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4rem;
  
  /* Border Radius */
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-full: 9999px;
}

/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--charcoal);
  background-color: var(--warm-sand);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography Hierarchy */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
  color: var(--midnight-blue);
}

h1 {
  font-size: 2.5rem;
  font-weight: 600;
}

h2 {
  font-size: 2rem;
  font-weight: 500;
}

h3 {
  font-size: 1.5rem;
  font-weight: 500;
}

p {
  margin-bottom: var(--space-sm);
}

a {
  color: inherit;
  text-decoration: none;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.container-narrow {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* Navigation */
.nav {
  background-color: var(--midnight-blue);
  padding: var(--space-md) 0;
  margin-bottom: var(--space-xl);
}

.nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.logo {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 600;
  color: white;
}

.nav-links {
  display: flex;
  gap: var(--space-lg);
  list-style: none;
}

.nav-links a {
  color: rgba(255, 255, 255, 0.8);
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--signal-teal);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 0.75rem 1.5rem;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  justify-content: center;
}

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

.btn-primary:hover {
  background-color: #26C0B5;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(46, 211, 198, 0.3);
}

.btn-secondary {
  background-color: white;
  color: var(--midnight-blue);
  border: 1px solid var(--muted);
}

.btn-secondary:hover {
  border-color: var(--midnight-blue);
}

.btn-large {
  padding: 1rem 2rem;
  font-size: 1.125rem;
}

/* Cards */
.card {
  background-color: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid var(--muted);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(15, 28, 46, 0.08);
}

.card-image {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  background-color: var(--muted);
}

.card-content {
  padding: var(--space-md);
}

.card-title {
  font-size: 1.25rem;
  margin-bottom: var(--space-xs);
  color: var(--midnight-blue);
}

.card-description {
  font-size: 0.9375rem;
  color: var(--charcoal);
  margin-bottom: var(--space-sm);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--space-sm);
  border-top: 1px solid var(--muted);
}

/* Grid Layouts */
.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-full);
  background-color: var(--success);
  color: white;
}

.badge-teal {
  background-color: var(--signal-teal);
  color: white;
}

/* Profile Section */
.profile-section {
  text-align: center;
  padding: var(--space-xl) 0;
  max-width: 600px;
  margin: 0 auto;
}

.profile-image {
  width: 160px;
  height: 160px;
  border-radius: var(--radius-full);
  object-fit: cover;
  margin: 0 auto var(--space-md);
  border: 4px solid white;
  box-shadow: 0 4px 16px rgba(15, 28, 46, 0.1);
}

.profile-name {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  margin-bottom: var(--space-sm);
}

.verified-badge {
  width: 24px;
  height: 24px;
  background-color: var(--signal-teal);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
}

.profile-bio {
  font-size: 1.125rem;
  color: var(--charcoal);
  margin-bottom: var(--space-lg);
  line-height: 1.7;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.social-link {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background-color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--muted);
  transition: all 0.2s;
  font-size: 1.5rem;
}

.social-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Price Display */
.price {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--midnight-blue);
}

.price-small {
  font-size: 1.25rem;
}

/* Location */
.location {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--charcoal);
  font-size: 0.9375rem;
}

/* Section Headers */
.section-header {
  margin-bottom: var(--space-lg);
}

.section-title {
  font-size: 1.75rem;
  margin-bottom: var(--space-xs);
}

.section-subtitle {
  color: var(--charcoal);
  opacity: 0.7;
}

/* Form Styles */
.form-group {
  margin-bottom: var(--space-md);
}

.form-label {
  display: block;
  font-weight: 500;
  margin-bottom: var(--space-xs);
  color: var(--midnight-blue);
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--font-body);
  font-size: 1rem;
  border: 1px solid var(--muted);
  border-radius: var(--radius-md);
  background-color: white;
  transition: border-color 0.2s;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--signal-teal);
}

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

/* Upload Area */
.upload-area {
  border: 2px dashed var(--muted);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  text-align: center;
  background-color: white;
  cursor: pointer;
  transition: all 0.2s;
}

.upload-area:hover {
  border-color: var(--signal-teal);
  background-color: rgba(46, 211, 198, 0.05);
}

.upload-icon {
  font-size: 3rem;
  margin-bottom: var(--space-sm);
  color: var(--muted);
}

/* Progress / Status */
.status-container {
  max-width: 500px;
  margin: var(--space-2xl) auto;
  padding: var(--space-xl);
  background-color: white;
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 24px rgba(15, 28, 46, 0.08);
}

.status-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  margin-bottom: var(--space-sm);
  border-radius: var(--radius-md);
  opacity: 0.4;
  transition: all 0.3s;
}

.status-item.active {
  opacity: 1;
  background-color: rgba(46, 211, 198, 0.1);
}

.status-item.completed {
  opacity: 1;
}

.status-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background-color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.status-item.active .status-icon {
  background-color: var(--signal-teal);
  animation: pulse 1.5s ease-in-out infinite;
}

.status-item.completed .status-icon {
  background-color: var(--success);
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.status-text h3 {
  font-size: 1.125rem;
  margin-bottom: 0.25rem;
}

.status-text p {
  font-size: 0.875rem;
  color: var(--charcoal);
  opacity: 0.7;
  margin: 0;
}

/* Table / Dashboard */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-xl);
}

.listings-grid {
  display: grid;
  gap: var(--space-md);
}

.listing-card {
  display: flex;
  gap: var(--space-md);
  background-color: white;
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  border: 1px solid var(--muted);
  transition: all 0.2s;
}

.listing-card:hover {
  border-color: var(--signal-teal);
  box-shadow: 0 4px 16px rgba(15, 28, 46, 0.06);
}

.listing-thumbnail {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.listing-info {
  flex: 1;
}

.listing-actions {
  display: flex;
  gap: var(--space-xs);
  align-items: flex-start;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--muted);
  background-color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.icon-btn:hover {
  background-color: var(--warm-sand);
  border-color: var(--midnight-blue);
}

/* Amenities Grid */
.amenities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--space-md);
  margin: var(--space-lg) 0;
}

.amenity-item {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm);
  background-color: white;
  border-radius: var(--radius-md);
  border: 1px solid var(--muted);
}

.amenity-icon {
  font-size: 1.25rem;
}

/* Image Gallery */
.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
}

.gallery-main {
  grid-column: 1 / -1;
  aspect-ratio: 16/9;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

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

.gallery-thumb {
  aspect-ratio: 16/9;
  overflow: hidden;
  border-radius: var(--radius-md);
}

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

/* Responsive Design - Mobile First */
@media (max-width: 768px) {
  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr;
  }
  
  .nav-links {
    display: none;
  }
  
  .listing-card {
    flex-direction: row !important;
    padding: 0.375rem !important;
    gap: 0.375rem !important;
    max-width: 100%;
    overflow: hidden;
  }
  
  .listing-thumbnail {
    width: 65px !important;
    height: 65px !important;
    order: 1;
    border-radius: var(--radius-sm) !important;
    flex-shrink: 0;
  }
  
  .listing-info {
    flex: 1;
    order: 2;
    min-width: 0;
    padding-right: 0.25rem;
    overflow: hidden;
  }
  
  .listing-info .card-title {
    font-size: 0.8125rem !important;
    margin-bottom: 0.125rem !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  
  .listing-info .location {
    font-size: 0.625rem !important;
    margin-bottom: 0.25rem !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  
  .listing-info > div {
    flex-wrap: nowrap !important;
    gap: 0.25rem !important;
    overflow: hidden;
  }
  
  .listing-info .badge {
    font-size: 0.5625rem !important;
    padding: 0.125rem 0.25rem !important;
    white-space: nowrap;
    flex-shrink: 0;
  }
  
  .listing-info .price {
    font-size: 0.8125rem !important;
    white-space: nowrap;
    flex-shrink: 0;
  }
  
  .listing-actions {
    order: 3;
    flex-direction: column !important;
    gap: 0.25rem !important;
    flex-shrink: 0;
    align-items: center;
    margin-left: 0.25rem;
  }
  
  .listing-actions .toggle-switch {
    width: 30px !important;
    height: 16px !important;
  }
  
  .listing-actions .toggle-slider:before {
    height: 10px !important;
    width: 10px !important;
    left: 3px !important;
    bottom: 3px !important;
  }
  
  .listing-actions input:checked + .toggle-slider:before {
    transform: translateX(14px) !important;
  }
  
  .listing-actions .icon-btn {
    width: 24px !important;
    height: 24px !important;
    font-size: 0.6875rem !important;
    padding: 0 !important;
  }
  
  .listings-grid {
    gap: 0.375rem !important;
  }
  
  .dashboard-header {
    flex-direction: column;
    gap: var(--space-md);
    align-items: stretch;
  }
  
  .gallery {
    grid-template-columns: 1fr;
  }
  
  .amenities-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* Profile section responsive */
  .profile-horizontal {
    flex-direction: row !important;
    text-align: left !important;
    align-items: flex-start !important;
    padding: var(--space-sm) !important;
    gap: var(--space-sm) !important;
  }
  
  .profile-horizontal img {
    width: 60px !important;
    height: 60px !important;
    margin: 0 !important;
    border-width: 2px !important;
    flex-shrink: 0;
  }
  
  .profile-horizontal > div:first-of-type {
    display: flex;
    flex-direction: column;
    align-items: flex-start !important;
    flex: 1;
    min-width: 0;
  }
  
  .profile-horizontal h1 {
    font-size: 1rem !important;
    margin-bottom: 0.125rem !important;
    display: flex;
    align-items: center;
    gap: 0.25rem;
  }
  
  .profile-horizontal .verified-badge {
    width: 14px !important;
    height: 14px !important;
    font-size: 0.5rem !important;
  }
  
  .profile-horizontal p {
    font-size: 0.75rem !important;
    line-height: 1.4 !important;
    margin-bottom: 0.5rem !important;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  
  .profile-horizontal .social-link {
    width: 32px !important;
    height: 32px !important;
  }
  
  .profile-horizontal .social-link svg {
    width: 14px !important;
    height: 14px !important;
  }
  
  .profile-horizontal > div:first-of-type > div:last-child {
    display: flex;
    gap: 0.25rem;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Utility Classes */
.text-center {
  text-align: center;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--muted);
  transition: 0.3s;
  border-radius: 24px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: var(--signal-teal);
}

input:checked + .toggle-slider:before {
  transform: translateX(20px);
}

.toggle-slider:hover {
  opacity: 0.9;
}

/* Utility Classes */

.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }

.hidden {
  display: none;
}
