@import "root.css";

body {
  background: #f5f5f5;
}

header {
  position: relative;
  z-index: 1000;
  padding: 20px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: transparent;
  height: 120px;
}

.admin-editing header {
  top: 48px;
}

.logo {
  width: 20%;
  width: 10vw;
  min-width: 80px;
  max-width: 140px;
}

.logo img {
  max-width: 100%;
}

nav {
  display: flex;
  gap: 40px;
  align-items: center;
}

nav a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  font-size: 20px;
  color: var(--color-text-primary);
}

nav a:hover {
  opacity: 0.8;
}

.login-btn {
  background: #4a90e2;
  color: #fff;
  padding: 10px 20px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
}

@media (max-width: 1200px) {
  header {
    height: 104px;
  }
  nav a {
    font-size: 18px;
  }
}

@media (max-width: 768px) {
  header {
    height: 76px;
    padding: 24px 16px;
  }

  nav a {
    font-size: 16px;
  }
}

/* Admin editing styles */
[data-editable="true"] {
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease;
}

.admin-editing [data-editable="true"]:hover {
  outline: 2px solid rgba(255, 107, 53, 0.6);
  outline-offset: 4px;
  background: rgba(255, 107, 53, 0.05);
}

.edit-popover {
  position: fixed;
  background: #1a1a2e;
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  z-index: 10003 !important;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: translateY(-10px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.edit-popover.show {
  opacity: 1;
  transform: translateY(0);
}

.edit-popover::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: #1a1a2e;
}

.edit-popover .key-hint {
  display: inline-block;
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 6px;
  border-radius: 3px;
  margin-left: 6px;
  font-family: monospace;
  font-size: 11px;
}

/* Editing mode banner */
.editing-mode-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #ff6b35;
  color: white;
  padding: 12px 20px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  z-index: 10002;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  display: none;
}

.admin-editing .editing-mode-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.editing-mode-banner-text {
  flex: 1;
}

.editing-mode-banner-exit {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.editing-mode-banner-exit:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Adjust body padding when banner is visible */
.admin-editing body {
  padding-top: 48px;
}

/* Temporary alert for no-edit permission */
.no-edit-alert {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #dc2626;
  color: white;
  padding: 20px 32px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  z-index: 10003;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.no-edit-alert.show {
  opacity: 1;
}
