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

body {
  font-family: Arial, sans-serif;
  background-color: #ffffff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.header {
  padding: 1rem 2rem;
  border-bottom: 1px solid #f0f0f0;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

.logo {
  color: #aaaaaa;
  font-size: 1.75rem;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s;
}

.logo:hover {
  color: #888888;
}

.language-selector {
  position: relative;
}

.lang-select {
  padding: 0.5rem 1rem;
  border: 1px solid #ddd;
  border-radius: 0.25rem;
  background-color: white;
  font-size: 0.875rem;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
  min-width: 160px;
  max-width: 200px;
}

.lang-select:hover {
  border-color: #2196f3;
}

.lang-select:focus {
  border-color: #2196f3;
  box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
}

.lang-select option {
  padding: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.2;
}

.container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.font-size-control {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 0.75rem 1rem;
  background-color: #f8f9fa;
  border-radius: 0.5rem;
  border: 1px solid #e9ecef;
}

.font-size-control label {
  font-size: 0.875rem;
  color: #495057;
  font-weight: 500;
  white-space: nowrap;
}

.font-size-control input[type="range"] {
  width: 120px;
  height: 6px;
  background: #ddd;
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.font-size-control input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  background: #2196f3;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s;
}

.font-size-control input[type="range"]::-webkit-slider-thumb:hover {
  background: #1976d2;
}

.font-size-control input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: #2196f3;
  border-radius: 50%;
  cursor: pointer;
  border: none;
  transition: background 0.2s;
}

.font-size-control input[type="range"]::-moz-range-thumb:hover {
  background: #1976d2;
}

.font-size-control span {
  font-size: 0.875rem;
  color: #6c757d;
  font-weight: 500;
  min-width: 40px;
  text-align: center;
}

.message {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 0.25rem;
  font-size: 0.875rem;
}

.message.success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.message.error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.note-form {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.post-it {
  width: 320px;
  height: 320px;
  background-color: #fff9c4;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08);
  transform: rotate(1deg);
  position: relative;
}

.post-it-tape {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 64px;
  height: 16px;
  background-color: rgba(255, 255, 220, 0.6);
  border-radius: 2px;
}

.post-it textarea {
  width: 100%;
  height: 100%;
  padding: 24px;
  background-color: transparent;
  border: none;
  outline: none;
  resize: none;
  color: #333333;
  font-size: 16px;
  line-height: 1.5;
  font-family: "Comic Sans MS", "Noto Sans CJK", "Noto Sans Arabic", "Noto Sans Hebrew", "Noto Sans Thai", cursive,
    sans-serif;
  transition: font-size 0.2s ease;
}

.post-it.read-only {
  cursor: default;
}

.read-content {
  width: 100%;
  height: 100%;
  padding: 24px;
  color: #333333;
  font-size: 16px;
  line-height: 1.5;
  font-family: "Comic Sans MS", "Noto Sans CJK", "Noto Sans Arabic", "Noto Sans Hebrew", "Noto Sans Thai", cursive,
    sans-serif;
  overflow: auto;
  transition: font-size 0.2s ease;
}

.button {
  margin-top: 1.5rem;
  padding: 0.75rem 1.5rem;
  color: white;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 1rem;
  text-decoration: none;
  display: inline-block;
  transition: background-color 0.2s;
}

.save-button {
  background-color: #2196f3;
}

.save-button:hover {
  background-color: #1976d2;
}

.edit-button {
  background-color: #4caf50;
}

.edit-button:hover {
  background-color: #388e3c;
}

.qr-container {
  margin-top: 2rem;
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.qr-box {
  text-align: center;
}

.qr-title {
  font-size: 0.875rem;
  color: #666666;
  margin-bottom: 0.5rem;
}

.qr-code {
  margin: 0 auto 0.5rem;
  max-width: 120px;
  max-height: 120px;
  border: 1px solid #ddd;
}

.qr-url {
  font-size: 0.75rem;
  color: #888888;
  max-width: 140px;
  word-break: break-all;
}

.clickable-url {
  cursor: pointer;
  transition: color 0.2s;
}

.clickable-url:hover {
  color: #2196f3;
  text-decoration: underline;
}

.copy-message {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #333333;
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  z-index: 1000;
  animation: fadeInOut 2s ease-in-out;
}

@keyframes fadeInOut {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  80% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
  }
}

/* RTL podpora */
[dir="rtl"] {
  text-align: right;
}

[dir="rtl"] .header-content {
  flex-direction: row-reverse;
}

[dir="rtl"] .qr-container {
  flex-direction: row-reverse;
}

[dir="rtl"] .post-it textarea,
[dir="rtl"] .read-content {
  text-align: right;
  direction: rtl;
}

[dir="rtl"] .lang-select {
  text-align: right;
}

[dir="rtl"] .font-size-control {
  flex-direction: row-reverse;
}

/* Responzivní design */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .qr-container {
    flex-direction: column;
    gap: 1rem;
    align-items: center;
  }

  .post-it {
    width: 280px;
    height: 280px;
  }

  .qr-url {
    max-width: 200px;
  }

  .lang-select {
    min-width: 140px;
    font-size: 0.8rem;
  }

  .font-size-control {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
  }

  .font-size-control input[type="range"] {
    width: 100px;
  }
}

@media (max-width: 480px) {
  .header {
    padding: 0.5rem 1rem;
  }

  .logo {
    font-size: 1.5rem;
  }

  .post-it {
    width: 260px;
    height: 260px;
  }

  .lang-select {
    min-width: 120px;
    font-size: 0.75rem;
  }

  .font-size-control {
    padding: 0.5rem;
  }

  .font-size-control input[type="range"] {
    width: 80px;
  }
}
