:root {
  --primary-color: #4a6da7;
  --secondary-color: #f8f9fa;
  --text-color: #333;
  --border-color: #ddd;
  --success-color: #28a745;
  --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

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

body {
  font-family: "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell",
    "Fira Sans", "Droid Sans", "Helvetica Neue", "Arial Hebrew", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: var(--text-color);
  background-color: var(--secondary-color);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0;
}

main {
  flex: 1;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
  width: 90%;
}

button {
  cursor: pointer;
  padding: 0.5rem 1rem;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  transition: background-color 0.3s;
}

button:hover {
  background-color: #3a5a8f;
}

button:disabled {
  background-color: #aaa;
  cursor: not-allowed;
}

input,
textarea {
  padding: 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 1rem;
  width: 100%;
}

.btn-success {
  background-color: var(--success-color);
}

.btn-success:hover {
  background-color: #218838;
}

.hidden {
  display: none !important;
}

.app-header {
  background-color: var(--primary-color);
  color: white;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.app-header h1 {
  font-size: 1.8rem;
  margin: 0;
}

.language-switcher {
  padding: 0.5rem 1rem;
  background-color: transparent;
  border: 1px solid white;
  color: white;
  border-radius: 4px;
  font-size: 0.9rem;
  transition: all 0.3s;
}

.language-switcher:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.creation-panel {
  background-color: white;
  border-radius: 8px;
  box-shadow: var(--box-shadow);
  padding: 2rem;
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
}

.image-uploaders {
  display: flex;
  gap: 2rem;
  margin-bottom: 2rem;
}

.image-uploader {
  flex: 1;
}

.uploader-label {
  margin-bottom: 0.5rem;
  font-weight: bold;
}

.drop-area {
  border: 2px dashed var(--border-color);
  border-radius: 8px;
  padding: 2rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.drop-area:hover {
  border-color: var(--primary-color);
  background-color: rgba(74, 109, 167, 0.05);
}

.drop-area.drag-over {
  border-color: var(--primary-color);
  background-color: rgba(74, 109, 167, 0.1);
}

.drop-area.has-image {
  border-style: solid;
}

.upload-icon {
  width: 48px;
  height: 48px;
  fill: var(--primary-color);
  margin-bottom: 1rem;
}

.drag-text {
  color: #777;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.file-input {
  display: none;
}

.image-preview {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  align-items: center;
  justify-content: center;
}

.image-preview.show {
  display: flex;
  z-index: 5;
  background-color: white;
}

.image-preview img {
  max-width: 100%;
  max-height: 180px;
  object-fit: contain;
}

/* Mobile specific styles for image preview */
@media (max-width: 767px) {
  .drop-area {
    min-height: 200px; /* Ensure consistent height */
  }

  .image-preview {
    padding: 10px;
  }

  .image-preview img {
    max-width: 90%;
    max-height: 180px;
    object-fit: contain;
  }
}

.success-icon {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  z-index: 10;
}

.success-icon svg {
  width: 24px;
  height: 24px;
  fill: var(--success-color);
}

.text-input {
  margin-bottom: 2rem;
}

.text-input textarea {
  width: 100%;
  resize: vertical;
}

.create-button {
  display: block;
  margin: 0 auto;
  padding: 0.75rem 2rem;
  font-size: 1.1rem;
}

.error-message {
  color: #dc3545;
  text-align: center;
  margin-bottom: 1rem;
  min-height: 24px;
}

.collage-result {
  background-color: white;
  border-radius: 8px;
  box-shadow: var(--box-shadow);
  padding: 2rem;
  max-width: 900px;
  margin: 0 auto;
}

.result-image-container {
  margin-bottom: 2rem;
  text-align: center;
  overflow-x: auto; /* Allow horizontal scrolling on mobile */
}

.result-image {
  max-width: none; /* Override the default max-width constraint */
  max-height: 70vh;
  border: 1px solid var(--border-color);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Make sure mobile users can see the full collage by scrolling if needed */
@media (max-width: 768px) {
  .result-image-container {
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
  }

  .result-image {
    max-height: 60vh;
  }
}

.result-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.download-button {
  background-color: var(--success-color);
}

.download-button:hover {
  background-color: #218838;
}

.whatsapp-button {
  background-color: #007bff; /* Blue share button */
}

.whatsapp-button:hover {
  background-color: #0056b3;
}

.new-button {
  background-color: var(--primary-color);
}

.app-footer {
  background-color: var(--primary-color);
  color: white;
  text-align: center;
  padding: 1rem;
  margin-top: auto;
}

/* Responsive styles */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }
  
  .image-uploaders {
    flex-direction: column;
    gap: 1rem;
  }
  
  .creation-panel {
    padding: 1rem;
  }
  
  .drop-area {
    min-height: 150px;
  }
  
  .result-actions {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .result-actions button {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
  }
  
  /* Ensure preview images don't overflow on mobile */
  .image-preview img {
    max-width: 95%;
    max-height: 140px;
  }
  
  /* Make text area bigger on mobile */
  .text-input textarea {
    min-height: 80px;
  }
}
