/* GLOBAL STYLES */
body {
  font-family: Arial, sans-serif;
  background-color: #f9f9f9;
  color: #333;
  margin: 0;
  padding: 0;
  text-align: center;
}

h2 {
  font-size: 17px;
  padding-top: 10px;
}

h3 {
  font-size: 17px;
  padding-top: 0px;
}

/* HEADER STYLES */
header {
  padding: 20px;
  background-color: #333333;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.logo {
  max-height: 190px;
  width: auto;
}

/* NAVIGATION STYLES */
nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0;
  background-color: #f1f1f1;
  padding: 0;
}

.tab-btn {
  background-color: #e6e6e6;
  border: 1px solid #ccc;
  border-bottom: none;
  padding: 10px 18px;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.3s;
  margin: 0;
  border-radius: 10px 10px 0 0;
  position: relative;
  top: 1px;
}

.tab-btn.active {
  background-color: #ffffff;
  font-weight: bold;
  border-bottom: 2px solid white;
  position: relative;
  z-index: 2;
}

/* MAIN CONTENT STYLES */
main {
  padding: 20px;
  padding-top: 0;
  min-height: 300px;
}

.welcome-message {
  max-width: 800px;
  margin: 10px auto 0;
  padding: 10px 20px;
  font-size: 16px;
  line-height: 1.6;
  text-align: center;
  color: #333;
}

.converter-box {
  border: 1px solid #ccc;
  padding: 30px;
  padding-top: 0;
  border-radius: 7px;
  background-color: #fff;
  max-width: 600px;
  margin: 30px auto;
}

.converter-box.image-editor {
  max-width: 890px;
}

.converter-box.ai-writer {
  max-width: 890px;
  width: 100%;
  margin: 30px auto;
}

.tool-instructions {
  margin-top: 20px;
  text-align: left;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  font-size: 15px;
  line-height: 1.6;
}

/* WORKSPACE STYLES */
.workspace-box {
  position: relative;
  width: 500px;
  height: 500px;
  max-width: 800px;
  border: 2px dashed lightgray;
  background-color: #f9f9f9;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

#workspaceText {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 18px;
  color: gray;
  z-index: 2;
  pointer-events: none;
  user-select: none;
}

.workspace-box img {
  max-width: 100%;
  max-height: 100%;
  display: block;
}

.workspace-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}

.image-info {
  font-size: 14px;
  color: #333;
  text-align: center;
  margin-top: 10px;
  margin-bottom: 5px;
}

/* DROP ZONE STYLES */
.drop-zone {
  margin: 20px auto 0;
  padding: 40px;
  max-width: 500px;
  width: 90%;
  border-radius: 4px;
  border: 2px dashed #ccc;
  background-color: #f1f1f1;
  transition: background 0.3s;
}

.preview-img {
  margin-top: 20px;
  max-width: 100%;
  max-height: 300px;
  display: none;
}

/* BUTTON STYLES */
.button, 
label.button {
  padding: 8px 14px;
  border: none;
  border-radius: 4px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.14);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s, transform 0.12s;
  margin-right: 8px;
  outline: none;
  text-transform: uppercase;
}

.upload-button, 
label.upload-button {
  background-color: #007bff;
  color: #fff;
}

.upload-button:hover,
.upload-button:active,
label.upload-button:hover,
label.upload-button:active {
  background-color: #0056b3;
}

.save-button {
  background-color: #28a745;
  color: #fff;
}

.save-button:hover,
.save-button:active {
  background-color: #19692c;
}

.clear-button {
  background-color: #dc3545;
  color: #fff;
}

.clear-button:hover,
.clear-button:active {
  background-color: #a71d2a;
}

.download-button {
  background-color: #343a40;
  color: white;
}

.top-buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.top-buttons .button {
  margin: 0;
}

.file-buttons {
  display: flex;
  gap: 8px;
  align-items: center;
}

.zoom-controls {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
}

.zoom-controls .button {
  margin: 0;
  padding: 8px 12px;
}

.zoom-button {
  width: 30px;
  height: 30px;
  margin: 0 5px;
  font-size: 18px;
  font-weight: bold;
}

/* LOADING BAR STYLES */
.loading-container {
  margin: 20px 0;
  text-align: center;
}

.loading-bar-wrapper {
  max-width: 400px;
  margin: 0 auto;
}

.loading-bar {
  width: 100%;
  height: 8px;
  background-color: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 10px;
}

.loading-progress {
  height: 100%;
  background: linear-gradient(90deg, #007bff, #0056b3);
  border-radius: 4px;
  width: 0%;
  transition: width 0.3s ease;
  position: relative;
}

.loading-progress::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(255,255,255,0.4), 
    transparent
  );
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.loading-text {
  font-size: 14px;
  color: #666;
  font-weight: 500;
}

.loading-text.success {
  color: #28a745;
  font-weight: bold;
}

.download-ready {
  animation: pulse 2s infinite;
  box-shadow: 0 0 10px rgba(52, 58, 64, 0.5);
}

.button:not(.download-ready) {
  animation: none !important;
  transform: scale(1) !important;
  box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.14) !important;
}

@keyframes pulse {
  0% { 
    transform: scale(1);
    box-shadow: 0 0 10px rgba(52, 58, 64, 0.5);
  }
  50% { 
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(52, 58, 64, 0.8);
  }
  100% { 
    transform: scale(1);
    box-shadow: 0 0 10px rgba(52, 58, 64, 0.5);
  }
}

/* MEASUREMENT CONVERTER STYLES */
.measurement-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 20px;
  align-items: center;
  justify-content: center;
  max-width: 600px;
  margin: 0 auto 20px;
  padding: 20px;
  background-color: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #dee2e6;
}

.measurement-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.measurement-block label {
  font-size: 12px;
  font-weight: bold;
  color: #495057;
  margin-bottom: 4px;
}

.measurement-grid input[type="number"],
.measurement-grid input[type="text"],
.measurement-grid .unit-select {
  width: 100%;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: normal;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
  background-color: #fff;
  transition: border-color 0.3s ease;
}

.measurement-grid input[type="number"]:focus,
.measurement-grid input[type="text"]:focus,
.measurement-grid .unit-select:focus {
  border-color: #007bff;
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.measurement-grid input[type="text"]:read-only {
  background-color: #f8f9fa;
  color: #495057;
}

.unit-select {
  padding-right: 28px;
  background-position: right 8px center;
  background-repeat: no-repeat;
  background-size: 12px;
}

.equals {
  font-size: 24px;
  font-weight: bold;
  color: #6c757d;
  text-align: center;
}

#formulaHint {
  font-size: 14px;
  color: #6c757d;
  margin-top: 15px;
  text-align: center;
  padding: 10px;
  background-color: #f8f9fa;
  border-radius: 4px;
  border: 1px solid #dee2e6;
}

/* IMAGE EDITOR STYLES */
.image-editor-container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 0px;
  margin: 0;
  padding: 0;
  flex-wrap: nowrap;
}

.editor-body {
  display: flex;
  height: auto;
  align-items: flex-start;
  justify-content: center;
  gap: 20px;
  flex-wrap: nowrap;
  width: 100%;
}

.image-editor .top-buttons {
  justify-content: space-between;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

.image-editor .button {
  padding: 8px 12px;
  font-size: 14px;
}

.tool-ribbon {
  width: 160px;
  background-color: #f4f4f4;
  border: 1px solid #ccc;
  border-radius: 7px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
  align-self: flex-start;
}

.tool-button {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  width: 140px;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 5px;
  padding: 10px;
  margin-bottom: 10px;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.tool-button.active {
  background-color: #e3f2fd !important;
  border-color: #2196f3 !important;
}

.tool-button:hover {
  background-color: #f8f8f8;
}

.icon-area {
  font-size: 10px;
  margin-right: 10px;
}

.label-text {
  flex: 1;
  text-align: left;
}

/* IMAGE EDITOR PANELS */
.resize-panel {
  display: block;
  margin-top: 0px;
  background-color: #f4f4f4;
  border: 1px solid #ccc;
  border-radius: 7px;
  padding: 15px 20px;
  box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
  width: 170px;
  flex: 0 0 auto;
  text-align: left;
  margin-left: 20px;
}

.crop-panel, 
.social-media-panel {
  display: none;
  margin-top: 0px;
  background-color: #f4f4f4;
  border: 1px solid #ccc;
  border-radius: 7px;
  padding: 15px 20px;
  box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
  width: 170px;
  flex: 0 0 auto;
  text-align: left;
  margin-left: 20px;
}

.resize-panel h3, .crop-panel h3, .social-media-panel h3 {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 17px;
  text-align: center;
}

.resize-panel label, .crop-panel label {
  display: block;
  margin-bottom: 5px !important;
  font-size: 12px;
  font-weight: bold;
}

.resize-panel input[type="number"],
.crop-panel input[type="number"] {
  width: 100%;
  padding: 5px 8px;
  font-size: 14px;
  font-weight: normal;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
}

.panel-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.panel-field {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.resize-options, .crop-options {
  margin: 10px 0;
  font-size: 10px;
}

.resize-panel button, 
.crop-panel button {
  margin-top: 10px;
  padding: 8px 15px;
  border: none;
  background-color: #007bff;
  color: white;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
}

.resize-panel button:hover, 
.crop-panel button:hover {
  background-color: #0056b3;
}

.crop-panel .orientation-buttons {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: -7px 0 15px 0;
  max-width: 100%;
  flex-wrap: nowrap;
}

.crop-panel .orientation-buttons button {
  flex: 1 1 0;
  padding: 8px 12px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.15);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crop-panel .orientation-buttons button:hover {
  background-color: #0056b3;
}

/* SOCIAL MEDIA PANEL */
.social-option {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  padding: 8px 10px;
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.social-option:hover {
  background-color: #f8f9fa;
  border-color: #007bff;
}

.social-option.selected {
  background-color: #e3f2fd;
  border-color: #2196f3;
}

.social-option input[type="checkbox"] {
  margin-right: 10px;
  transform: scale(1.1);
}

.social-option-content {
  flex: 1;
}

.social-platform {
  font-weight: bold;
  font-size: 13px;
  color: #333;
  margin-bottom: 2px;
}

.social-type-dimensions {
  font-size: 11px;
  color: #666;
  line-height: 1.2;
}

.social-media-actions {
  margin-top: 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.apply-button, .crop-button {
  padding: 8px 15px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.apply-button {
  background-color: #28a745;
  color: white;
}

.apply-button:hover {
  background-color: #19692c;
}

.apply-button.strobe {
  animation: pulse 2s infinite;
}

.crop-button {
  background-color: #007bff;
  color: white;
  display: none;
}

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

.crop-button.strobe {
  animation: pulse 2s infinite;
}

.social-message {
  font-size: 12px;
  color: #666;
  margin-top: 10px;
  padding: 8px;
  background-color: #fff;
  border-radius: 4px;
  border-left: 3px solid #007bff;
  display: none;
}

.save-button.strobe {
  animation: pulse 2s infinite;
}

/* AI WRITER STYLES */
.ai-writer .editor-body {
  min-width: 950px;
  height: auto;
  box-sizing: border-box;
  justify-content: space-between;
  width: 100%;
  display: flex;
  padding: 0 15px;
}

.ai-writer .workspace-container {
  min-height: 600px;
  flex-shrink: 0;
  flex-basis: 520px;
  margin-right: -30px !important;
  margin-left: -30px !important;
}

.ai-writer .workspace-box {
  width: 500px;
  height: 500px;
  max-width: 890px;
  border: 2px dashed lightgray;
  background-color: #f9f9f9;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  overflow: hidden;
  padding: 0;
  position: relative;
}

.ai-writer .tool-ribbon {
  width: 160px;
  margin-right: 0px;
  background-color: #f4f4f4;
  border: 1px solid #ccc;
  border-radius: 7px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
  align-self: flex-start;
}

.text-workspace {
  width: 100%;
  height: 100%;
  border: none;
  outline: none;
  resize: none;
  padding: 15px;
  font-family: Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  background-color: transparent;
  box-sizing: border-box;
}

.text-workspace::placeholder {
  color: #999;
  font-style: italic;
}

/* AI WRITER SUMMARISER PANEL */
.summariser-panel {
  display: none;
  margin: 0;
  background-color: #f4f4f4;
  border: 1px solid #ccc;
  border-radius: 7px;
  padding: 15px 20px;
  box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
  width: 170px;
  flex: 0 0 auto;
  text-align: left;
}

.ai-writer .summariser-panel {
  display: block;
  margin-left: 0px !important;
  min-width: 170px;
  flex-shrink: 0;
  flex-basis: 170px;
  min-height: 470px;
}

.summariser-panel h3 {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 17px;
  text-align: center;
}

.word-length-section, .style-section {
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #e0e0e0;
}

.word-length-section h4,
.style-section h4 {
  margin: 0 0 10px 0;
  font-size: 13px;
  font-weight: bold;
  color: #333;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.word-length-buttons,
.style-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.option-button {
  padding: 8px 12px;
  border: 1px solid #ccc;
  background-color: #fff;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  position: relative;
}

.option-button:hover {
  background-color: #f8f9fa;
  border-color: #007bff;
}

.option-button.selected {
  background-color: #e3f2fd;
  border-color: #2196f3;
  font-weight: bold;
  box-shadow: 0 2px 4px rgba(33, 150, 243, 0.2);
}

.word-count-label,
.option-description {
  font-size: 10px;
  color: #666;
  font-weight: normal;
  margin-top: 2px;
  display: block;
}

.option-button.selected .word-count-label,
.option-button.selected .option-description {
  color: #1976d2;
}

.summarise-button {
  width: 100%;
  padding: 12px;
  background-color: #28a745;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 0px;
}

.summarise-button:hover {
  background-color: #19692c;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.summarise-button:disabled {
  background-color: #6c757d;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.summarise-button.processing {
  animation: pulse 2s infinite;
  background-color: #ffc107;
}

.summarise-actions {
  margin-top: 0px;
}

/* AI WRITER HUMANISER PANEL */
/* HUMANISER PANEL STYLES - Add to your styles.css */

.humaniser-panel {
  display: none;
  margin: 0;
  background-color: #f4f4f4;
  border: 1px solid #ccc;
  border-radius: 7px;
  padding: 15px 20px;
  box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
  width: 170px;
  flex: 0 0 auto;
  text-align: left;
  margin-left: 0px !important;
  min-width: 170px;
  flex-shrink: 0;
  flex-basis: 170px;
  min-height: 470px;
}

.humaniser-panel h3 {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 17px;
  text-align: justify;
}

.humaniser-options-section {
  background-color: #fff;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  padding: 12px;
  margin-bottom: 15px;
}

.humaniser-options-section:last-of-type {
  border-bottom: none;
  margin-bottom: 10px;
}

.humaniser-options-section h4 {
  margin: 0 0 8px 0;
  font-size: 12px;
  font-weight: bold;
  color: #333;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Beta badge for Humaniser button */
.beta-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background-color: #ff9800;
  color: white;
  font-size: 8px;
  font-weight: bold;
  padding: 2px 5px;
  border-radius: 3px;
  letter-spacing: 0.5px;
}

.tool-button {
  position: relative; /* Required for absolute positioning of badge */
}

.checkbox-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.checkbox-option {
  display: flex;
  align-items: flex-start;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  transition: background-color 0.2s ease;
  font-size: 11px;
  line-height: 1.2;
}

.checkbox-option:hover {
  background-color: #f8f9fa;
}

.checkbox-option input[type="checkbox"] {
  margin: 1px 6px 0 0;
  transform: scale(0.85);
  cursor: pointer;
  flex-shrink: 0;
}

.checkbox-text {
  color: #333;
  cursor: pointer;
  font-weight: normal;
  word-wrap: break-word;
  line-height: 1.2;
}

.humanise-button {
  width: 100%;
  padding: 10px;
  background-color: #28a745;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 5px;
}

.humanise-button:hover {
  background-color: #19692c;
}

.humanise-button:disabled {
  background-color: #6c757d;
  cursor: not-allowed;
}

.humanise-button.processing {
  animation: pulse 2s infinite;
  background-color: #ffc107;
}

/* AI WRITER OUTPUT STYLES */
.ai-loading {
  display: none;
  text-align: center;
  padding: 20px;
  color: #666;
  font-style: italic;
}

.summary-output {
  display: none;
  margin-top: 20px;
  border-top: 2px solid #007bff;
  padding-top: 15px;
}

/* Humaniser Output - matches Summariser */
.humaniser-output {
  display: none;
  margin-top: 20px;
  border-top: 2px solid #28a745;
  padding-top: 15px;
}

.summary-header {
  display: flex;
  justify-content: space-between;
  align-items: justify;
  margin-bottom: 10px;
}

.summary-title {
  font-weight: bold;
  color: #333;
  font-size: 16px;
}

.copy-icon {
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  font-size: 12px;
  transition: all 0.3s ease;
}

.copy-icon:hover {
  background-color: #e9ecef;
}

.copy-icon.copied {
  background-color: #d4edda;
  color: #155724;
}

.summary-text {
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  padding: 15px;
  line-height: 1.6;
  font-size: 14px;
  height: 450px;
  overflow-y: auto;
  white-space: normal !important;
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
  max-width: 500px;
  width: 100%;
  box-sizing: border-box;
  display: block;
  text-align: justify;
}

.download-actions {
  margin-top: 15px;
  display: flex;
  gap: 10px;
}

.download-word-btn {
  flex: 1;
  padding: 8px 12px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.download-word-btn:hover {
  background-color: #0056b3;
}

.error-message {
  display: none;
  margin-top: 15px;
  padding: 10px;
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  border-radius: 4px;
  color: #721c24;
  font-size: 12px;
}

#panelError {
  margin-top: 10px;
  padding: 8px;
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  border-radius: 4px;
  color: #721c24;
  font-size: 11px;
  display: none;
}

/* OpenAI Attribution Styles */
.openai-attribution {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  color: #666;
  font-weight: 500;
}

.openai-logo {
  height: 45px !important;  /* Much smaller */
  width: 45px !important;
  opacity: 0.8;
  vertical-align: middle;
  max-height: 100px !important;  /* Force maximum size */
  max-width: 100px !important;   /* Prevent it getting too wide */
}

/* Make OpenAI logo larger in the aiInfo area only */
#aiInfo .openai-logo {
  height: 45px !important;
  width: auto !important;
  opacity: 0.9;
}

#aiInfo .openai-attribution {
  font-size: 13px;
  font-weight: 500;
  gap: 8px;
}

/* Enhanced Placeholder Styling */
.text-workspace::placeholder {
  color: #999;
  font-style: italic;
  opacity: 1;
  font-size: 14px;
}

/* FILE INDICATOR STYLES */
.file-indicator {
  display: flex;
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  background-color: #e3f2fd;
  border: 1px solid #2196f3;
  border-radius: 6px;
  padding: 8px 12px;
  z-index: 10;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.file-icon {
  font-size: 16px;
  margin-right: 8px;
}

.file-name {
  font-weight: bold;
  font-size: 12px;
  color: #1976d2;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-right: 8px;
}

.file-size {
  font-size: 11px;
  color: #666;
  margin-right: 8px;
}

.remove-file-btn {
  background: #f44336;
  color: white;
  border: none;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease;
}

.remove-file-btn:hover {
  background: #d32f2f;
}

/* TARGETED MOBILE FIXES - Add to bottom of styles.css */

/* Fix button text size issue - UPLOAD, CLEAR, DOWNLOAD buttons */
@media (max-width: 768px) {
  .button, 
  label.button {
    font-size: 11px !important;
    padding: 8px 10px !important;
    white-space: nowrap;
  }
  
  .upload-button, 
  label.upload-button,
  .save-button,
  .clear-button,
  .download-button {
    font-size: 11px !important;
    padding: 8px 10px !important;
  }
}

@media (max-width: 480px) {
  /* CRITICAL: Override the problematic min-width */
  .editor-body,
  .ai-writer .editor-body {
    min-width: unset !important;
    width: 100% !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }
  
  /* Fix Image Editor container */
  .image-editor-container {
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    gap: 10px !important;
  }
  
  /* Make converter boxes mobile-friendly */
  .converter-box {
    margin: 10px 5px !important;
    padding: 15px 8px !important;
    max-width: 100% !important;
    width: calc(100% - 10px) !important;
    box-sizing: border-box !important;
  }
  
  .converter-box.image-editor {
    max-width: 100% !important;
    width: 100% !important;
    padding: 15px 8px !important;
  }
  
  /* Tool ribbon - make horizontal */
  .tool-ribbon {
    width: 100% !important;
    flex-direction: row !important;
    justify-content: space-around !important;
    padding: 8px !important;
    margin: 0 !important;
    order: 1 !important;
  }
  
  .tool-button {
    width: auto !important;
    flex: 1 !important;
    margin: 0 2px !important;
    padding: 8px 4px !important;
    font-size: 11px !important;
    flex-direction: column !important;
    text-align: center !important;
    min-height: 60px !important;
  }
  
  .icon-area {
    font-size: 18px !important;
    margin-right: 0 !important;
    margin-bottom: 4px !important;
    display: block !important;
  }
  
  .label-text {
    font-size: 9px !important;
    text-align: center !important;
    line-height: 1.2 !important;
  }
  
  /* Workspace container */
  .workspace-container {
    width: 100% !important;
    order: 2 !important;
    align-items: center !important;
    margin: 0 !important;
  }
  
  /* Workspace box */
  .workspace-box {
    width: 100% !important;
    max-width: 300px !important;
    height: 300px !important;
    margin: 0 auto !important;
  }
  
  /* CRITICAL: Fix the side panels positioning */
  .resize-panel,
  .crop-panel,
  .social-media-panel {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    margin-left: 0 !important;
    order: 3 !important;
    padding: 12px !important;
    box-sizing: border-box !important;
    position: relative !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
  }
  
  /* Panel improvements */
  .resize-panel h3,
  .crop-panel h3,
  .social-media-panel h3 {
    text-align: center !important;
    margin-top: 0 !important;
    margin-bottom: 12px !important;
    font-size: 16px !important;
  }
  
  .panel-row {
    flex-direction: column !important;
    gap: 8px !important;
  }
  
  .panel-field {
    width: 100% !important;
  }
  
  .panel-field input[type="number"] {
    width: 100% !important;
    padding: 10px !important;
    font-size: 16px !important;
    box-sizing: border-box !important;
  }
  
  /* Button sizing fixes */
  .button, 
  label.button {
    font-size: 10px !important;
    padding: 8px 6px !important;
    margin: 2px !important;
    word-wrap: break-word !important;
    white-space: normal !important;
    text-align: center !important;
    min-height: 32px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1.2 !important;
  }
  
  /* Top buttons container */
  .top-buttons {
    flex-direction: column !important;
    gap: 10px !important;
    align-items: stretch !important;
    width: 100% !important;
    margin-bottom: 15px !important;
  }
  
  .file-buttons {
    justify-content: center !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
  }
  
  .zoom-controls {
    justify-content: center !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    font-size: 11px !important;
  }
  
  /* Zoom slider */
  #zoomSlider {
    flex: 1 !important;
    min-width: 100px !important;
    max-width: 150px !important;
  }
  
  .zoom-button {
    width: 32px !important;
    height: 32px !important;
    font-size: 14px !important;
    padding: 0 !important;
    margin: 0 3px !important;
  }
  
  /* Social media panel mobile */
  .social-option {
    padding: 10px !important;
    margin-bottom: 8px !important;
    font-size: 12px !important;
  }
  
  .social-platform {
    font-size: 12px !important;
  }
  
  .social-type-dimensions {
    font-size: 10px !important;
  }
  
  .apply-button,
  .crop-button {
    width: 100% !important;
    padding: 12px !important;
    font-size: 12px !important;
    margin-top: 8px !important;
  }
  
  /* Crop orientation buttons */
  .crop-panel .orientation-buttons {
    flex-direction: column !important;
    gap: 6px !important;
  }
  
  .crop-panel .orientation-buttons button {
    width: 100% !important;
    padding: 10px !important;
    font-size: 12px !important;
  }
  
  /* Image info */
  .image-info {
    font-size: 11px !important;
    margin: 6px 0 !important;
    padding: 6px !important;
    background-color: #f8f9fa !important;
    border-radius: 4px !important;
    text-align: center !important;
  }
  
  /* Welcome message */
  .welcome-message {
    padding: 8px 10px !important;
    font-size: 13px !important;
    line-height: 1.4 !important;
  }
  
  /* Header logo */
  .logo {
    max-height: 80px !important;
  }
  
  /* Main content padding */
  main {
    padding: 10px 5px !important;
    padding-top: 0 !important;
  }
  
  /* Drop zones for other tools */
  .drop-zone {
    width: 100% !important;
    margin: 15px 0 !important;
    padding: 20px 10px !important;
    box-sizing: border-box !important;
  }
  
  /* Tool instructions */
  .tool-instructions {
    width: 100% !important;
    max-width: 100% !important;
    padding: 12px 8px !important;
    margin: 10px 5px !important;
    box-sizing: border-box !important;
  }
}

/* Extra small screens */
@media (max-width: 375px) {
  .workspace-box {
    max-width: 280px !important;
    height: 280px !important;
  }
  
  .converter-box.image-editor {
    padding: 12px 5px !important;
  }
  
  .tool-button {
    padding: 6px 2px !important;
    font-size: 10px !important;
    min-height: 55px !important;
  }
  
  .label-text {
    font-size: 8px !important;
  }
  
  .button, 
  label.button {
    font-size: 9px !important;
    padding: 6px 4px !important;
  }

  /* TEST - This should make the header red on mobile */
@media (max-width: 480px) {
  header {
    background-color: red !important;
  }
}

}