:root {
  --background-color: #fafafb;
  --primary-color: #3e4095;
  --primary-hover: #333380;
  --text-color: #333;
  --text-light: #666;
  --border-color: #ddd;
  --error-color: #e74c3c;
  --success-color: #2ecc71;
  --warning-color: #f39c12;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  --sidebar-width: 250px;
  --sidebar-collapsed-width: 70px;
  --header-height: 70px;
  --transition-speed: 0.3s;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
  line-height: 1.6;
}

/* Login Page Styles */
.container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
}

.login-container {
  background-color: white;
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 30px;
  width: 100%;
  max-width: 400px;
}

.logo-container {
  text-align: center;
  margin-bottom: 20px;
}

.logo {
  max-width: 200px;
  height: auto;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: #000;
  font-weight: 600;
}

.form-group {
  margin-bottom: 15px;
}

label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
}

input[type="email"],
input[type="password"],
input[type="text"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 16px;
  transition: border-color 0.3s;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary-color);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 15px;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s;
}

.btn i {
  margin-right: 8px;
}

.btn:active {
  transform: scale(0.98);
}

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

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

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
}

.btn-outline:hover {
  background-color: rgba(62, 64, 149, 0.1);
}

.error-message {
  color: var(--error-color);
  margin-top: 15px;
  text-align: center;
}

.message {
  margin-top: 15px;
  text-align: center;
}

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

/* Dashboard Layout */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background-color: white;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: width var(--transition-speed);
  z-index: 100;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
}

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

.sidebar-logo {
  max-height: 40px;
  transition: opacity var(--transition-speed);
}

.sidebar.collapsed .sidebar-logo {
  opacity: 0;
  width: 0;
}

.toggle-sidebar-btn {
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 15px 0;
}

.sidebar-menu {
  list-style: none;
}

.sidebar-menu-item {
  margin-bottom: 5px;
}

.sidebar-menu-item a {
  display: flex;
  align-items: center;
  padding: 12px 15px;
  color: var(--text-color);
  text-decoration: none;
  transition: background-color 0.3s;
  border-radius: 4px;
  margin: 0 10px;
}

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

.sidebar.collapsed .sidebar-menu-item a span {
  display: none;
}

.sidebar-menu-item a:hover {
  background-color: rgba(62, 64, 149, 0.1);
}

.sidebar-menu-item.active a {
  background-color: var(--primary-color);
  color: white;
}

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

.sidebar.collapsed .sidebar-footer .user-info span,
.sidebar.collapsed .sidebar-footer .btn span {
  display: none;
}

.sidebar.collapsed .sidebar-footer .btn {
  width: 40px;
  justify-content: center;
}

.sidebar.collapsed .sidebar-footer .btn i {
  margin-right: 0;
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  transition: margin-left var(--transition-speed);
}

.sidebar.collapsed ~ .main-content {
  margin-left: var(--sidebar-collapsed-width);
}

.main-header {
  height: var(--header-height);
  background-color: white;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}

.header-title h1 {
  font-size: 24px;
  margin: 0;
}

main {
  padding: 20px;
  max-width: 1400px;
  margin: 0 auto;
}

/* Properties Container */
.properties-container {
  background-color: white;
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 20px;
}

.properties-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.property-card {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
  background-color: white;
}

.property-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.property-image {
  height: 200px;
  background-color: #f0f0f0;
  background-size: cover;
  background-position: center;
}

.property-info {
  padding: 15px;
}

.property-title {
  font-size: 18px;
  margin-bottom: 10px;
  color: #000;
}

.property-price {
  font-weight: bold;
  font-size: 20px;
  margin-bottom: 10px;
  color: var(--primary-color);
}

.property-address {
  color: var(--text-light);
  margin-bottom: 10px;
  font-size: 14px;
}

.property-details {
  display: flex;
  margin-bottom: 10px;
  color: var(--text-light);
  font-size: 14px;
}

.property-detail {
  display: flex;
  align-items: center;
  margin-right: 15px;
}

.property-detail i {
  margin-right: 5px;
}

.property-status {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12px;
  margin-bottom: 10px;
}

.status-pending {
  background-color: var(--warning-color);
  color: white;
}

.status-published {
  background-color: var(--success-color);
  color: white;
}

.property-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

/* Modal styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background-color: white;
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 30px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.property-form-modal {
  max-width: 90%;
  width: 1000px;
}

.modal-title {
  margin-bottom: 20px;
  color: #000;
}

.close-btn,
.close-user-form-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-light);
  transition: color 0.3s;
}

.close-btn:hover,
.close-user-form-btn:hover {
  color: var(--text-color);
}

/* Form Tabs */
.form-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 20px;
  overflow-x: auto;
}

.form-tab {
  padding: 10px 15px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-weight: 500;
  color: var(--text-light);
  transition: all 0.3s;
}

.form-tab:hover {
  color: var(--primary-color);
}

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

.form-tab-content {
  display: none;
  padding: 15px 0;
}

.form-tab-content .form-group {
  margin-bottom: 20px;
}

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

/* Form Layout */
.form-row {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
}

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

.checkbox-group {
  display: flex;
  align-items: center;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
  margin-right: 8px;
  width: auto;
}

.amenities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
}

/* Users Table */
.users-container {
  width: 100%;
}

.users-list-container {
  margin-top: 20px;
  overflow-x: auto;
}

.users-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

.users-table th,
.users-table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.users-table th {
  background-color: #f8f9fa;
  font-weight: 600;
  color: #000;
}

.users-table tr:hover {
  background-color: #f8f9fa;
}

.users-table .btn {
  margin-right: 5px;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-light);
}

.empty-state p {
  margin-bottom: 20px;
}

/* File Upload Styles */
.file-upload-container {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.file-input {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  width: 0.1px;
  height: 0.1px;
  overflow: hidden;
}

.file-upload-label {
  display: inline-flex;
  align-items: center;
  padding: 8px 15px;
  background-color: var(--primary-color);
  color: white;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.3s;
}

.file-upload-label:hover {
  background-color: var(--primary-hover);
}

.file-upload-label i {
  margin-right: 8px;
}

.file-name {
  margin-left: 10px;
  font-size: 14px;
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.image-preview {
  margin-top: 10px;
  width: 100%;
  max-height: 200px;
  overflow: hidden;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  background-color: #f8f9fa;
  display: flex;
  justify-content: center;
  align-items: center;
}

.image-preview img {
  max-width: 100%;
  max-height: 200px;
  object-fit: contain;
}

.gallery-preview {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
}

.gallery-item {
  position: relative;
  height: 100px;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

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

.gallery-item .remove-image {
  position: absolute;
  top: 5px;
  right: 5px;
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 10px;
}

.gallery-item .remove-image:hover {
  background-color: rgba(0, 0, 0, 0.7);
}

/* Loading indicator */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #f3f3f3;
  border-top: 5px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Responsive styles */
@media (max-width: 992px) {
  .sidebar {
    width: var(--sidebar-collapsed-width);
  }

  .sidebar .sidebar-logo {
    opacity: 0;
    width: 0;
  }

  .sidebar .sidebar-menu-item a span {
    display: none;
  }

  .sidebar .sidebar-footer .user-info span,
  .sidebar .sidebar-footer .btn span {
    display: none;
  }

  .sidebar .sidebar-footer .btn {
    width: 40px;
    justify-content: center;
  }

  .sidebar .sidebar-footer .btn i {
    margin-right: 0;
  }

  .main-content {
    margin-left: var(--sidebar-collapsed-width);
  }

  .sidebar.expanded {
    width: var(--sidebar-width);
    position: fixed;
    z-index: 1000;
  }

  .sidebar.expanded .sidebar-logo {
    opacity: 1;
    width: auto;
  }

  .sidebar.expanded .sidebar-menu-item a span {
    display: inline;
  }

  .sidebar.expanded .sidebar-footer .user-info span,
  .sidebar.expanded .sidebar-footer .btn span {
    display: inline;
  }

  .sidebar.expanded .sidebar-footer .btn {
    width: auto;
  }

  .sidebar.expanded .sidebar-footer .btn i {
    margin-right: 8px;
  }
}

@media (max-width: 768px) {
  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .property-form-modal {
    max-width: 95%;
  }

  .amenities-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .main-header {
    flex-direction: column;
    height: auto;
    padding: 15px;
    gap: 10px;
  }

  .header-actions {
    width: 100%;
  }

  .header-actions .btn {
    width: 100%;
  }

  .file-upload-container {
    flex-direction: column;
    align-items: flex-start;
  }

  .file-name {
    margin-left: 0;
    margin-top: 5px;
    max-width: 100%;
  }

  .gallery-preview {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  }
}

@media (max-width: 576px) {
  .properties-list {
    grid-template-columns: 1fr;
  }

  .modal-content {
    max-width: 95%;
    padding: 20px;
  }

  .form-tabs {
    flex-wrap: wrap;
  }

  .form-tab {
    flex: 1;
    text-align: center;
    font-size: 14px;
    padding: 8px;
  }
}
