/* Components */
.btn, .upload-btn, .print-button, .back-button, .control-btn, .header-button, .btn-primary, .btn-secondary, .primary-button, .secondary-button, .url-load-btn, .upload-button { border: none; border-radius: 4px; cursor: pointer; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; outline: none; user-select: none; padding: 0.5rem 1rem; }
.btn-purple, .upload-btn, .upload-button, .url-load-btn, .my-recipes-button, .auth-button, .user-button, .upload-btn-purple { background: #644ae2; color: white; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4); }
.btn-purple:hover, .upload-btn:hover, .upload-button:hover, .url-load-btn:hover, .my-recipes-button:hover, .auth-button:hover, .user-button:hover, .upload-btn-purple:hover { background: color-mix(in srgb, #644ae2 85%, black); }
.btn-green, .header-button.continue-button, .green-button { background: #51cf66; color: white; }
.btn-green:hover, .header-button.continue-button:hover, .green-button:hover { background: color-mix(in srgb, #51cf66 85%, black); }
.btn-grey, .back-button, .control-btn, .btn-secondary, .secondary-button, .header-button:not(.print-button):not(.continue-button):not(.green-button):not(.close-button) { background: #333333; color: #e0e0e0; border: 1px solid #444444; }
.btn-grey:hover, .back-button:hover, .control-btn:hover, .btn-secondary:hover, .secondary-button:hover, .header-button:not(.continue-button):not(.green-button):not(.print-button):hover, .back-data-button:hover { background: #444444; color: white; border-color: #555555; }
.print-button:hover { background: color-mix(in srgb, #644ae2 85%, black); color: white; }
.upload-btn, .upload-button { margin-top: var(--spacing-md); padding: 1rem 2rem; font-size: 1.1rem; font-weight: 600; }
.control-btn { padding: 0.25rem 0.5rem; font-size: 0.875rem; }
button:disabled { background: #333333 !important; color: #b0b0b0 !important; cursor: not-allowed; border-color: #444444 !important; }
.app-header { position: fixed; top: 0; left: 0; right: 0; height: 60px; background: #121212; border-bottom: 1px solid #444444; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); display: flex; justify-content: space-between; align-items: center; padding: 0 1rem; z-index: 1000; }
.header-left, .header-right { display: flex; align-items: center; }
.header-right { gap: 0.5rem; }
.app-title { color: #644ae2; font-weight: 600; font-size: 1.1rem; }
.header-logo { height: 40px; width: auto; display: block; }
.auth-section { display: flex; align-items: center; gap: 0.5rem; margin-left: 1rem; }
.user-section { display: flex; align-items: center; gap: 0.5rem; }
.sign-out-button { background: #e57373; color: white; }
.sign-out-button:hover { background: #c82333; }

/* User Dropdown Styles */
.user-dropdown { position: relative; margin-left: 1rem; }
.user-dropdown-btn { 
  width: 36px; 
  height: 36px; 
  border-radius: 50%; 
  background: #333333; 
  border: 1px solid #444444; 
  cursor: pointer; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  padding: 0;
  overflow: hidden;
}
.user-dropdown-btn:hover { background: #444444; }
.user-avatar { font-size: 1.2rem; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #1e1e1e;
  border: 1px solid #444444;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  min-width: 160px;
  z-index: 1001;
}
.dropdown-menu-item {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  background: transparent;
  border: none;
  color: #e0e0e0;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.2s;
}
.dropdown-menu-item:hover { background: #333333; }
.dropdown-menu-item:not(:last-child) { border-bottom: 1px solid #333333; }

/* Floating close button styles */
.floating-close-button {
  position: fixed;
  top: 110px; /* Just below the 60px header + 50px gap */
  right: 50px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #333333;
  border: 1px solid #666;
  color: #e0e0e0;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 999;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}
.floating-close-button:hover {
  background: #444444;
  border-color: #555555;
  color: white;
  transform: scale(1.1);
}

/* Floating upload button styles */
.floating-upload-button {
  position: fixed;
  top: 110px; /* Just below the 60px header + 50px gap */
  right: 50px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #644ae2;
  border: none;
  color: white;
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 999;
  box-shadow: 0 4px 12px rgba(100, 74, 226, 0.4);
  transition: all 0.2s ease;
}

.floating-upload-button svg {
  width: 24px;
  height: 24px;
}
.floating-upload-button:hover {
  background: color-mix(in srgb, #644ae2 85%, black);
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(100, 74, 226, 0.6);
}

/* Print button styling */
.print-button { background: #644ae2; color: white; }
.print-button:hover { background: color-mix(in srgb, #644ae2 85%, black); }

/* Fixed width buttons for consistent layout */
.fixed-width-button {
  width: 140px;
  max-width: 140px;
  min-width: 140px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body { padding-top: 60px; }
.top-actions, #recipe-page > .print-button, #recipe-page > .back-button { display: none !important; }
input, textarea, select { background: #121212; border: 1px solid #444444; border-radius: 4px; padding: 0.5rem; color: #e0e0e0; }
input:focus, textarea:focus, select:focus { border-color: #644ae2; box-shadow: 0 0 0 2px rgba(100, 74, 226, 0.2); }
.batch-number-field, .date-field { color: #e0e0e0 !important; font-weight: 600 !important; font-size: 1.1rem !important; border: none; border-bottom: 1px solid #644ae2; background: transparent; text-align: center; letter-spacing: 0.1em; height: 1.32rem; box-sizing: border-box; }
.batch-number-field { width: 50px; }
.date-field { width: 85px; }
.actual-measurement-field { display: inline-block; width: 80px; height: 18px; border: none; border-bottom: 1px solid #644ae2; background: transparent; vertical-align: middle; }
.upload-container { max-width: 600px; margin: 0 auto; padding: 1rem; }
.upload-header { text-align: center; margin-bottom: 1rem; }
.upload-header h1 { color: #644ae2; margin-bottom: 0.5rem; }
.upload-header .app-logo { max-width: 100%; height: auto; display: inline-block; width: 520px; }
.upload-header p { color: #e0e0e0; font-size: 1.1rem; opacity: 0.8; }
.upload-area { position: relative; }
.file-input-container, .upload-zone { text-align: center; padding: 2rem; border: 2px dashed #444444; border-radius: 4px; margin-bottom: 2rem; background: #2a2a2a; cursor: pointer; }
.upload-zone { min-height: 200px; display: flex; flex-direction: column; justify-content: center; align-items: center; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4); }
.file-input-container:hover, .upload-zone:hover { border-color: #644ae2; background-color: color-mix(in srgb, #644ae2 5%, #2a2a2a); }
.upload-zone.drag_over, .upload-zone.drag-over { border-color: #51cf66; background: color-mix(in srgb, #51cf66 10%, #2a2a2a); border-style: solid; }
.file-input { display: none; }
.upload-icon { font-size: 2rem; margin-bottom: 0.5rem; opacity: 0.6; }
.upload-content { display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: none; }
.image-upload-modal, .loading-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.6); display: none; align-items: center; justify-content: center; z-index: 1000; backdrop-filter: blur(2px); }
.loading-overlay { background: rgba(0, 0, 0, 0.5); z-index: 2000; }
.modal-content { background: #121212; border-radius: 4px; max-width: 500px; width: 90%; max-height: 80vh; overflow-y: auto; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3); border: 1px solid #444444; }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 1rem; border-bottom: 1px solid #444444; background: #333333; }
.modal-header h3 { margin: 0; color: #644ae2; font-size: 1.1rem; }
.modal-close { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: #e0e0e0; padding: 0; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.modal-close:hover { background: rgba(68, 68, 68, 0.3); }
.modal-body { padding: 1rem; }
.loading-spinner { width: 40px; height: 40px; border: 4px solid #444444; border-top-color: #644ae2; border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* Recipe Loader Component */
.recipe-loader {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2500;
  backdrop-filter: blur(3px);
}

.recipe-loader .loading-spinner {
  margin-bottom: 1rem;
}

.recipe-loader .loading-message {
  color: #e0e0e0;
  font-size: 1rem;
  font-weight: 500;
  text-align: center;
  max-width: 300px;
  line-height: 1.4;
}

/* Modal Extensions */
.duplicate-recipe-modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: center; z-index: 3000; background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(3px); }
.duplicate-recipe-modal .modal-content { position: relative; z-index: 1; padding: 2rem; }
.duplicate-recipe-modal h3 { color: #644ae2; margin: 0 0 1rem 0; font-size: 1.2rem; }
.duplicate-recipe-modal p { color: #e0e0e0; margin: 0 0 1.5rem 0; line-height: 1.5; }
.modal-buttons { display: flex; gap: 1rem; flex-wrap: wrap; }
.modal-buttons button { flex: 1; min-width: 140px; padding: 0.75rem 1rem; border: none; border-radius: 4px; font-size: 0.95rem; cursor: pointer; transition: all 0.2s ease; }
.btn-primary { background: #644ae2; color: white; }
.btn-primary:hover { background: #7d5ff5; }
.btn-secondary { background: #4caf50; color: white; }
.btn-secondary:hover { background: #5cbf60; }
.btn-cancel { background: #666; color: white; }
.btn-cancel:hover { background: #777; }

/* Image Upload Modal Specific Styles */
.image-upload-modal .modal-body {
  height: 610px;
  display: flex;
  flex-direction: column;
}

.image-upload-modal .tab-content {
  flex: 1;
  overflow-y: auto;
}

.image-upload-modal .image-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  flex: 1;
  justify-content: flex-start;
  padding-top: 1rem;
}

.image-upload-modal #preview-image {
  max-width: 100%;
  max-height: 400px;
  padding: 10px;
  border-radius: 4px;
  object-fit: contain;
  margin: 0 auto;
  display: block;
}

.image-upload-modal .preview-controls {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: center;
}

.image-upload-modal .preview-controls .btn-secondary {
  background: #666;
  color: white;
}

.image-upload-modal .preview-controls .btn-secondary:hover {
  background: #777;
}

.image-upload-modal .upload-zone {
  margin-top: 1rem;
}

.image-upload-modal #image-file-input {
  width: 100%;
}

.image-upload-modal .url-input-group {
  width: 100%;
  margin-top: 0.5rem;
  display: flex;
  gap: 0.5rem;
}

.image-upload-modal #image-url-input {
  flex: 1;
}

.recipe-privacy-status {
  display: flex;
  align-items: center;
}

/* Upload Modal */
.upload-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  backdrop-filter: blur(3px);
}

.upload-modal-content {
  background: #121212;
  border-radius: 8px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  border: 1px solid #444444;
}

.upload-modal .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid #444444;
  background: #1e1e1e;
  border-radius: 8px 8px 0 0;
}

.upload-modal .modal-header h3 {
  margin: 0;
  color: #644ae2;
  font-size: 1.2rem;
}

.upload-modal .modal-body {
  padding: 1.5rem;
}

.upload-modal .upload-area {
  text-align: center;
}

.upload-modal .upload-zone {
  min-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  border: 2px dashed #444444;
  border-radius: 8px;
  background: #2a2a2a;
  cursor: pointer;
  transition: all 0.2s ease;
}

.upload-modal .upload-zone:hover {
  border-color: #644ae2;
  background-color: color-mix(in srgb, #644ae2 5%, #2a2a2a);
}

.upload-modal .upload-zone.drag-over {
  border-color: #51cf66;
  background: color-mix(in srgb, #51cf66 10%, #2a2a2a);
  border-style: solid;
}

.upload-modal .upload-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  opacity: 0.6;
}

.upload-modal .upload-zone h3 {
  color: #e0e0e0;
  margin: 0 0 0.5rem 0;
  font-size: 1.3rem;
}

.upload-modal .upload-zone p {
  color: #b0b0b0;
  margin: 0.25rem 0;
}

.upload-modal .format-support {
  font-size: 0.9rem;
  opacity: 0.8;
  margin-bottom: 1.5rem !important;
}

.upload-modal .upload-button {
  background: #644ae2;
  color: white;
  border: none;
  padding: 0.75rem 2rem;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 1rem;
}

.upload-modal .upload-button:hover {
  background: color-mix(in srgb, #644ae2 85%, black);
  transform: translateY(-1px);
}
.debug-category-disabled { opacity: 0.5; cursor: not-allowed; }
.debug-category-disabled input[type="checkbox"] { cursor: not-allowed; pointer-events: none; }
.debug-category-disabled span { cursor: not-allowed; opacity: 0.6; }
.error-message { position: fixed; top: 1rem; right: 1rem; max-width: 300px; background: #e57373; color: white; padding: 1rem; border-radius: 4px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4); z-index: 16000; animation: slideIn 0.3s ease; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.error-message.toast-error, .error-message.toast-warning, .error-message.toast-info { min-width: 250px; opacity: 0; transform: translateX(100%); transition: all 0.3s ease; word-wrap: break-word; font-size: 14px; line-height: 1.4; }
.error-message.toast-warning { background: #ff9800; }
.error-message.toast-info { background: #2196f3; }
.toast-close { position: absolute; top: 8px; right: 12px; background: none; border: none; color: inherit; font-size: 20px; cursor: pointer; padding: 0; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; border-radius: 50%; opacity: 0.7; transition: opacity 0.2s ease; }
.toast-close:hover { opacity: 1; background: rgba(255, 255, 255, 0.1); }
.hidden { display: none; }
.section-controls { position: fixed; top: 80px; right: 1rem; background: #121212; border: 1px solid #444444; border-radius: 4px; padding: 1.5rem; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4); max-width: 300px; width: 320px; z-index: 999; display: none; }
#sectionControls { margin-bottom: 1.5rem; }
.section-controls h3 { margin: 0 0 1rem 0; font-size: 1.1rem; color: #644ae2; border-bottom: 1px solid #444444; padding-bottom: 0.5rem; }
.section-controls-collapsible-header { cursor: pointer; margin-bottom: 0; border-radius: 4px; padding: 0.5rem; user-select: none; }
.section-controls-collapsible-header:hover { background-color: rgba(76, 175, 80, 0.2); }
.section-controls-content { max-height: 500px; overflow: hidden; transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1); }
.section-controls-content.collapsed { max-height: 0; }
.section-toggles { margin-bottom: 0.5rem; margin-top: 0.5rem; }
.section-toggle { display: flex; align-items: center; margin-bottom: 0.25rem; padding: 0 0.5rem; cursor: pointer; border-radius: 4px; transition: background-color 0.2s ease; }
.section-toggle:hover { background-color: rgba(76, 175, 80, 0.2); }
.section-toggle input[type="checkbox"] { margin-right: 0.5rem; cursor: pointer; accent-color: #644ae2; }
.toggle-label { font-size: 0.9rem; cursor: pointer; user-select: none; }
.section-toggle.disabled-toggle { opacity: 0.5; cursor: not-allowed; }
.section-toggle.disabled-toggle:hover { background-color: transparent; }
.section-toggle.disabled-toggle input[type="checkbox"] { cursor: not-allowed; }
.section-toggle.disabled-toggle .toggle-label { cursor: not-allowed; opacity: 0.6; }
.control-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.arrow { width: 18px; display: inline-block; margin-right: 0.25rem; }
.recipe-image-container { position: relative; width: 110px; height: 110px; flex-shrink: 0; justify-self: end; align-self: start; }
.recipe-image-placeholder { aspect-ratio: 1; background: #333333; border: 2px dashed #644ae2; border-radius: 4px; display: flex; justify-content: center; color: #e0e0e0; font-size: 0.875rem; text-align: center; width: 110px; height: 110px; flex-shrink: 0; cursor: pointer; position: relative; overflow: hidden; }
.recipe-image-placeholder:hover { border-color: color-mix(in srgb, #644ae2 85%, black); background: rgba(76, 175, 80, 0.2); }
.recipe-image-display { position: relative; width: 100%; height: 100%; border-radius: 4px; overflow: hidden; cursor: pointer; }
.recipe-image-display img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; }
.image-controls { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(transparent, rgba(0, 0, 0, 0.8)); display: flex; gap: 2px; padding: 8px 4px 4px 4px; opacity: 0; }
.recipe-image-display:hover .image-controls { opacity: 1; }
.image-change-btn, .image-remove-btn { flex: 1; padding: 3px 6px; font-size: 0.6rem; border: none; border-radius: 3px; cursor: pointer; font-weight: 600; }
.image-change-btn { background: #644ae2; color: #121212; }
.image-change-btn:hover { background: color-mix(in srgb, #644ae2 85%, black); }
.image-remove-btn { background: #e57373; color: white; }
.image-remove-btn:hover { background: #c82333; }
.image-input-tabs { display: flex; margin-bottom: 1rem; border-bottom: 1px solid #444444; background: #333333; border-radius: 4px 4px 0 0; }
.tab-btn { flex: 1; padding: 0.5rem 1rem; background: none; border: none; border-bottom: 2px solid transparent; cursor: pointer; color: #e0e0e0; font-weight: 500; }
.tab-btn:hover { background: rgba(76, 175, 80, 0.2); }
.tab-btn.active { border-bottom-color: #644ae2; color: #644ae2; background: #121212; }
/* SVG Icon Styles */
.icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

.icon-inline {
  display: inline;
  vertical-align: text-bottom;
  margin-right: 0.25rem;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* Icon color inherits from parent text color */
.icon {
  color: inherit;
}

.icon svg {
  fill: currentColor;
  stroke: currentColor;
  display: block;
}

/* Ensure Lucide icons are visible */
.icon svg[fill="none"] {
  fill: none !important;
  stroke: currentColor !important;
}

/* Fallback for icons that might not inherit color properly */
.icon svg {
  stroke: currentColor;
  fill: none;
}

/* For buttons and links, ensure icon color is visible */
button .icon svg,
a .icon svg {
  stroke: currentColor;
  fill: none;
}

/* Header buttons specifically */
.header-button .icon svg {
  stroke: currentColor;
  fill: none;
}

/* Specific icon colors */
.icon-white svg {
  fill: white;
  stroke: white;
}

.icon-danger svg {
  fill: #e57373;
  stroke: #e57373;
}

.icon-success svg {
  fill: #51cf66;
  stroke: #51cf66;
}

.icon-warning svg {
  fill: #ff9800;
  stroke: #ff9800;
}

.icon-primary svg {
  fill: #644ae2;
  stroke: #644ae2;
}

/* Icon placeholder loading state */
.icon-placeholder {
  display: inline-block;
  width: 20px;
  height: 20px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.6; }
}

@media print { .section-controls, .file-input-container, .app-header, .print-button, .back-button, .error-message, .toast-error, .toast-warning, .toast-info, .recipe-toast, .loading-overlay, .image-controls, .image-upload-modal, .recipe-image-placeholder, #sectionControls, .floating-close-button, .floating-upload-button, .upload-modal, .debug-toggle-btn, .debug-control-panel { display: none !important; } body { padding-top: 0; } .recipe-image-display { cursor: default; } .recipe-image-display:hover { transform: none; } }