/* ===================================
   Hotel Management System - Custom Styles
   =================================== */

/* Material Symbols configuration */
.material-symbols-outlined {
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
}

.material-symbols-outlined.filled {
  font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background-color: #dbe6e2;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background-color: #a0b5ac;
}

/* Hide scrollbar for categories */
.hide-scrollbar::-webkit-scrollbar {
  display: none;
}

.hide-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Animation utilities */
.transition-all {
  transition-property: all;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 200ms;
}

/* Card hover effect */
.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
}

/* Heart button animation */
.heart-btn {
  transition: transform 0.2s ease;
}

.heart-btn:hover {
  transform: scale(1.15);
}

.heart-btn:active {
  transform: scale(0.95);
}

/* Image zoom on hover */
.image-zoom {
  transition: transform 0.5s ease-out;
}

.group:hover .image-zoom {
  transform: scale(1.05);
}

/* Loading spinner */
.spinner {
  border: 3px solid #f3f3f3;
  border-top: 3px solid #2beead;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Toast notifications */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 16px 24px;
  border-radius: 12px;
  color: white;
  font-weight: 500;
  z-index: 9999;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.success {
  background-color: #10b981;
}

.toast.error {
  background-color: #ef4444;
}

.toast.info {
  background-color: #3b82f6;
}

/* Modal backdrop */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(17, 24, 22, 0.5);
  backdrop-filter: blur(4px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-backdrop.show {
  opacity: 1;
  visibility: visible;
}

/* Star rating */
.star-rating {
  display: flex;
  gap: 4px;
}

.star-rating .star {
  cursor: pointer;
  transition: color 0.2s ease;
}

.star-rating .star.active {
  color: #fbbf24;
}

/* Amenity buttons */
.amenity-btn {
  transition: all 0.2s ease;
}

.amenity-btn.selected {
  border-color: #2beead;
  background-color: rgba(43, 238, 173, 0.1);
}

.amenity-btn.selected .material-symbols-outlined {
  color: #2beead;
}

/* Pagination */
.pagination-btn {
  transition: all 0.2s ease;
}

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

.pagination-btn.active {
  background-color: #2beead;
  color: #111816;
}

/* Form focus states */
input:focus,
select:focus,
textarea:focus {
  outline: none;
  box-shadow: 0 0 0 2px #2beead;
  border-color: #2beead;
}

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 24px;
  text-align: center;
}

.empty-state .icon {
  font-size: 64px;
  color: #61897c;
  margin-bottom: 16px;
}

/* Badge styles */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
}

.badge-available {
  background-color: rgba(43, 238, 173, 0.2);
  color: #0d7d5f;
}

.badge-full {
  background-color: rgba(239, 68, 68, 0.2);
  color: #dc2626;
}

/* ===================================
   Chatbot Widget Styles
   =================================== */

/* Widget Container */
.chatbot-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9998;
  font-family: "Plus Jakarta Sans", sans-serif;
}

/* Toggle Button */
.chatbot-toggle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2beead 0%, #1ebf9f 100%);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(43, 238, 173, 0.4);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chatbot-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 30px rgba(43, 238, 173, 0.5);
}

.chatbot-toggle .material-symbols-outlined {
  font-size: 28px;
  color: #10221c;
}

.chatbot-toggle .close-icon {
  display: none;
}

.chatbot-toggle.active .chat-icon {
  display: none;
}

.chatbot-toggle.active .close-icon {
  display: block;
}

/* Chat Window */
.chat-window {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 380px;
  max-width: calc(100vw - 48px);
  height: 500px;
  max-height: calc(100vh - 140px);
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.9) translateY(20px);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-window.show {
  transform: scale(1) translateY(0);
  opacity: 1;
  visibility: visible;
}

/* Dark mode support */
.dark .chat-window {
  background: #10221c;
  border: 1px solid #2a453c;
}

/* Chat Header */
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: linear-gradient(135deg, #2beead 0%, #1ebf9f 100%);
  color: #10221c;
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-avatar .material-symbols-outlined {
  font-size: 24px;
  color: #10221c;
}

.chat-header h4 {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
}

.chat-status {
  font-size: 12px;
  opacity: 0.8;
}

.chat-close-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease;
}

.chat-close-btn:hover {
  background: rgba(255, 255, 255, 0.4);
}

.chat-close-btn .material-symbols-outlined {
  font-size: 20px;
  color: #10221c;
}

/* Chat Messages Area */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #f8faf9;
}

.dark .chat-messages {
  background: #0d1a16;
}

/* Individual Message */
.chat-message {
  display: flex;
  gap: 10px;
  max-width: 85%;
}

.chat-message.user-message {
  flex-direction: row-reverse;
  align-self: flex-end;
}

.chat-message.bot-message {
  align-self: flex-start;
}

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bot-message .message-avatar {
  background: linear-gradient(135deg, #2beead 0%, #1ebf9f 100%);
}

.bot-message .message-avatar .material-symbols-outlined {
  font-size: 18px;
  color: #10221c;
}

.user-message .message-avatar {
  background: #717171;
}

.user-message .message-avatar .material-symbols-outlined {
  font-size: 18px;
  color: white;
}

.message-content {
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
}

.bot-message .message-content {
  background: #ffffff;
  color: #222222;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.dark .bot-message .message-content {
  background: #1a2f29;
  color: #e5e5e5;
}

.user-message .message-content {
  background: linear-gradient(135deg, #2beead 0%, #1ebf9f 100%);
  color: #10221c;
  border-bottom-right-radius: 4px;
}

.message-content p {
  margin: 0;
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  background: #2beead;
  border-radius: 50%;
  animation: typing 1.4s infinite both;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-6px);
    opacity: 1;
  }
}

/* Chat Input */
.chat-input-container {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid #e5e7eb;
  background: #ffffff;
}

.dark .chat-input-container {
  border-top-color: #2a453c;
  background: #10221c;
}

.chat-input-container input {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 24px;
  padding: 12px 18px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  background: #f8faf9;
}

.dark .chat-input-container input {
  background: #0d1a16;
  border-color: #2a453c;
  color: #e5e5e5;
}

.chat-input-container input:focus {
  border-color: #2beead;
  box-shadow: 0 0 0 3px rgba(43, 238, 173, 0.15);
}

.chat-send-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2beead 0%, #1ebf9f 100%);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.chat-send-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(43, 238, 173, 0.4);
}

.chat-send-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.chat-send-btn .material-symbols-outlined {
  font-size: 20px;
  color: #10221c;
}

/* Tablet Responsive */
@media (max-width: 640px) {
  .chatbot-widget {
    bottom: 20px;
    right: 20px;
  }

  .chatbot-toggle {
    width: 56px;
    height: 56px;
  }

  .chatbot-toggle .material-symbols-outlined {
    font-size: 26px;
  }

  .chat-window {
    width: 340px;
    max-width: calc(100vw - 40px);
    height: 480px;
    max-height: calc(100vh - 120px);
  }
}

/* Mobile Responsive */
@media (max-width: 480px) {
  .chatbot-widget {
    bottom: 0;
    right: 0;
    left: 0;
    display: flex;
    justify-content: flex-end;
    padding: 12px;
  }

  .chatbot-widget.chat-open {
    padding: 0;
  }

  .chatbot-toggle {
    width: 52px;
    height: 52px;
    box-shadow: 0 4px 16px rgba(43, 238, 173, 0.35);
  }

  .chatbot-toggle .material-symbols-outlined {
    font-size: 24px;
  }

  /* Fullscreen chat on mobile */
  .chat-window {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
    z-index: 9999;
  }

  .chat-header {
    padding: 14px 16px;
    padding-top: calc(14px + env(safe-area-inset-top, 0px));
  }

  .chat-avatar {
    width: 36px;
    height: 36px;
  }

  .chat-avatar .material-symbols-outlined {
    font-size: 22px;
  }

  .chat-header h4 {
    font-size: 15px;
  }

  .chat-status {
    font-size: 11px;
  }

  .chat-messages {
    padding: 16px;
    gap: 14px;
  }

  .chat-message {
    max-width: 88%;
  }

  .message-avatar {
    width: 28px;
    height: 28px;
  }

  .message-avatar .material-symbols-outlined {
    font-size: 16px;
  }

  .message-content {
    padding: 10px 14px;
    font-size: 14px;
    border-radius: 14px;
  }

  .bot-message .message-content {
    border-bottom-left-radius: 4px;
  }

  .user-message .message-content {
    border-bottom-right-radius: 4px;
  }

  .chat-input-container {
    padding: 12px 16px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    gap: 8px;
  }

  .chat-input-container input {
    padding: 10px 16px;
    font-size: 16px; /* Prevent zoom on iOS */
    border-radius: 22px;
  }

  .chat-send-btn {
    width: 42px;
    height: 42px;
  }

  .chat-send-btn .material-symbols-outlined {
    font-size: 18px;
  }
}

/* Extra small devices */
@media (max-width: 360px) {
  .chat-header h4 {
    font-size: 14px;
  }

  .chat-status {
    font-size: 10px;
  }

  .message-content {
    padding: 8px 12px;
    font-size: 13px;
  }

  .chat-input-container input {
    padding: 8px 14px;
  }

  .chat-send-btn {
    width: 38px;
    height: 38px;
  }
}

/* ===================================
   Loading Page Styles
   =================================== */

/* Loading Page Overlay */
.loading-page {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #10221c 0%, #1a3830 50%, #10221c 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-page.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Loading Content */
.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Animated Logo */
.loading-logo {
  width: 100px;
  height: 100px;
  background: linear-gradient(135deg, #2beead 0%, #1ebf9f 100%);
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  animation: logoPulse 2s ease-in-out infinite;
  box-shadow: 0 0 60px rgba(43, 238, 173, 0.4);
  will-change: transform, box-shadow;
}

.loading-icon {
  font-size: 48px !important;
  color: #10221c;
}

@keyframes logoPulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 60px rgba(43, 238, 173, 0.4);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 80px rgba(43, 238, 173, 0.6);
  }
}

/* Brand Name */
.loading-brand {
  font-size: 32px;
  font-weight: 800;
  color: #2beead;
  letter-spacing: -1px;
  margin: 0 0 32px 0;
}

/* Loading Bar */
.loading-spinner-container {
  width: 200px;
  margin-bottom: 20px;
}

.loading-bar {
  width: 100%;
  height: 4px;
  background: rgba(43, 238, 173, 0.2);
  border-radius: 4px;
  overflow: hidden;
}

.loading-bar-progress {
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, #2beead, #1ebf9f);
  border-radius: 4px;
  animation: loadingProgress 1.5s ease-in-out infinite;
  will-change: width, margin-left;
}

@keyframes loadingProgress {
  0% {
    width: 0%;
    margin-left: 0%;
  }
  50% {
    width: 60%;
    margin-left: 20%;
  }
  100% {
    width: 0%;
    margin-left: 100%;
  }
}

/* Loading Text */
.loading-text {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
  animation: textFade 2s ease-in-out infinite;
}

@keyframes textFade {
  0%,
  100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}

/* Light mode support */
.light .loading-page {
  background: linear-gradient(135deg, #f8faf9 0%, #e8f5f0 50%, #f8faf9 100%);
}

.light .loading-brand {
  color: #10221c;
}

.light .loading-text {
  color: rgba(16, 34, 28, 0.6);
}

.light .loading-bar {
  background: rgba(43, 238, 173, 0.3);
}

/* ===================================
   Mobile Performance Optimizations
   =================================== */

/* Respect user's reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .loading-logo,
  .loading-bar-progress,
  .loading-text {
    animation: none !important;
  }
}

/* Simpler animations on mobile for better performance */
@media (max-width: 768px) {
  /* Disable hover effects on touch devices */
  .card-hover:hover {
    transform: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  }

  .group:hover .image-zoom {
    transform: none;
  }

  /* Faster transitions on mobile */
  .transition-all {
    transition-duration: 150ms;
  }

  /* Improve touch responsiveness */
  button,
  a,
  select,
  input {
    touch-action: manipulation;
  }

  /* Remove will-change on mobile to save memory */
  .loading-logo,
  .loading-bar-progress {
    will-change: auto;
  }
}

/* Optimize for slow connections */
@media (prefers-reduced-data: reduce) {
  .image-zoom {
    transition: none;
  }
}
