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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.2;
  color: #333;
  background-color: #f8f9fa;
}

.container {
  display: flex;
  min-height: 100vh;
}

/* Content */
.content {
  flex: 1;
  padding: 12px 18px;
  background-color: #f8f9fa;
}

h1 {
  margin-bottom: 1%;
  color: #2c3e50;
  font-weight: 500;
  font-size: 1.5rem;
  border-bottom: 2px solid #3498db;
  padding-bottom: 6px;
  display: inline-block;
}

/* Tables */
.data-table-container {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  padding: 20px;
  margin-bottom: 30px;
  width: 100%;
}

.action-bar {
  margin-bottom: 20px;
  text-align: right;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.action-bar h2 {
  font-size: 1.2rem;
  color: #2c3e50;
  margin: 0;
}

.actions {
  white-space: nowrap;
}

.actions .btn-icon {
  margin-right: 8px;
  font-size: 1rem;
}

.actions .btn-icon:last-child {
  margin-right: 0;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  table-layout: fixed;
}

.data-table th,
.data-table td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid #eee;
  vertical-align: middle;
}

.data-table th {
  background-color: #f8f9fa;
  font-weight: 600;
  color: #2c3e50;
  position: relative;
  border-bottom: 2px solid #3498db;
}

.data-table tr:hover {
  background-color: #f5f9ff;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table .btn-icon {
  padding: 4px 8px;
  font-size: 0.85rem;
}

.data-table .actions {
  display: flex;
  gap: 5px;
  align-items: center;
}

.data-table tr {
  line-height: 1.4;
}

.data-table {
  font-size: 0.9rem;
}

/* Buttons and Icons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  background: #3498db;
  color: #fff;
  text-decoration: none;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  height: 38px;
  line-height: 1;
}

.btn:hover {
  background: #2980b9;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  color: #fff;
  text-decoration: none;
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
}

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

.btn-primary {
  background: linear-gradient(to right, #3498db, #2980b9);
}

/* Thêm style cho nút cancel dạng button */
.btn-cancel {
  background: #f8f9fa;
  color: #333;
  border: 1px solid #ddd;
}

.btn-cancel:hover {
  background: #e9ecef;
  color: #212529;
}

.btn-outline:hover {
  background: #3498db;
  color: white;
}

/* Icon buttons in tables */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
  font-size: 14px;
  margin: 0 2px;
}

.btn-icon:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* View button */
.view-btn {
  background-color: #3498db;
  color: white;
}

.view-btn:hover {
  background-color: #2980b9;
  color: white;
}

/* Edit button */
.edit-btn {
  background-color: #f39c12;
  color: white;
}

.edit-btn:hover {
  background-color: #e67e22;
  color: white;
}

/* Delete button */
.delete-btn {
  background-color: #e74c3c;
  color: white;
}

.delete-btn:hover {
  background-color: #c0392b;
  color: white;
}

/* Inline form for delete buttons */
.inline-form {
  display: inline-block;
  margin: 0;
}

/* Forms */
.form-container {
  max-width: 600px;
  margin: 0 auto;
  background-color: #fff;
  padding: 25px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

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

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #2c3e50;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  transition: border 0.3s;
  font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 100;
  }

  .content {
    padding: 20px;
  }
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 40px 0;
  color: #7f8c8d;
}

.empty-state > i {
  font-size: 3rem;
  margin-bottom: 15px;
  color: #bdc3c7;
}

.empty-state > p {
  font-size: 1.1rem;
}

/* Action bar with multiple buttons */
.action-bar div {
  display: flex;
  gap: 10px;
}

/* Password match message */
.password-match-message {
  margin-top: 5px;
  font-size: 0.9rem;
}

.password-match-message.success {
  color: #2ecc71;
}

.password-match-message.error {
  color: #e74c3c;
}

/* Error pages */
.error-container {
  text-align: center;
  padding: 50px 20px;
}

.error-code {
  font-size: 8rem;
  font-weight: 700;
  color: #e74c3c;
  margin-bottom: 20px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.error-container h1 {
  font-size: 2rem;
  color: #2c3e50;
  margin-bottom: 20px;
  border: none;
}

.error-container p {
  font-size: 1.1rem;
  color: #7f8c8d;
  margin-bottom: 30px;
}

/* Giữ nguyên style cho input thông thường */
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  transition: border 0.3s;
  font-size: 14px;
}

/* Style riêng cho checkbox */
.form-group input[type="checkbox"] {
  width: auto;
  margin-right: 8px;
  vertical-align: middle;
}

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

.checkbox-container label {
  margin-bottom: 0;
  margin-left: 8px;
}

/* Toggle Switch */
.form-group label.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
  margin-right: 10px;
  margin-bottom: 0px;
}

.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: #ccc;
  transition: .4s;
  border-radius: 24px;
}

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

input:checked+.toggle-slider {
  background-color: #3498db;
}

input:focus+.toggle-slider {
  box-shadow: 0 0 1px #3498db;
}

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

.toggle-container {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}

.toggle-label {
  font-weight: 500;
  color: #2c3e50;
  cursor: pointer;
}

/* Search bar */
.search-bar {
  margin-bottom: 20px;
  display: flex;
  align-items: center;
}

.search-bar form {
  display: flex;
  width: 100%;
  max-width: 600px;
}

.search-bar input[type="text"] {
  flex: 1;
  padding: 8px 16px;
  border: 1px solid #ddd;
  border-radius: 4px 0 0 4px;
  font-size: 14px;
  height: 40px;
}

.search-bar input[type="text"]:focus {
  border-color: #3498db;
  outline: none;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.btn-search {
  background: #3498db;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-search:hover {
  background: #2980b9;
}

.btn-search i {
  font-size: 14px;
}

/* Detail Pages Common Styles */
.detail-section {
  margin-bottom: 30px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  padding: 20px;
}

.detail-section h3 {
  margin-top: 0;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
  color: #2c3e50;
  font-size: 1.1rem;
  font-weight: 600;
}

.detail-section h3 i {
  margin-right: 8px;
  color: #3498db;
}

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

.detail-item {
  margin-bottom: 10px;
}

.detail-label {
  display: block;
  font-weight: bold;
  margin-bottom: 5px;
  color: #7f8c8d;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-value {
  display: block;
  font-size: 16px;
  color: #2c3e50;
  line-height: 1.4;
}

/* Responsive design for detail pages */
@media (max-width: 768px) {
  .detail-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .detail-section {
    padding: 15px;
    margin-bottom: 20px;
  }

  .detail-value {
    font-size: 14px;
  }
}

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

.modal-content {
  background-color: white;
  margin: 5% auto;
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #eee;
}

.modal-header h3 {
  margin: 0;
  color: #2c3e50;
}

.close {
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  color: #aaa;
}

.close:hover {
  color: #000;
}

.modal-body {
  padding: 20px;
}

.avatar-upload-area {
  border: 2px dashed #ddd;
  border-radius: 8px;
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.3s;
}

.avatar-upload-area:hover {
  border-color: #3498db;
}

.avatar-upload-area.dragover {
  border-color: #3498db;
  background-color: #f8f9fa;
}

.upload-placeholder i {
  font-size: 48px;
  color: #bdc3c7;
  margin-bottom: 15px;
}

.upload-placeholder p {
  font-size: 16px;
  color: #7f8c8d;
  margin-bottom: 5px;
}

.upload-placeholder small {
  color: #95a5a6;
}

.avatar-preview {
  text-align: center;
}

.avatar-preview img {
  max-width: 200px;
  max-height: 200px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.preview-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* Detail container styles */
.detail-container {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  margin-bottom: 30px;
}

.detail-header {
  padding: 20px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.detail-actions {
  display: flex;
  gap: 10px;
}

.detail-section {
  padding: 20px;
  border-bottom: 1px solid #eee;
}

.detail-section:last-child {
  border-bottom: none;
}

.detail-section h2 {
  margin-top: 0;
  margin-bottom: 15px;
  color: #2c3e50;
  font-size: 1.2rem;
  font-weight: 600;
}

.detail-row {
  display: flex;
  margin-bottom: 10px;
}

.detail-label {
  width: 150px;
  font-weight: 600;
  color: #7f8c8d;
}

.detail-value {
  flex: 1;
  color: #2c3e50;
}

/* Button styles */
.btn-danger {
  background: linear-gradient(to right, #e74c3c, #c0392b);
  color: white;
}

.btn-danger:hover {
  background: linear-gradient(to right, #c0392b, #a93226);
}

.btn-secondary {
  background: #95a5a6;
  color: white;
}

.btn-secondary:hover {
  background: #7f8c8d;
}

/* Text alignment */
.text-center {
  text-align: center;
}

/* Users button */
.users-btn {
  background-color: #2ecc71;
  color: white;
}

.users-btn:hover {
  background-color: #27ae60;
  color: white;
}

/* Key/Password button */
.key-btn {
  background-color: #9b59b6;
  color: white;
}

.key-btn:hover {
  background-color: #8e44ad;
  color: white;
}
