:root {
  --text-color: #2c2c2c;
  --placeholder-color: #888;
  --input-bg: rgba(255, 255, 255, 0.75);
  --input-border: rgba(210, 200, 180, 0.3);
  --focus-border: rgba(210, 200, 180, 0.4);
}

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

body {
  font-family: 'Inter', sans-serif;
  color: var(--text-color);
  min-height: 100vh;
  width: 100vw;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  justify-content: center;
  background: linear-gradient(to bottom, #fffbf5 0%, #fff5e6 100%);
  background-attachment: fixed;
}

.container {
  text-align: center;
  width: 100%;
  max-width: 800px;
  padding: 1.7rem 2rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-top: 31vh;
}

header {
  margin-bottom: 1rem;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.logo {
  max-width: 150px;
  height: auto;
  margin: 0 auto;
  display: block;
}

header a {
  display: block;
  text-decoration: none;
}

.auth-buttons {
  position: fixed;
  right: 2rem;
  top: 1.2rem;
  display: var(--auth-buttons-display, none);
  gap: 0.75rem;
  z-index: 100;
}

.login-btn {
  padding: 0.5rem 1rem;
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  color: var(--text-color);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.2s ease;
}

.login-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.3);
}

#login-btn {
  background: var(--text-color);
  color: white;
  border-color: var(--text-color);
}

#login-btn:hover {
  background: #1a1a1a;
  border-color: #1a1a1a;
}

.profile-container {
  position: fixed;
  right: 2rem;
  top: 1.2rem;
  display: var(--profile-container-display, none);
  z-index: 100;
}

.profile-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 50%;
  color: var(--text-color);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.3);
}

.profile-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: rgba(255, 251, 245, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(210, 200, 180, 0.3);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  min-width: 150px;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.profile-menu.active {
  display: flex;
}

.profile-menu-item {
  padding: 0.75rem 1rem;
  color: var(--text-color);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  text-decoration: none;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.2s ease;
}

.profile-menu-item:hover {
  background: rgba(0, 0, 0, 0.05);
}

.profile-menu-item:not(:last-child) {
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.image-preview-container {
  position: relative;
  margin-top: 0.5rem;
  border-radius: 8px;
  overflow: hidden;
}

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

.input-group {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  align-items: center;
}

input[type="text"] {
  width: 100%;
  padding: 1.1rem 3.5rem 1.1rem 1.5rem;
  font-family: 'Inter', sans-serif;
  font-size: 1.1rem;
  font-weight: 300;
  line-height: 1.5;
  color: var(--text-color);
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 12px;
  outline: none;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(10px);
}

input[type="text"]::placeholder {
  color: var(--placeholder-color);
  font-weight: 300;
}

input[type="text"]:focus {
  background: rgba(255, 255, 255, 0.9);
  border-color: var(--focus-border);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  transform: translateY(-1px);
}

.slogan {
  font-family: 'Inter', sans-serif;
  font-size: 1.25rem;
  color: #555;
  margin-bottom: 2rem;
  font-weight: 300;
  letter-spacing: -0.01em;
}

.dynamic-placeholder {
  position: absolute;
  left: calc(1.5rem + 1px);
  right: calc(3.5rem + 1px);
  top: 0;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  user-select: none;
  text-align: left;
  transition: transform 0.3s ease;
}

input[type="text"]:focus ~ .dynamic-placeholder {
  transform: translateY(-1px);
}

.placeholder-item {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  padding-top: calc(1.1rem + 1px);
  line-height: 1.5;
  color: var(--placeholder-color);
  font-family: 'Inter', sans-serif;
  font-size: 1.1rem;
  font-weight: 300;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.placeholder-enter {
  opacity: 0;
  transform: translateY(100%);
}

.placeholder-active {
  opacity: 1;
  transform: translateY(0);
  transition: transform 1s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 1s ease-out 0.15s;
}

.placeholder-exit {
  opacity: 0;
  transform: translateY(-40%);
  transition: transform 1s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.4s;
}

.action-btn {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  border-radius: 50%;
  transition: all 0.2s ease;
  color: #666;
  z-index: 10;
}

.action-btn:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: #333;
}

.action-btn:disabled {
  opacity: 0;
  cursor: default;
  pointer-events: none;
}

.arrow-btn {
  background-color: #ff9999;
  background-size: 200% 200%;
  animation: magicalColorChange 5s ease infinite;
  color: white;
  width: 40px;
  height: 40px;
  padding: 0;
  box-shadow: 0 2px 8px rgba(255, 153, 153, 0.4);
}

.arrow-btn:hover {
  background-color: #ff8080;
  color: white;
  transform: translateY(-50%) scale(1.05);
  box-shadow: 0 4px 12px rgba(255, 153, 153, 0.5);
}

.loading-container {
  width: 40px;
  height: 40px;
  display: none;
  align-items: center;
  justify-content: center;
  position: relative;
  margin: 0;
  padding: 0;
}

.loading-container.active {
  display: flex;
}

.spinner {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 4px solid rgba(255, 216, 153, 0.283);
  border-top-color: #ebe2d3;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.input-group .loading-container {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
}

.input-group .spinner {
  border-width: 3px;
}

.stop-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  width: 24px;
  height: 24px;
  padding: 0;
  color: #ff6666;
  background: white;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.stop-btn:hover {
  color: #ff4d4d;
  background: #fff0f0;
  transform: translate(-50%, -50%) scale(1.1);
}

.message {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-style: italic;
  color: #444;
  opacity: 0;
  transition: opacity 0.5s ease;
  position: relative;
  overflow: hidden;
  height: 1.5rem;
  display: block;
}

.message.visible {
  opacity: 1 !important;
  display: block !important;
}

.message-item {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  width: 100%;
  text-align: center;
  line-height: 1.5rem;
  display: block;
  visibility: visible;
}

.message-item-enter {
  opacity: 0;
  transform: translateY(100%);
  z-index: 1;
}

.message-item-active {
  opacity: 1 !important;
  transform: translateY(0);
  z-index: 2;
}

.message-item-active:not(.message-item-first) {
  transition: transform 1s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 1s ease-out 0.15s;
}

.message-item-first {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

.message-item-exit {
  opacity: 0;
  transform: translateY(-40%);
  transition: transform 1s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.4s;
  z-index: 1;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes magicalColorChange {
  0% {
    background-position: 0% 50%;
    background-color: #ff9999;
  }

  50% {
    background-position: 100% 50%;
    background-color: #ffb366;
  }

  100% {
    background-position: 0% 50%;
    background-color: #ff99cc;
  }
}

.login-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.3s ease;
  align-items: center;
  justify-content: center;
}

.login-modal.show {
  display: flex;
  opacity: 1;
}

.login-modal-content {
  background: white;
  border-radius: 24px;
  max-width: 900px;
  width: 90%;
  max-height: 90vh;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  transform: scale(0.9) translateY(20px);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
  display: flex;
  overflow: visible;
  padding: 16px;
  box-sizing: border-box;
}

.login-modal.show .login-modal-content {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.login-modal-close {
  position: absolute;
  top: -16px;
  right: -16px;
  background: #1a237e;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: all 0.2s ease;
  z-index: 1001;
  padding: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.login-modal-close:hover {
  background: #283593;
  transform: scale(1.1);
}

.login-modal-close svg {
  width: 20px;
  height: 20px;
}

.login-modal-left {
  flex: 1;
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

.login-modal-title {
  font-family: 'Inter', sans-serif;
  font-size: 2rem;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

.login-modal-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  color: #666;
  margin-bottom: 2rem;
  line-height: 1.5;
}

.login-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.login-option-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: white;
  border: 1px solid #dadce0;
  border-radius: 8px;
  color: #3c4043;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  width: 100%;
}

.login-option-btn:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
  background: #f8f9fa;
}

.login-option-btn:active {
  transform: translateY(0);
}

.login-option-btn svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

.login-modal-right {
  flex: 1;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  overflow: hidden;
  border-radius: 0 16px 16px 0;
}

.login-modal-image {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-modal-image-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (max-width: 768px) {
  .login-modal-content {
    flex-direction: column;
    max-width: 100%;
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }

  .login-modal-left {
    padding: 2rem 1.5rem;
  }

  .login-modal-right {
    display: none;
  }

  .login-modal-close {
    top: 1rem;
    right: 1rem;
  }
}

/* Simple Modal - Slimmer and faster than login modal */
.simple-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.simple-modal.show {
  display: flex;
  opacity: 1;
}

.simple-modal-content {
  background: white;
  border-radius: 12px;
  max-width: 500px;
  width: 90%;
  position: relative;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  padding: 1.5rem;
  box-sizing: border-box;
  transform: translateY(-10px);
  transition: transform 0.15s ease;
}

.simple-modal.show .simple-modal-content {
  transform: translateY(0);
}

.simple-modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: transparent;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  transition: all 0.15s ease;
  padding: 0;
}

.simple-modal-close:hover {
  background: #f5f5f5;
  color: #333;
}

.simple-modal-close svg {
  width: 18px;
  height: 18px;
}

.simple-modal-title {
  font-family: 'Inter', sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0 0 1rem 0;
  line-height: 1.3;
  padding-right: 2rem;
}

.simple-modal-body {
  margin-bottom: 1.5rem;
}

.simple-modal-body input {
  width: 100%;
  padding: 0.75rem;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  color: #1a1a1a;
  background: white;
  border: 1px solid #dadce0;
  border-radius: 6px;
  outline: none;
  transition: all 0.15s ease;
  box-sizing: border-box;
}

.simple-modal-body input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.simple-modal-body p {
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  color: #666;
  margin: 0 0 0.75rem 0;
  line-height: 1.5;
}

.simple-modal-warning {
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  color: #dc3545;
  margin: 0 0 0.75rem 0;
  padding: 0.625rem;
  background: #fff5f5;
  border: 1px solid #fecaca;
  border-radius: 6px;
  line-height: 1.5;
}

.simple-modal-buttons {
  display: flex;
  gap: 0.625rem;
  justify-content: flex-end;
}

.simple-modal-btn {
  padding: 0.625rem 1.25rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.simple-modal-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.simple-modal-cancel {
  background: white;
  color: #3c4043;
  border: 1px solid #dadce0;
}

.simple-modal-cancel:hover:not(:disabled) {
  background: #f8f9fa;
  border-color: #bdc1c6;
}

.simple-modal-confirm {
  background: #2563eb;
  color: white;
}

.simple-modal-confirm:hover:not(:disabled) {
  background: #1d4ed8;
}

.simple-modal-danger {
  background: #dc3545;
  color: white;
}

.simple-modal-danger:hover:not(:disabled) {
  background: #c82333;
}

.optional-label-text {
  opacity: 0.6;
  font-size: 0.85em;
}

footer {
  margin-top: 3rem;
  padding-top: 2rem;
  padding-bottom: 0.2rem;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  color: rgba(0, 0, 0, 0.2);
  flex-wrap: wrap;
  gap: 1.5rem;
}

footer a {
  color: rgba(0, 0, 0, 0.2);
  text-decoration: none;
  transition: color 0.2s ease;
}

footer a:hover {
  color: rgba(0, 0, 0, 0.4);
}

.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Inter', sans-serif;
  text-decoration: none;
  border: 1.5px solid;
}

.btn.large {
  padding: 0.875rem 2rem;
  font-size: 0.95rem;
}

.btn.primary {
  background: #2563eb;
  color: white;
  border-color: #2563eb;
}

.btn.primary:hover {
  background: #1e40af;
  border-color: #1e40af;
}

.btn.primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn.secondary {
  background: transparent;
  border-color: #2563eb;
  color: #2563eb;
}

.btn.secondary:hover {
  background: #2563eb;
  color: white;
}

.btn.secondary.rename {
  border-color: #2563eb;
  color: #2563eb;
}

.btn.secondary.rename:hover {
  background: #2563eb;
  color: white;
}

.btn.secondary.delete {
  border-color: #dc3545;
  color: #dc3545;
}

.btn.secondary.delete:hover {
  background: #dc3545;
  color: white;
}

.error-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
  padding: 2rem;
}

.error-container {
  text-align: center;
}

.error-icon {
  font-size: 4rem;
  margin-bottom: 1.5rem;
}

.error-title {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--text-color);
}

.error-message {
  font-size: 1.1rem;
  color: var(--placeholder-color);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}
