body {
  margin: 0;
  padding: 0;
  font-family: arial, verdana, helvetica, sans-serif;
  font-size: 10pt;
  background-color: #FFFFFF;
}

/* Main container styling - ensure minimum viewport height */
#lv0 {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#lv0 > div {
  flex: 1;
}

/* #page-header styling - responsive with title and gradient background */
#page-header {
  background: linear-gradient(to bottom, #6B749E 0%, #6B749E 70px, #FFFFFF 70px);
  height: 86px;
  color: white;
  border: none;
  position: relative;
  overflow: hidden;
}

#page-header::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 470px;
  height: 86px;
  background-image: url('/images/vykortstitel-title.gif');
  background-repeat: no-repeat;
  background-position: 0 0;
  z-index: 1;
}

@media (max-width: 470px) {
  #page-header {
    background: none;
  }
  
  #page-header::before {
    width: 100vw;
    background-size: 100% auto;
    background-repeat: no-repeat;
  }
}

/* Main content area */
.main-content {
  max-width: 960px;
  margin: 0 auto;
  padding: 20px;
  background-color: white;
  text-align: center;
}

.main-content h3 {
  font-family: Arial, Helvetica, sans-serif;
  margin-bottom: 20px;
}

.main-content p {
  font-family: arial, verdana, helvetica;
  font-size: 10pt;
  line-height: 1.4;
}

/* Rose image styling */
.hero-image {
  width: 492px;
  height: 363px;
  margin: 20px auto;
  display: block;
}

/* Navigation styling */
.category-nav {
  margin: 20px 0;
  padding: 20px 0;
  border-top: 1px solid #004080;
  border-bottom: 1px solid #004080;
}

.category-nav a {
  text-decoration: none;
  font-family: arial, verdana, helvetica;
  font-size: 10pt;
  color: #0066CC;
  margin: 0 5px;
}

.category-nav a:hover {
  text-decoration: underline;
  color: fuchsia;
}

.category-nav a:active {
  color: purple;
}

/* Footer styling */
#page-footer {
  background-color: #6B7494;
  height: 30px;
  color: white;
}

.webmaster-credit {
  font-family: arial narrow, arial, verdana;
  font-size: 8pt;
  margin-top: 20px;
}

.webmaster-credit a {
  color: inherit;
  text-decoration: none;
  font-style: italic;
}

/* Responsive adjustments */
@media (max-width: 650px) {
  .main-content {
    width: 100%;
    padding: 10px;
  }
  
  .hero-image {
    max-width: 100%;
    height: auto;
  }
  
  .category-nav {
    padding: 15px 0;
  }
  
  .category-nav a {
    display: inline-block;
    margin: 2px 3px;
  }
}

/* Postcard grid styling */
.postcard-grid {
  padding: 20px;
}

.postcard-grid h1 {
  text-align: center;
  margin-bottom: 30px;
  color: #6B749E;
}

.postcard-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.postcard-item {
  cursor: pointer;
  transition: transform 0.12s ease-out, box-shadow 0.12s ease-out, outline-color 0.12s ease-out;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transform-origin: center center;
  outline: 2px solid transparent;
}

.postcard-item.dragging {
  opacity: 0.45;
}

.postcard-item.drop-target {
  outline-color: #6b749e;
  box-shadow: 0 0 0 4px rgba(107, 116, 158, 0.2), 0 8px 16px rgba(0, 0, 0, 0.18);
}

.postcard-item:hover {
  transform: translateY(-5px) rotate(var(--rotation, 0deg)) !important;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.postcard-thumbnail {
  position: relative;
  aspect-ratio: 3/2;
  overflow: hidden;
}

.postcard-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.postcard-item:hover .postcard-thumbnail img {
  transform: scale(1.05);
}

.postcard-title {
  padding: 12px;
  text-align: center;
  font-size: 14px;
  color: #333;
  background: white;
}

.postcard-title-editable {
  width: 100%;
  box-sizing: border-box;
  cursor: text;
  text-decoration: underline dotted transparent;
  transition: text-decoration-color 0.12s ease-out, background-color 0.12s ease-out;
}

.postcard-title-editable:hover {
  text-decoration-color: #6b749e;
  background: #f6f8ff;
}

.admin-hint {
  color: #5a6280;
  font-size: 12px;
  margin: -10px auto 20px;
}

.admin-card-controls {
  border-top: 1px solid #eee;
  padding: 10px;
  text-align: left;
  transform: none !important;
}

.drag-handle {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed #9aa2c2;
  background: rgba(247, 248, 255, 0.92);
  color: #3f4868;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  cursor: grab;
  user-select: none;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.drag-handle:active {
  cursor: grabbing;
}

.admin-card-controls label {
  display: block;
  font-size: 12px;
  color: #444;
  margin-bottom: 8px;
}

.admin-card-controls input,
.admin-card-controls select {
  width: 100%;
  box-sizing: border-box;
  margin-top: 4px;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 6px 8px;
  font-size: 12px;
}

.admin-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

@media (max-width: 650px) {
  .postcard-list {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    padding: 10px;
  }
  
  .postcard-title {
    font-size: 12px;
    padding: 8px;
  }
}

/* Message form styling */
.create-message {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
}

.create-message h1 {
  color: #6B749E;
  margin-bottom: 10px;
}

.create-message p {
  color: #666;
  margin-bottom: 30px;
}

.message-form {
  background: #fafaff;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.form-group {
  margin-bottom: 10px;
  text-align: left;
}

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

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
  height: 2rem;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #6B749E;
  box-shadow: 0 0 0 2px rgba(107, 116, 158, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 370px;
}

.error-message {
  color: #dc3545;
  background: #fff5f5;
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 20px;
  text-align: left;
}

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 0;
}

.primary-button,
.secondary-button {
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.primary-button {
  background: #6B749E;
  color: white;
}

.primary-button:hover {
  background: #5a6280;
}

.primary-button:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.secondary-button {
  background: #f5f5f5;
  color: #333;
}

.secondary-button:hover {
  background: #e5e5e5;
}

@media (max-width: 650px) {
  .create-message {
    padding: 10px;
  }
  
  .message-form {
    padding: 20px;
  }
  
  .form-actions {
    flex-direction: column;
  }
  
  .form-actions button {
    width: 100%;
  }
}

/* Postcard display view */
.postcard-display {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px;
}

.postcard-display h1 {
  color: #6B749E;
  margin-bottom: 20px;
  text-align: center;
}

.postcard-container {
  position: relative;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.postcard-image {
  width: 100%;
  height: auto;
  display: block;
}

.postcard-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #fafaff;
  padding: 40px;
  box-sizing: border-box;
  transform: rotateY(180deg);
  backface-visibility: hidden;
  transition: transform 0.6s ease;
}

.postcard-front {
  position: relative;
  width: 100%;
  transform: rotateY(0deg);
  backface-visibility: hidden;
  transition: transform 0.6s ease;
}

.postcard-flipped .postcard-front {
  transform: rotateY(180deg);
}

.postcard-flipped .postcard-back {
  transform: rotateY(0deg);
}

.postcard-message {
  max-width: 800px;
  margin: 0 auto;
  font-family: 'Courier New', Courier, monospace;
  font-size: 16px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.postcard-meta {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #eee;
  font-size: 14px;
  color: #666;
}

.postcard-meta p {
  margin: 5px 0;
}

.postcard-controls {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 30px 0;
}

.flip-button {
  background: #6B749E;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s ease;
}

.flip-button:hover {
  background: #5a6280;
}

@media (max-width: 650px) {
  .postcard-display {
    padding: 10px;
  }
  
  .postcard-back {
    padding: 20px;
  }
  
  .postcard-message {
    font-size: 14px;
  }
}

/* Postcard form layout */
.postcard-form-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
}
@media (min-width: 920px) {
  .postcard-form-container {
    transform: rotate(-2deg);
  }
}

.postcard-layout {
  display: flex;
  gap: 30px;
  background: #fff;
  padding: 40px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  position: relative;
  min-height: 500px;
  flex-direction: column;
}

.postcard-content {
  display: flex;
  gap: 30px;
  flex: 1;
}

.postcard-left {
  flex: 1;
  border-right: 1px dashed #ccc;
  padding-right: 30px;
  order: 1;
}

.postcard-right {
  flex: 1;
  position: relative;
  padding-top: 100px;
  order: 2;
}

.postcard-stamp {
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: auto;
  opacity: 0.8;
}

.postcard-message-textarea {
  height: 100%;
  min-height: 300px;
  resize: none;
  background: transparent;
  border: none;
  font-family: 'Courier New', Courier, monospace;
  line-height: 1.6;
}

.postcard-message-textarea:focus {
  outline: none;
  box-shadow: none;
}

.form-actions {
  margin-top: 0;
  padding-top: 20px;
  border-top: 1px solid #eee;
  text-align: center;
}

@media (max-width: 920px) {
  .postcard-layout {
    padding: 20px;
  }

  .postcard-content {
    flex-direction: column;
  }

  .postcard-left {
    border-right: none;
    border-bottom: 1px dashed #ccc;
    padding-right: 0;
    padding-bottom: 20px;
    margin-bottom: 20px;
    order: 2;
  }

  .postcard-right {
    padding-left: 0;
    padding-top: 0;
    order: 1;
    padding-top: 100px;
  }

  .postcard-stamp {
    width: 80px;
  }
} 
