/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 0;
  margin: 0;
}

.container {
  width: 100%;
  min-height: 100vh;
  background: white;
  overflow: hidden;
}

/* Header */
header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 30px 40px;
}

.header-content {
  max-width: 1800px;
  margin: 0 auto;
}

header h1 {
  font-size: 32px;
  margin-bottom: 10px;
}

header p {
  font-size: 16px;
  opacity: 0.9;
}

.header-nav {
  max-width: 1800px;
  margin: 20px auto 0;
}

.nav-link {
  display: inline-block;
  color: white;
  text-decoration: none;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateX(-3px);
}

/* Main Content */
main {
  padding: 40px;
  max-width: 1800px;
  margin: 0 auto;
}

section {
  margin-bottom: 40px;
}

/* Button Styles */
.btn {
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  outline: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: #667eea;
  color: white;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover:not(:disabled) {
  background: #5568d3;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
  background: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background: #5a6268;
}

.btn-small {
  padding: 6px 12px;
  font-size: 12px;
  margin-top: 5px;
}

/* Job Selector Section */
.job-selector-section {
  background: white;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.job-selector label {
  display: block;
  margin-bottom: 10px;
  color: #333;
  font-weight: 600;
  font-size: 16px;
}

.job-select-container {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.job-dropdown {
  flex: 1;
  min-width: 300px;
  padding: 12px 15px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  color: #333;
  background: white;
  cursor: pointer;
  transition: border-color 0.2s;
}

.job-dropdown:hover {
  border-color: #667eea;
}

.job-dropdown:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Job Details */
.job-details {
  background: white;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.job-header {
  background: #f8f9ff;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 30px;
  border-left: 4px solid #667eea;
}

.job-header h2 {
  margin: 0 0 10px 0;
  color: #333;
  font-size: 24px;
}

.job-header p {
  margin: 5px 0;
  color: #666;
  font-size: 14px;
}

/* Rows Container */
.rows-container {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

/* Row Navigation */
.row-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  margin-bottom: 20px;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.row-indicator {
  color: white;
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.row-main {
  font-size: 20px;
  font-weight: 700;
}

.row-sno {
  font-size: 14px;
  font-weight: 400;
  opacity: 0.9;
}

.keyboard-hint {
  font-size: 12px;
  opacity: 0.8;
  font-weight: 400;
  margin-top: 5px;
}

.nav-btn {
  min-width: 150px;
  background: white;
  color: #667eea;
  font-weight: 600;
  padding: 12px 24px;
  border: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.nav-btn:hover:not(:disabled) {
  background: #f8f9ff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.nav-btn:disabled {
  background: rgba(255, 255, 255, 0.5);
  color: rgba(102, 126, 234, 0.5);
  cursor: not-allowed;
  box-shadow: none;
}

@media (max-width: 768px) {
  .row-navigation {
    flex-direction: column;
    gap: 15px;
  }

  .nav-btn {
    width: 100%;
  }

  .row-indicator {
    order: -1;
    margin-bottom: 10px;
  }
}

/* Individual Row */
.job-row {
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  padding: 20px;
  transition: box-shadow 0.3s;
}

.job-row:hover {
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.row-header {
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid #f0f0f0;
}

.row-header h3 {
  margin: 0 0 10px 0;
  color: #333;
  font-size: 20px;
}

.row-brief {
  margin: 0;
  color: #666;
  font-size: 14px;
  line-height: 1.6;
}

/* Generated Images Section */
.generated-images-section {
  margin: 20px 0 30px 0;
  padding: 20px;
  background: #f0f4ff;
  border-radius: 12px;
  border: 2px solid #667eea;
}

.generated-header {
  margin: 0 0 20px 0;
  color: #667eea;
  font-size: 18px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding-bottom: 15px;
  border-bottom: 3px solid #667eea;
}

.generated-images-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 25px;
}

.generated-card {
  background: white;
  border: 3px solid #667eea;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.generated-card:hover {
  border-color: #5568d3;
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.25);
  transform: translateY(-3px);
}

.generated-card .preview-image {
  height: 350px;
}

/* References Header */
.references-header {
  margin: 30px 0 20px 0;
  color: #555;
  font-size: 16px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding-bottom: 10px;
  border-bottom: 2px solid #e0e0e0;
}

/* Image Columns (for reference images) */
.image-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

@media (max-width: 1400px) {
  .image-columns {
    grid-template-columns: repeat(2, 1fr);
  }

  .generated-images-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }
}

@media (max-width: 768px) {
  .image-columns {
    grid-template-columns: 1fr;
  }

  .generated-images-grid {
    grid-template-columns: 1fr;
  }

  main {
    padding: 20px;
  }

  header {
    padding: 20px;
  }
}

.image-column {
  background: transparent;
  border-radius: 0;
  padding: 0;
  min-height: auto;
}

.column-header {
  margin: 0 0 15px 0;
  color: #667eea;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding-bottom: 10px;
  border-bottom: 2px solid #667eea;
  background: #f8f9ff;
  padding: 10px;
  border-radius: 6px 6px 0 0;
}

.column-images {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.no-images {
  text-align: center;
  color: #999;
  font-style: italic;
  margin: 20px 0;
}

/* Image Cards */
.image-card {
  background: white;
  border-radius: 8px;
  padding: 8px;
  border: 2px solid #e0e0e0;
  transition: all 0.2s;
}

.image-card:hover {
  border-color: #667eea;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.preview-image {
  width: 100%;
  height: 150px;
  object-fit: contain;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.2s;
  display: block;
  margin-bottom: 5px;
  background: #f8f9ff;
}

.preview-image:hover {
  transform: scale(1.02);
}

/* Reference images (no card wrapper) */
.reference-image {
  height: 250px;
  background: transparent;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 0;
}

.reference-image:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.image-filename {
  padding: 5px 8px;
  margin: 0;
  font-size: 10px;
  color: #666;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.image-prompt {
  margin: 10px 0;
  padding: 10px;
  background: #f8f9ff;
  border-radius: 6px;
  font-size: 12px;
  color: #555;
  line-height: 1.4;
}

.image-prompt strong {
  color: #667eea;
}

/* Feedback Controls */
.feedback-controls {
  display: flex;
  gap: 8px;
  margin: 10px 0;
  justify-content: center;
}

.feedback-btn {
  background: #f0f0f0;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s;
  outline: none;
}

.feedback-btn:hover {
  background: #e8e8e8;
  transform: scale(1.1);
}

.feedback-btn.active {
  background: #667eea;
  border-color: #667eea;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
  transform: scale(1.1);
}

.star-btn.active {
  background: #ffd700;
  border-color: #ffd700;
  box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
}

.thumbs-up-btn.active {
  background: #28a745;
  border-color: #28a745;
  box-shadow: 0 2px 8px rgba(40, 167, 69, 0.4);
}

.thumbs-down-btn.active {
  background: #dc3545;
  border-color: #dc3545;
  box-shadow: 0 2px 8px rgba(220, 53, 69, 0.4);
}

/* Notes Section */
.notes-section {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #e0e0e0;
}

.notes-textarea {
  width: 100%;
  padding: 8px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-family: inherit;
  font-size: 12px;
  resize: vertical;
  transition: border-color 0.2s;
}

.notes-textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.save-note-btn {
  width: 100%;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 600;
}

.save-note-btn:hover:not(:disabled) {
  background: #5568d3;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.save-note-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Lightbox Modal */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lightbox-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
}

.lightbox-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  z-index: 10001;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: transparent;
  border: none;
  color: white;
  font-size: 40px;
  cursor: pointer;
  padding: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}

.lightbox-close:hover {
  transform: scale(1.2);
}

.lightbox-content img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

.lightbox-caption {
  background: white;
  padding: 15px 20px;
  margin-top: 15px;
  border-radius: 8px;
  color: #333;
  font-size: 14px;
  text-align: center;
  max-width: 600px;
  line-height: 1.6;
}

.lightbox-caption strong {
  color: #667eea;
  display: block;
  margin-bottom: 5px;
}

.lightbox-caption em {
  color: #666;
  font-size: 12px;
}

/* Footer */
footer {
  background: #f5f5f5;
  padding: 20px;
  text-align: center;
  color: #666;
  font-size: 14px;
  margin-top: 40px;
}
