/* ============================================
   MODERN DESIGN SYSTEM - PROFESSIONAL UI
   ============================================ */

:root {
  --brand-teal: #1b5e68;
  --brand-teal-dark: #123f47;
  --brand-gold: #d99a3f;
  --brand-gold-light: #f0c67f;

  /* Modern color palette */
  --primary: #1b5e68;
  --primary-light: #2a7c87;
  --primary-dark: #123f47;
  --accent: #d99a3f;
  --accent-light: #f0c67f;

  /* Neutral colors */
  --text-primary: #1a1a1a;
  --text-secondary: #666666;
  --text-light: #999999;
  --bg-light: #f8f9fa;
  --bg-lighter: #fafbfc;
  --border-color: #e0e0e0;

  /* Shadows for depth */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 12px 32px rgba(0, 0, 0, 0.15);

  /* Animations */
  --duration-fast: 150ms;
  --duration-normal: 300ms;
  --duration-slow: 500ms;
  --easing: cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
}

html {
  font-size: 14px;
  position: relative;
  min-height: 100%;
  scroll-behavior: smooth;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  margin-bottom: 60px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  color: var(--text-primary);
  background-color: #ffffff;
  transition: background-color var(--duration-normal) var(--easing);
  letter-spacing: -0.25px;
}

/* ============================================
   MODERN HEADER & NAVIGATION
   ============================================ */

.modern-header {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.98) 100%);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: var(--shadow-sm);
  transition: all var(--duration-normal) var(--easing);
  z-index: 100;
}

.modern-header.scrolled {
  box-shadow: var(--shadow-md);
}

.brand-icon {
  font-size: 1.5rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.brand-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.5px;
}

.navbar {
  padding: 0.75rem 0;
}

.navbar-nav {
  align-items: center;
}

.nav-link-modern {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary) !important;
  font-weight: 500;
  padding: 0.5rem 1rem !important;
  border-radius: 0.5rem;
  transition: all var(--duration-fast) var(--easing);
  position: relative;
  margin: 0 0.25rem;
}

.nav-link-modern:hover {
  color: var(--primary) !important;
  background-color: rgba(27, 94, 104, 0.06);
  transform: translateY(-2px);
}

.nav-link-modern.active {
  color: var(--primary) !important;
  background-color: rgba(27, 94, 104, 0.1);
  font-weight: 600;
}

.nav-link-modern::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 999px;
  transform: translateX(-50%);
  transition: width var(--duration-fast) var(--easing);
}

.nav-link-modern.active::after {
  width: 30%;
}

.nav-icon {
  font-size: 1.1rem;
}

/* ============================================
   MODERN FOOTER
   ============================================ */

.modern-footer {
  background: linear-gradient(135deg, #f5f7f8 0%, #fafbfc 100%);
  border-top: 1px solid var(--border-color);
  color: var(--text-secondary);
  margin-top: auto;
}

.footer-brand {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
}

.footer-link {
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--duration-fast) var(--easing);
  display: inline-block;
}

.footer-link:hover {
  color: var(--primary);
  transform: translateX(2px);
}

.fw-600 {
  font-weight: 600;
}

/* ============================================
   FORM STYLING & FOCUS STATES
   ============================================ */

.form-control,
.form-select {
  border: 2px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  transition: all var(--duration-fast) var(--easing);
  background-color: #ffffff;
}

.form-control::placeholder {
  color: var(--text-light);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(27, 94, 104, 0.1), inset 0 0 0 1px rgba(27, 94, 104, 0.05);
  outline: none;
}

.form-control:hover {
  border-color: var(--primary-light);
}

.form-label {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

/* ============================================
   BUTTON STYLING
   ============================================ */

.btn {
  border-radius: 0.75rem;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  font-size: 1rem;
  border: 2px solid transparent;
  transition: all var(--duration-fast) var(--easing);
  position: relative;
  overflow: hidden;
  letter-spacing: -0.25px;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 3px rgba(27, 94, 104, 0.2);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-outline-secondary {
  border-color: var(--border-color);
  color: var(--primary);
  background-color: transparent;
}

.btn-outline-secondary:hover {
  background-color: rgba(27, 94, 104, 0.08);
  border-color: var(--primary);
  color: var(--primary-dark);
}

.btn-outline-secondary.disabled,
.btn-outline-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Button animations */
.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width var(--duration-normal) var(--easing), height var(--duration-normal) var(--easing);
}

.btn:active::before {
  width: 300px;
  height: 300px;
}

/* ============================================
   FOCUS OUTLINE UTILITIES
   ============================================ */

.btn-link.nav-link:focus {
  outline: none;
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero-section {
  background: linear-gradient(135deg, rgba(27, 94, 104, 0.95) 0%, rgba(18, 63, 71, 0.95) 100%), 
              url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="rgba(255,255,255,0.1)" fill-opacity="1" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,128C672,128,768,160,864,160C960,160,1056,128,1152,128C1248,128,1344,160,1392,176L1440,192L1440,0L1392,0C1344,0,1248,0,1152,0C1056,0,960,0,864,0C768,0,672,0,576,0C480,0,384,0,288,0C192,0,96,0,48,0L0,0Z"/></svg>');
  background-attachment: fixed;
  background-size: cover;
  background-position: center;
  color: #ffffff;
  padding: 3rem 0;
  position: relative;
  overflow: hidden;
  animation: fadeInDown var(--duration-slow) var(--easing);
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 20% 50%, rgba(217, 154, 63, 0.1) 0%, transparent 50%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-title {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.2;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  animation: slideInUp var(--duration-slow) var(--easing) 100ms backwards;
}

.hero-subtitle {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  opacity: 0.95;
  animation: slideInUp var(--duration-slow) var(--easing) 200ms backwards;
}

.hero-actions {
  animation: slideInUp var(--duration-slow) var(--easing) 300ms backwards;
}

/* ============================================
   SEARCH FORM SECTION
   ============================================ */

.search-section {
  margin-top: -2rem;
  position: relative;
  z-index: 10;
  animation: slideInUp var(--duration-slow) var(--easing) 400ms backwards;
}

.search-form {
  background: #ffffff;
  border-radius: 1.5rem;
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(10px);
}

.search-form-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.search-form-group {
  margin-bottom: 1rem;
}

.search-form .form-control {
  font-size: 1rem;
}

.search-form .btn-primary {
  width: 100%;
  padding: 1rem;
  font-size: 1.1rem;
  margin-top: 1.5rem;
}

/* ============================================
   MODERN ROOM CARD
   ============================================ */

.room-card {
  overflow: hidden;
  border: 1px solid #e8ecef;
  border-radius: 1.25rem;
  transition: all var(--duration-normal) var(--easing);
  background: #ffffff;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.room-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(27, 94, 104, 0) 0%, rgba(27, 94, 104, 0.03) 100%);
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity var(--duration-normal) var(--easing));
}

.room-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
  border-color: var(--accent);
}

.room-card:hover::before {
  opacity: 1;
}

.room-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
  border-color: var(--accent);
}

.room-card:hover::before {
  opacity: 1;
}

.room-card__media {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #e0e7eb 0%, #d7e3e7 100%);
}

.room-card__media::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.15) 100%);
  opacity: 0;
  transition: opacity var(--duration-normal) var(--easing));
  z-index: 2;
}

.room-card__image {
  width: 100%;
  height: 210px;
  object-fit: cover;
  display: block;
  transition: transform var(--duration-normal) var(--easing));
}

.room-card:hover .room-card__image {
  transform: scale(1.05);
}

.room-card__price-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: linear-gradient(135deg, rgba(18, 63, 71, 0.95) 0%, rgba(27, 94, 104, 0.85) 100%);
  backdrop-filter: blur(10px);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.2);
  z-index: 3;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.room-card__price-badge small {
  font-weight: 400;
  opacity: 0.85;
  margin-left: 0.15rem;
}

.room-card__gallery-badge {
  position: absolute;
  bottom: 0.75rem;
  right: 0.75rem;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.5) 100%);
  backdrop-filter: blur(8px);
  color: #fff;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  cursor: pointer;
  z-index: 3;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-weight: 600;
  transition: all var(--duration-fast) var(--easing));
}

.room-card__gallery-badge:hover {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.65) 100%);
  transform: scale(1.05);
}

.room-card__strip {
  display: flex;
  gap: 0.4rem;
  padding: 0.5rem;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  background: linear-gradient(135deg, #f5f7f8 0%, #fafbfc 100%);
  scrollbar-width: thin;
}

.room-card__strip img {
  flex: 0 0 auto;
  width: 64px;
  height: 48px;
  object-fit: cover;
  border-radius: 0.4rem;
  scroll-snap-align: start;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--duration-fast) var(--easing));
}

.room-card__strip img:hover {
  border-color: var(--accent);
  transform: scale(1.1);
  box-shadow: var(--shadow-md);
}

.room-card__desc {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #4a5a61;
}

.room-card__rate {
  white-space: nowrap;
  font-weight: 700;
  color: var(--brand-teal);
}

.room-card__rate small {
  display: block;
  font-size: 0.72rem;
  font-weight: 400;
  text-align: right;
}

.room-card__facts {
  display: grid;
  gap: 0.55rem;
  margin: 1rem 0;
}

.room-card__facts div {
  display: flex;
  gap: 0.6rem;
}

.room-card__facts dt {
  min-width: 5rem;
  color: #63727a;
  font-weight: 600;
}

.room-card__facts dd {
  margin: 0;
}

.amenity-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: #eef4f4;
  color: var(--brand-teal-dark);
  border: 1px solid #d7e4e4;
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  font-size: 0.8rem;
  margin: 0 0.35rem 0.35rem 0;
}

.room-card__actions {
  display: flex;
  gap: 0.5rem;
}

.room-detail-carousel .carousel-item {
  height: 380px;
  background: #10333a;
}

.room-detail-carousel .carousel-item img,
.room-detail-carousel .carousel-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.room-detail-carousel .carousel-control-prev,
.room-detail-carousel .carousel-control-next {
  width: 10%;
}

.rate-breakdown {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  text-align: center;
  margin: 1rem 0;
}

.rate-breakdown__item {
  background: #f5f7f8;
  border-radius: 0.75rem;
  padding: 0.75rem 0.5rem;
}

.rate-breakdown__item strong {
  display: block;
  color: var(--brand-teal);
  font-size: 1.1rem;
}

.rate-breakdown__item span {
  font-size: 0.78rem;
  color: #63727a;
}

/* ============================================
   ANIMATIONS & TRANSITIONS
   ============================================ */

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

/* Stagger animation for multiple items */
.room-card {
  animation: scaleIn var(--duration-normal) var(--easing);
}

.room-card:nth-child(1) {
  animation-delay: 0ms;
}

.room-card:nth-child(2) {
  animation-delay: 50ms;
}

.room-card:nth-child(3) {
  animation-delay: 100ms;
}

.room-card:nth-child(n+4) {
  animation-delay: calc((var(--index) - 3) * 50ms);
}

/* Loading state */
.loading {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 1000px 100%;
  animation: shimmer 2s infinite;
}

/* Smooth transitions for main content */
.main-content {
  animation: fadeInDown var(--duration-slow) var(--easing);
}

/* Responsive animations */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================
   LOCAL/CLOUD SYNC STATUS BADGE
   ============================================ */

#sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.6rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  transition: all var(--duration-fast) var(--easing);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#sync-badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#sync-status {
  transition: all var(--duration-normal) var(--easing);
}

/* Spinning animation for syncing state */
@keyframes syncPulse {
  0% {
    opacity: 1;
    transform: rotate(0deg);
  }
  50% {
    opacity: 0.7;
  }
  100% {
    opacity: 1;
    transform: rotate(360deg);
  }
}

#sync-badge.bg-info #sync-icon {
  animation: syncPulse 1.5s linear infinite;
}

/* Success pulse */
@keyframes successPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

#sync-badge.bg-success {
  animation: successPulse 2s ease-in-out;
}

/* Alert pulse for conflicts/errors */
@keyframes alertPulse {
  0%, 100% {
    background-color: var(--bs-danger);
  }
  50% {
    background-color: #dc3545;
  }
}

#sync-badge.bg-danger {
  animation: alertPulse 1s ease-in-out infinite;
}

#sync-machine {
  font-weight: 500;
  letter-spacing: 0.3px;
}
}