/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans",
    "Helvetica Neue", sans-serif;
}

body {
  background-color: #f0f2f5;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

/* Phone frame - only show on larger screens */
.phone-frame {
  position: relative;
  width: 375px;
  height: 667px;
  background: white;
  border-radius: 40px;
  overflow: hidden;
  border: 8px solid #333;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  max-width: 100%;
}

/* Status bar */
.status-bar {
  height: 24px;
  background-color: #333;
  width: 100%;
}

/* App content */
.app-content {
  height: calc(100% - 24px - 24px); /* Full height minus status bar and home indicator */
  overflow-y: auto;
  background-color: #f5f5f5;
  position: relative;
}

/* Header */
.app-header {
  background-color: #4a90e2;
  color: white;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}

.app-header h1 {
  font-size: 18px;
  font-weight: bold;
}

.menu-icon,
.placeholder,
.back-icon {
  width: 24px;
  height: 24px;
  cursor: pointer;
}

/* Main content */
.main-content {
  padding: 20px;
}

/* App info */
.app-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 30px;
  margin-top: 15px;
}

.app-logo {
  width: 80px;
  height: 80px;
  background-color: #4a90e2;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.app-logo svg {
  width: 48px;
  height: 48px;
  color: white;
}

.app-info h2 {
  font-size: 22px;
  font-weight: bold;
  color: #333;
}

.app-info p {
  font-size: 14px;
  color: #666;
  margin-top: 5px;
}

/* Status container */
.status-container {
  background-color: white;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.status-header {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.status-header svg {
  width: 24px;
  height: 24px;
}

.status-header .info-icon {
  color: #2196f3;
}

.status-header .check-icon {
  color: #4caf50;
}

.status-text {
  font-size: 16px;
  font-weight: 500;
  margin-left: 10px;
  color: #333;
}

.info-container {
  margin-top: 5px;
  padding-left: 34px;
}

.info-row {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.info-row svg {
  width: 20px;
  height: 20px;
  color: #666;
}

.info-text {
  margin-left: 10px;
  font-size: 14px;
  color: #666;
}

/* Button container */
.button-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 15px;
  border-radius: 10px;
  font-weight: bold;
  font-size: 16px;
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.button svg {
  width: 24px;
  height: 24px;
  margin-right: 10px;
}

.check-in-button {
  background-color: #4a90e2;
}

.check-in-button:disabled {
  background-color: #a0c4f1;
}

.directions-button {
  background-color: #4caf50;
}

.directions-button:disabled {
  background-color: #cccccc;
}

.clear-button {
  background-color: #f44336;
}

/* Footer */
.footer {
  margin-top: 30px;
  text-align: center;
}

.footer-text {
  color: #666;
  font-size: 14px;
}

/* Home indicator */
.home-indicator {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 24px;
  background-color: #333;
  display: flex;
  justify-content: center;
  align-items: center;
}

.indicator {
  width: 33%;
  height: 4px;
  background-color: #999;
  border-radius: 4px;
}

/* Map view */
.map-view {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #f5f5f5;
  z-index: 5;
  display: none;
}

.map-container {
  width: 100%;
  height: calc(100% - 120px);
  background-color: #e5e5e5;
  position: relative;
  overflow: hidden;
}

#map {
  width: 100%;
  height: 100%;
}

.direction-info {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: white;
  z-index: 1000;
  padding: 20px;
  border-top-left-radius: 15px;
  border-top-right-radius: 15px;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.direction-title {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 10px;
  color: #333;
}

.direction-details {
  margin-bottom: 15px;
}

.detail-row {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.detail-row svg {
  width: 20px;
  height: 20px;
  color: #666;
  margin-right: 10px;
}

.detail-text {
  font-size: 14px;
  color: #333;
}

.start-navigation {
  background-color: #4caf50;
  width: 100%;
}

/* Thêm style cho nút navigation khi active */
.start-navigation.active {
  background-color: #f44336;
}

/* Menu view */
.menu-view {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 20;
  display: none;
}

.menu-content {
  position: absolute;
  top: 0;
  left: 0;
  width: 80%;
  height: 100%;
  background-color: white;
  padding: 20px;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
}

.menu-view.active .menu-content {
  transform: translateX(0);
}

.menu-header {
  display: flex;
  align-items: center;
  padding-bottom: 20px;
  border-bottom: 1px solid #eee;
  margin-bottom: 20px;
}

.menu-logo {
  width: 40px;
  height: 40px;
  background-color: #4a90e2;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 15px;
}

.menu-logo svg {
  width: 24px;
  height: 24px;
  color: white;
}

.menu-title {
  font-size: 18px;
  font-weight: bold;
  color: #333;
}

.menu-items {
  list-style: none;
}

.menu-item {
  display: flex;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid #eee;
  cursor: pointer;
}

.menu-item svg {
  width: 24px;
  height: 24px;
  color: #4a90e2;
  margin-right: 15px;
}

.menu-item-text {
  font-size: 16px;
  color: #333;
}

/* Loading overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  display: none;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(74, 144, 226, 0.3);
  border-radius: 50%;
  border-top-color: #4a90e2;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Install prompt */
.install-prompt {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: white;
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: none;
  z-index: 1000;
  width: 90%;
  max-width: 400px;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    transform: translate(-50%, 100%);
    opacity: 0;
  }
  to {
    transform: translate(-50%, 0);
    opacity: 1;
  }
}

.install-prompt-content {
  display: flex;
  align-items: center;
}

.install-icon {
  width: 40px;
  height: 40px;
  background-color: #4a90e2;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 15px;
  flex-shrink: 0;
}

.install-icon svg {
  width: 24px;
  height: 24px;
  color: white;
}

.install-text {
  flex-grow: 1;
}

.install-title {
  font-weight: bold;
  margin-bottom: 5px;
  font-size: 16px;
}

.install-description {
  font-size: 14px;
  color: #666;
}

.install-buttons {
  display: flex;
  justify-content: flex-end;
  margin-top: 15px;
  gap: 10px;
}

.install-button {
  padding: 8px 15px;
  border-radius: 5px;
  font-weight: bold;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s;
}

.install-now {
  background-color: #4a90e2;
  color: white;
}

.install-now:hover {
  background-color: #3a80d2;
}

.install-later {
  background-color: #f1f1f1;
  color: #333;
}

.install-later:hover {
  background-color: #e1e1e1;
}

/* Thêm style cho standalone mode (khi đã cài đặt) */
@media all and (display-mode: standalone) {
  .install-prompt {
    display: none !important;
  }

  /* Có thể thêm các style khác cho chế độ standalone */
  .app-header {
    padding-top: env(safe-area-inset-top);
  }

  .home-indicator {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* Offline notification */
.offline-notification {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #333;
  color: white;
  padding: 10px 20px;
  border-radius: 5px;
  font-size: 14px;
  display: none;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* History view */
.history-view {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #f5f5f5;
  z-index: 5;
  display: none;
  overflow-y: auto;
}

.history-list {
  padding: 20px;
}

.history-item {
  background-color: white;
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 15px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.history-item-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.history-date {
  font-weight: bold;
  color: #333;
}

.history-time {
  color: #666;
}

.history-location {
  display: flex;
  align-items: flex-start;
  margin-bottom: 10px;
}

.history-location svg {
  width: 20px;
  height: 20px;
  color: #4a90e2;
  margin-right: 10px;
  flex-shrink: 0;
  margin-top: 2px;
}

.history-address {
  font-size: 14px;
  color: #333;
}

.history-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.history-button {
  padding: 8px 12px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: bold;
  border: none;
  cursor: pointer;
}

.view-button {
  background-color: #4a90e2;
  color: white;
}

.delete-button {
  background-color: #f1f1f1;
  color: #f44336;
}

.no-history {
  text-align: center;
  padding: 40px 20px;
  color: #666;
}

/* Settings view */
.settings-view {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #f5f5f5;
  z-index: 5;
  display: none;
  overflow-y: auto;
}

.settings-list {
  padding: 20px;
}

.settings-section {
  background-color: white;
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.settings-section-title {
  font-size: 16px;
  font-weight: bold;
  color: #333;
  margin-bottom: 15px;
}

.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
}

.settings-item:last-child {
  border-bottom: none;
}

.settings-item-label {
  display: flex;
  align-items: center;
}

.settings-item-label svg {
  width: 20px;
  height: 20px;
  color: #4a90e2;
  margin-right: 10px;
}

.settings-item-text {
  font-size: 14px;
  color: #333;
}

.settings-item-value {
  font-size: 14px;
  color: #666;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 24px;
}

.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: 16px;
  width: 16px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: #4a90e2;
}

input:checked + .toggle-slider:before {
  transform: translateX(16px);
}

.select-wrapper {
  position: relative;
}

.settings-select {
  appearance: none;
  background-color: #f5f5f5;
  border: none;
  padding: 8px 30px 8px 10px;
  border-radius: 5px;
  font-size: 14px;
  color: #333;
}

.select-arrow {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.select-arrow svg {
  width: 16px;
  height: 16px;
  color: #666;
}

/* About view */
.about-view {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #f5f5f5;
  z-index: 5;
  display: none;
  overflow-y: auto;
}

.about-content {
  padding: 20px;
}

.about-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 30px;
}

.about-app-logo {
  width: 100px;
  height: 100px;
  background-color: #4a90e2;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 15px;
}

.about-app-logo svg {
  width: 60px;
  height: 60px;
  color: white;
}

.about-app-name {
  font-size: 24px;
  font-weight: bold;
  color: #333;
  margin-bottom: 5px;
}

.about-app-version {
  font-size: 14px;
  color: #666;
}

.about-section {
  background-color: white;
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.about-section-title {
  font-size: 16px;
  font-weight: bold;
  color: #333;
  margin-bottom: 10px;
}

.about-section-content {
  font-size: 14px;
  color: #666;
  line-height: 1.5;
}

.about-section-content p {
  margin-bottom: 10px;
}

.about-section-content p:last-child {
  margin-bottom: 0;
}

/* Manual location input */
.manual-location {
  background-color: white;
  border-radius: 10px;
  padding: 15px;
  margin-top: 15px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: none;
}

.manual-location-title {
  font-size: 16px;
  font-weight: bold;
  color: #333;
  margin-bottom: 10px;
}

.manual-location-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-size: 14px;
  color: #666;
  margin-bottom: 5px;
}

.form-group input {
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 14px;
}

.form-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}

.form-button {
  padding: 8px 15px;
  border-radius: 5px;
  font-weight: bold;
  border: none;
  cursor: pointer;
}

.cancel-button {
  background-color: #f1f1f1;
  color: #333;
}

.save-button {
  background-color: #4a90e2;
  color: white;
}

/* Location permission dialog */
.permission-dialog {
  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;
  display: none;
}

.permission-content {
  background-color: white;
  border-radius: 10px;
  padding: 20px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.permission-title {
  font-size: 18px;
  font-weight: bold;
  color: #333;
  margin-bottom: 10px;
}

.permission-message {
  font-size: 14px;
  color: #666;
  margin-bottom: 20px;
  line-height: 1.5;
}

.permission-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.permission-button {
  padding: 8px 15px;
  border-radius: 5px;
  font-weight: bold;
  border: none;
  cursor: pointer;
}

.deny-button {
  background-color: #f1f1f1;
  color: #333;
}

.allow-button {
  background-color: #4a90e2;
  color: white;
}

/* Responsive styles */
@media (max-width: 480px) {
  .phone-frame {
    width: 100%;
    height: 100vh;
    border-radius: 0;
    border: none;
    box-shadow: none;
  }

  .status-bar,
  .home-indicator {
    display: none;
  }

  .app-content {
    height: 100%;
  }
}

/* For medium-sized screens */
@media (min-width: 481px) and (max-width: 768px) {
  .phone-frame {
    width: 320px;
    height: 568px;
  }
}

/* Hide elements when they should not be visible */
.hidden {
  display: none;
}

/* Transitions */
.fade-in {
  animation: fadeIn 0.3s forwards;
}

.fade-out {
  animation: fadeOut 0.3s forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* Location accuracy indicator */
.accuracy-indicator {
  display: flex;
  align-items: center;
  margin-top: 10px;
}

.accuracy-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 8px;
}

.accuracy-high {
  background-color: #4caf50;
}

.accuracy-medium {
  background-color: #ffc107;
}

.accuracy-low {
  background-color: #f44336;
}

.accuracy-text {
  font-size: 12px;
  color: #666;
}

/* Current location button */
.current-location-button {
  position: absolute;
  bottom: 130px;
  right: 10px;
  width: 40px;
  height: 40px;
  background-color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  z-index: 10;
  cursor: pointer;
}

.current-location-button svg {
  width: 24px;
  height: 24px;
  color: #4a90e2;
}

/* Style cho Leaflet Routing Machine */
.leaflet-routing-container {
  display: none; /* Ẩn bảng điều khiển mặc định */
}

/* Tùy chỉnh màu sắc cho đường đi */
.leaflet-routing-alt {
  max-height: 0;
  overflow: hidden;
}

