@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg-color: #0c0d0e;
  --panel-bg: #121316;
  --sidebar-bg: #090a0c;
  --border-color: rgba(255, 255, 255, 0.06);
  --border-focus: rgba(99, 102, 241, 0.4);
  
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dark: #6b7280;
  
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.25);
  
  --accent-green: #10b981;
  --accent-green-bg: rgba(16, 185, 129, 0.1);
  --accent-gold: #f59e0b;
  --accent-gold-bg: rgba(245, 158, 11, 0.1);
  --accent-red: #ef4444;
  --accent-red-bg: rgba(239, 68, 68, 0.1);
  
  --glass-bg: rgba(18, 19, 22, 0.7);
  --glass-blur: blur(16px);
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --card-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.7);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Outfit', sans-serif;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  overflow: hidden;
}

/* SIDEBAR BÊN TRÁI CỐ ĐỊNH */
.sidebar {
  width: 260px;
  background-color: var(--sidebar-bg);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100vh;
  flex-shrink: 0;
  z-index: 50;
}

.brand-section {
  padding: 30px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-color);
}

.brand-logo {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), #a855f7);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  color: white;
  box-shadow: 0 0 20px var(--primary-glow);
}

.brand-name {
  font-size: 18px;
  font-weight: 700;
  background: linear-gradient(to right, #ffffff, #d1d5db);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0.5px;
}

.sidebar-menu {
  list-style: none;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.menu-item a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  font-size: 15px;
  transition: var(--transition-smooth);
}

.menu-item a i {
  font-size: 18px;
  width: 20px;
  text-align: center;
}

.menu-item:hover a,
.menu-item.active a {
  color: white;
  background-color: rgba(255, 255, 255, 0.04);
}

.menu-item.active a {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.15) 0%, rgba(99, 102, 241, 0.02) 100%);
  border-left: 3px solid var(--primary);
  padding-left: 13px;
}

.sidebar-footer {
  padding: 20px 16px;
  border-top: 1px solid var(--border-color);
}

.hotline-box {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(168, 85, 247, 0.08) 100%);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

.hotline-title {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.hotline-num {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent-gold);
}

/* MAIN CONTENT CONTAINER */
.main-content {
  flex-grow: 1;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-color);
  position: relative;
  overflow: hidden;
}

/* HEADER BAR */
.header-bar {
  height: 70px;
  border-bottom: 1px solid var(--border-color);
  padding: 0 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  z-index: 10;
  background-color: rgba(12, 13, 14, 0.5);
  backdrop-filter: blur(10px);
}

.page-title {
  font-size: 18px;
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
}

.btn-secondary {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  transition: var(--transition-smooth);
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* LEONARDO AI STYLE HERO VIEW */
.content-scroller {
  flex-grow: 1;
  overflow-y: auto;
  padding: 30px;
  position: relative;
}

.hero-banner {
  height: 340px;
  border-radius: 24px;
  position: relative;
  overflow: hidden;
  margin-bottom: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: var(--card-shadow);
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(12, 13, 14, 0.1), rgba(12, 13, 14, 0.95)), 
              url('https://images.unsplash.com/photo-1580587771525-78b9dba3b914?q=80&w=1200') no-repeat center center;
  background-size: cover;
  filter: brightness(0.65) contrast(1.1);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  width: 100%;
  max-width: 760px;
  padding: 0 20px;
}

.hero-title {
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 12px;
  text-transform: uppercase;
  background: linear-gradient(135deg, #ffffff 30%, var(--text-muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 30px;
  letter-spacing: 0.5px;
}

/* DÒNG PROMPT/CHAT NGANG LỚN CHÍNH GIỮA BANNER */
.hero-search-box {
  width: 100%;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  padding: 8px 8px 8px 24px;
  border-radius: 30px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition-smooth);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.hero-search-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 25px rgba(99, 102, 241, 0.15), 0 20px 40px rgba(0, 0, 0, 0.5);
}

.hero-search-box i.search-icon {
  font-size: 20px;
  color: var(--primary);
}

.hero-search-box input {
  flex-grow: 1;
  background: transparent;
  border: none;
  outline: none;
  color: white;
  font-size: 16px;
  height: 48px;
}

.hero-search-box input::placeholder {
  color: var(--text-dark);
}

.btn-generate {
  background: linear-gradient(135deg, var(--primary) 0%, #a855f7 100%);
  border: none;
  color: white;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-generate:hover {
  transform: scale(1.05) rotate(5deg);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.6);
}

/* GRID HIỂN THỊ VILLA */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.section-title {
  font-size: 22px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title i {
  color: var(--primary);
}

.villas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.villa-card {
  background-color: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition-smooth);
  box-shadow: var(--card-shadow);
}

.villa-card:hover {
  transform: translateY(-8px);
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.8), 0 0 15px rgba(99, 102, 241, 0.1);
}

.card-image-box {
  width: 100%;
  height: 180px;
  position: relative;
  overflow: hidden;
  background-color: #1a1b1f;
}

.card-image-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-smooth);
}

.villa-card:hover .card-image-box img {
  transform: scale(1.08);
}

.card-location-tag {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(12, 13, 14, 0.75);
  backdrop-filter: blur(4px);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-location-tag i {
  color: var(--primary);
}

.card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-grow: 1;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: white;
  line-height: 1.4;
  height: 44px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-specs {
  display: flex;
  gap: 12px;
  font-size: 13px;
  color: var(--text-muted);
}

.spec-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.spec-item i {
  color: var(--primary);
}

.card-amenities {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.amenity-badge {
  font-size: 11px;
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 4px;
}

.card-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.01);
}

.price-box {
  display: flex;
  flex-direction: column;
}

.price-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.price-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-green);
}

.price-note {
  font-size: 9px;
  color: var(--text-dark);
}

/* CHATBOT DIALOGSPLIT VIEW (Khi thực hiện chat) */
.chat-split-container {
  display: none; /* Mặc định ẩn, hiện lên khi bắt đầu chat */
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 30;
  background-color: var(--bg-color);
}

.chat-split-layout {
  display: flex;
  width: 100%;
  height: 100%;
}

/* Phần trái: Hội thoại Chat */
.chat-left-pane {
  width: 50%;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: var(--sidebar-bg);
}

.chat-history {
  flex-grow: 1;
  overflow-y: auto;
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.chat-bubble {
  max-width: 85%;
  padding: 16px 20px;
  border-radius: 16px;
  line-height: 1.6;
  font-size: 15px;
}

.chat-bubble.user {
  background-color: var(--primary);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.2);
}

.chat-bubble.ai {
  background-color: var(--panel-bg);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.chat-bubble p {
  margin-bottom: 8px;
}
.chat-bubble p:last-child {
  margin-bottom: 0;
}
.chat-bubble strong {
  color: var(--accent-gold);
}

.chat-input-bar {
  padding: 20px 30px;
  border-top: 1px solid var(--border-color);
  background-color: var(--sidebar-bg);
}

.chat-input-box {
  background-color: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  display: flex;
  padding: 6px 6px 6px 20px;
  align-items: center;
  gap: 12px;
}

.chat-input-box input {
  flex-grow: 1;
  background: transparent;
  border: none;
  outline: none;
  color: white;
  font-size: 15px;
  height: 38px;
}

/* Phần phải: Gợi ý Villa bằng ảnh */
.chat-right-pane {
  width: 50%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.suggestions-header {
  padding: 24px 30px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.suggestions-title {
  font-size: 18px;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  gap: 8px;
}

.suggestions-title i {
  color: var(--accent-green);
}

.suggestions-grid {
  flex-grow: 1;
  overflow-y: auto;
  padding: 30px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  align-content: start;
}

.btn-close-chat {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 20px;
  transition: var(--transition-smooth);
}

.btn-close-chat:hover {
  color: white;
  transform: scale(1.1);
}

/* ADMIN PANEL DESIGN */
.admin-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 0;
}

.admin-tabs-nav {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 30px;
  gap: 10px;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  border-bottom: 2px solid transparent;
}

.tab-btn:hover {
  color: white;
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.admin-tab-content {
  display: none;
}

.admin-tab-content.active {
  display: block;
}

/* Card Panel dùng chung */
.admin-card {
  background-color: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--card-shadow);
}

.card-header-admin {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
  color: white;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-header-admin i {
  color: var(--primary);
}

/* Forms */
.form-group {
  margin-bottom: 20px;
}

.form-row {
  display: flex;
  gap: 20px;
}

.form-row .form-group {
  flex: 1;
}

label {
  display: block;
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 500;
}

input[type="text"],
input[type="number"],
input[type="url"],
select,
textarea {
  width: 100%;
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 16px;
  color: white;
  font-size: 14px;
  outline: none;
  transition: var(--transition-smooth);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.1);
}

textarea {
  resize: vertical;
  min-height: 100px;
}

/* Upload zone */
.upload-dropzone {
  border: 2px dashed var(--border-color);
  border-radius: 12px;
  padding: 30px;
  text-align: center;
  cursor: pointer;
  background-color: rgba(255, 255, 255, 0.01);
  transition: var(--transition-smooth);
}

.upload-dropzone:hover {
  border-color: var(--primary);
  background-color: rgba(99, 102, 241, 0.02);
}

.upload-dropzone i {
  font-size: 32px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.upload-dropzone p {
  font-size: 14px;
  color: var(--text-muted);
}

/* Bảng hiển thị quản trị */
.admin-table-container {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th, td {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
}

th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

td {
  font-size: 15px;
}

.table-villa-img {
  width: 50px;
  height: 50px;
  border-radius: 6px;
  object-fit: cover;
  background-color: #1a1b1f;
}

/* Badges trạng thái */
.status-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.status-badge.sync-ok {
  background-color: var(--accent-green-bg);
  color: var(--accent-green);
}

.status-badge.sync-err {
  background-color: var(--accent-red-bg);
  color: var(--accent-red);
}

.status-badge.sync-none {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}

/* Action buttons */
.actions-cell {
  display: flex;
  gap: 8px;
}

.btn-action {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 34px;
  height: 34px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-action:hover {
  color: white;
  background-color: rgba(255, 255, 255, 0.05);
}

.btn-action.delete:hover {
  color: white;
  background-color: var(--accent-red);
  border-color: var(--accent-red);
}

.btn-action.sync:hover {
  color: white;
  background-color: var(--accent-green);
  border-color: var(--accent-green);
}

/* File list RAG */
.rag-files-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.rag-file-item {
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.file-info i {
  font-size: 20px;
  color: var(--primary);
}

.file-name {
  font-weight: 500;
  font-size: 14px;
}

.file-date {
  font-size: 12px;
  color: var(--text-dark);
}

/* Modal styling */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 100;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background-color: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  width: 100%;
  max-width: 600px;
  padding: 30px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.9);
  position: relative;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.modal-content form {
  overflow-y: auto;
  padding-right: 8px;
  max-height: calc(90vh - 110px);
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 22px;
  color: var(--text-muted);
  cursor: pointer;
  background: transparent;
  border: none;
  transition: var(--transition-smooth);
}

.modal-close:hover {
  color: white;
}

.modal-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 24px;
  color: white;
}

/* Loading animations */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255,255,255,.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
