/* Shared CSS for Erste Creative Tools */

:root {
  --brand-blue: #2870ed;
  --bright-blue: #2870ed;
  --teal: #02A3A4;
  --forest: #028661;
  --apple: #0CB43F;
  --orange: #FF6130;
  --pink: #EB4C79;
  --aubergine: #721C7A;
  --stone: #245375;
  --border-color: #e0e0e0;
  --text-color: #333;
  --lightgray: #E4EAF0;
  --shadow: 0 4px 8px rgba(0,0,0,0.1);
  --headline-subline-spacing: 8px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  color: var(--text-color);
  background-color: var(--lightgray);
  padding: 10px; /* Reduced body padding */
}

.container {
  max-width: 95vw; /* Use viewport width percentage */
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 1024px) {
  .container {
    grid-template-columns: 400px 1fr;
  }
}

/* Header */
header {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background-color: white;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

header h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--bright-blue);
}

.logo {
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.5px;
}

/* Navigation */
.navigation-links {
  display: flex;
  gap: 15px;
  align-items: center;
}

.nav-link {
  font-size: 14px;
  color: var(--brand-blue);
  text-decoration: none;
  padding: 5px 10px;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.nav-link:hover {
  background-color: #f0f5ff;
}

.nav-link.active {
  font-weight: 600;
  background-color: #f0f5ff;
}

/* Form elements */
.input-form {
  background-color: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  height: fit-content;
}

.form-section {
  margin-bottom: 20px;
}

.form-section h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text-color);
  display: flex;
  align-items: center;
}

.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  background-color: #e0f0ff;
  color: var(--brand-blue);
  padding: 2px 8px;
  border-radius: 12px;
  margin-left: 8px;
}

.badge.orange {
  background-color: #fff0e0;
  color: var(--orange);
}

.form-group {
  margin-bottom: 15px;
}

label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 5px;
}

input[type="text"],
textarea,
select {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
}

textarea {
  min-height: 80px;
  resize: vertical;
}

/* Checkbox styles */
.checkbox-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Button styles */
.button-group {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

button {
  padding: 10px 15px;
  border: none;
  border-radius: 4px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

button.primary {
  background-color: var(--brand-blue);
  color: white;
}

button.primary:hover {
  background-color: #1c60db;
}

button.secondary {
  background-color: white;
  color: var(--brand-blue);
  border: 1px solid var(--brand-blue);
}

button.secondary:hover {
  background-color: #f0f5ff;
}

/* Output area */
.output-area {
  background-color: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-height: 800px;
}

.output-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
  align-items: center;
}

.output-header h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-color);
}

.refresh-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
  padding: 8px 12px;
}

/* Tabs */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 20px;
}

.tab {
  padding: 10px 20px;
  cursor: pointer;
  font-weight: 500;
  color: var(--text-color);
  border-bottom: 2px solid transparent;
}

.tab.active {
  color: var(--brand-blue);
  border-bottom-color: var(--brand-blue);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* AI thinking indicator */
.ai-thinking {
  margin-top: 20px;
  padding: 15px;
  background-color: #fffbf0;
  border-left: 3px solid var(--orange);
  border-radius: 0 8px 8px 0;
  font-size: 14px;
}

.ai-thinking h3 {
  color: var(--orange);
  font-size: 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ai-thinking ul {
  padding-left: 16px;
}

.ai-thinking li {
  margin-bottom: 8px;
}

/* Loading indicator */
.loading-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--orange);
  margin-top: 5px;
}

.loading-dots {
  display: flex;
  justify-content: center;
  gap: 5px;
}

.loading-dots span {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--orange);
  opacity: 0.6;
  animation: dot-pulse 1.5s infinite ease-in-out;
}

.loading-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes dot-pulse {
  0%, 100% { transform: scale(0.8); opacity: 0.6; }
  50% { transform: scale(1.2); opacity: 1; }
}

/* File upload styles */
.file-upload {
  margin-top: 10px;
}

.file-upload input {
  display: none;
}

.file-upload label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px dashed var(--border-color);
  border-radius: 4px;
  cursor: pointer;
  font-weight: normal;
}

.file-upload label:hover {
  background-color: #f0f5ff;
}

/* Creative rationale */
.creative-rationale {
  background-color: #f9f9f9;
  padding: 15px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.5;
  margin-top: 20px;
}

.creative-rationale h3 {
  margin-bottom: 10px;
  color: var(--text-color);
}

.creative-rationale p {
  margin-bottom: 10px;
}

.creative-rationale p:last-child {
  margin-bottom: 0;
}

/* Export options */
.export-options {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

/* Language selector */
.language-selector {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 5px;
}

.language-option {
  padding: 6px 10px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.language-option:hover {
  background-color: #f0f5ff;
}

.language-option.selected {
  background-color: var(--brand-blue);
  color: white;
  border-color: var(--brand-blue);
}

/* Modal styles */
.image-generation-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 100;
  align-items: center;
  justify-content: center;
}

.image-generation-modal.active {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: 8px;
  width: 90%;
  max-width: 600px;
  padding: 24px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
}

.close-btn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
}

.generated-image-preview {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  margin: 20px 0;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .container {
    grid-template-columns: 1fr;
  }
  
  .language-selector {
    flex-wrap: wrap;
  }
}

/* Styles for inline editable elements */
.editable-active {
  border: 1px dashed var(--brand-blue) !important; /* Ensure visibility */
  outline: none; /* Remove default focus outline if any */
  padding: 2px; /* Add some padding for better visual */
  margin: -2px; /* Compensate for padding to maintain layout */
  border-radius: 3px;
}

/* === Styles moved from banner.css for shared settings === */

/* Color and highlight color options */
.color-options,
.highlight-color-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.color-option,
.highlight-color-option {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid white;
  transition: transform 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.color-option:hover,
.highlight-color-option:hover {
  transform: scale(1.1);
}

.color-option.selected,
.highlight-color-option.selected {
  border: 2px solid var(--brand-blue);
  transform: scale(1.05);
}

.color-option.selected::after,
.highlight-color-option.selected::after {
  content: "✓";
  color: white;
  font-weight: bold;
  font-size: 16px;
  /* Ensure the checkmark is visible on all background colors */
  text-shadow: 0 0 2px rgba(0,0,0,0.5);
}

/* Layout options */
.layout-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.layout-option {
  width: 120px;
  height: 80px;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.layout-option:hover {
  transform: scale(1.05);
}

.layout-option.selected {
  border: 2px solid var(--brand-blue);
}

.layout-option-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.7);
  color: white;
  font-size: 10px;
  padding: 3px 0;
  text-align: center;
}

/* Layout option backgrounds */
.full-img-layout {
  background: linear-gradient(rgba(0,0,0,0), rgba(0,0,0,0.7));
}

.bottom-block-layout {
  background: linear-gradient(white, white);
  background-size: 100% 60%;
  background-position: top;
  background-repeat: no-repeat;
}

.bottom-block-layout::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 40%;
  background-color: var(--brand-blue); /* Default, can be overridden by JS if needed */
}

.right-block-layout {
  background: linear-gradient(to right, white 65%, var(--brand-blue) 65%); /* Default */
}

.left-block-layout {
  background: linear-gradient(to right, var(--brand-blue) 35%, white 35%); /* Default */
}

.full-color-layout {
  background-color: var(--brand-blue); /* Default */
}
/* === End of styles moved from banner.css === */
