/* File: assets/style.css */
.ai-photo-wrapper {
  max-width: 750px;
  margin: 40px auto;
  background: linear-gradient(to right, #f8fbff, #e8f0ff);
  padding: 30px;
  border-radius: 16px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  font-family: 'Segoe UI', sans-serif;
  position: relative;
  transition: all 0.3s ease;
}

.ai-photo-wrapper h2 {
  text-align: center;
  margin-bottom: 20px;
  color: #003366;
}

.workflow-steps {
  display: flex;
  justify-content: space-between;
  margin-bottom: 25px;
  border-bottom: 1px solid #e0e0e0;
  padding-bottom: 10px;
}

.step {
  padding: 8px 15px;
  border-radius: 20px;
  background: #e0e7ff;
  color: #4f46e5;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.step.active {
  background: #4f46e5;
  color: white;
}

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

.points-display {
  display: flex;
  align-items: center;
  gap: 10px;
}

.points-counter {
  background: #d1fae5;
  padding: 8px 15px;
  border-radius: 20px;
  font-weight: 600;
  color: #065f46;
}

.points-counter .count {
  font-size: 1.2em;
  font-weight: 700;
}

.points-help {
  position: relative;
}

.points-help button {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e0f2fe;
  color: #0369a1;
  border: none;
  font-weight: bold;
  cursor: pointer;
}

.points-tooltip {
  position: absolute;
  bottom: 100%;
  left: 0;
  background: white;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  width: 250px;
  z-index: 100;
  display: none;
}

.points-help:hover .points-tooltip {
  display: block;
}

.ai-photo-form label {
  display: block;
  margin-top: 12px;
  font-weight: 600;
  color: #333;
  margin-bottom: 5px;
}

.ai-photo-form input[type="text"],
.ai-photo-form textarea,
.ai-photo-form select {
  width: 100%;
  padding: 12px;
  margin-top: 5px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 14px;
  background: white;
}

.ai-photo-form textarea {
  min-height: 100px;
  resize: vertical;
}

.char-counter {
  text-align: right;
  font-size: 12px;
  color: #666;
  margin-top: 3px;
}

.file-uploader {
  margin: 15px 0;
}

.drop-zone {
  border: 2px dashed #cbd5e1;
  border-radius: 8px;
  padding: 25px;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.3s;
}

.drop-zone:hover {
  border-color: #4f46e5;
  background: #f0f9ff;
}

.drop-zone .dashicons {
  font-size: 40px;
  color: #94a3b8;
  margin-bottom: 10px;
}

.browse-btn {
  background: #4f46e5;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  margin-top: 10px;
  cursor: pointer;
  transition: background 0.3s;
}

.browse-btn:hover {
  background: #4338ca;
}

.file-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 15px;
}

.preview-item {
  width: 120px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}

.preview-item img {
  width: 100%;
  height: 80px;
  object-fit: cover;
}

.file-info {
  padding: 5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.file-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80px;
}

.remove-file {
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-size: 16px;
  padding: 2px;
}

.ocr-preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 15px;
}

.ocr-text-container textarea {
  width: 100%;
  min-height: 200px;
}

.ocr-original {
  background: #f3f4f6;
  border-radius: 8px;
  padding: 10px;
  text-align: center;
}

.pdf-preview {
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border: 1px solid #e5e7eb;
}

.page-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.page-nav button {
  background: #e5e7eb;
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
}

.ai-btn {
  margin-top: 20px;
  padding: 14px 20px;
  background: #0066cc;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  width: 100%;
  font-size: 16px;
  font-weight: 600;
  transition: background 0.3s;
}

.ai-btn:hover {
  background: #004d99;
}

#ai-spinner {
  display: none;
  margin-top: 20px;
}

.progress-bar {
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 15px;
}

.progress {
  height: 100%;
  background: #4f46e5;
  width: 0%;
  transition: width 0.3s;
}

.processing-message {
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 10px;
  color: #334155;
}

.dots::after {
  content: '';
  animation: dots 1.5s infinite;
}

@keyframes dots {
  0%, 20% { content: '.'; }
  40% { content: '..'; }
  60%, 100% { content: '...'; }
}

.hints {
  text-align: center;
  color: #64748b;
  margin-top: 15px;
}

.ai-result {
  margin-top: 20px;
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.ai-result textarea {
  width: 100%;
  min-height: 200px;
  padding: 15px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 15px;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.result-actions button {
  background: #e0f2fe;
  color: #0369a1;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: background 0.3s;
}

.result-actions button:hover {
  background: #bae6fd;
}

.floating-help {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 100;
}

.help-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #4f46e5;
  color: white;
  border: none;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  transition: all 0.3s;
}

.help-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 15px rgba(0,0,0,0.2);
}

.help-content {
  position: absolute;
  bottom: 60px;
  right: 0;
  width: 300px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  padding: 20px;
  display: none;
}

.help-content h3 {
  margin-top: 0;
  color: #1e293b;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 10px;
}

.examples {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #f1f5f9;
}

.examples h4 {
  margin: 0 0 10px;
  color: #334155;
}

.examples ul {
  padding-left: 20px;
  margin: 0;
}

.examples li {
  margin-bottom: 8px;
}

.floating-help:hover .help-content {
  display: block;
}

.history-controls {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

#history-search {
  flex-grow: 1;
  max-width: 300px;
  padding: 8px 12px;
}

.card-controls {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}

.category-filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.category-filter button {
  background: #e0f2fe;
  border: none;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
}

.category-filter button.active {
  background: #4f46e5;
  color: white;
}

.search-tools input {
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  min-width: 250px;
}

/* Card grid container */
.edu-cards-container {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin: 2rem 0;
}

/* Individual card */
.edu-card {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.3s;
}

.edu-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

.edu-card h3 {
  margin-top: 0;
  color: #1e293b;
}

.edu-card p {
  margin: 0.5rem 0;
  flex-grow: 1;
  color: #475569;
}

.edu-card-btn {
  display: inline-block;
  text-align: center;
  margin-top: 1rem;
  padding: 0.6rem 1.2rem;
  border-radius: 4px;
  background-color: #0073aa;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.3s;
}
.edu-card-btn:hover {
  background-color: #005177;
}

@media (max-width: 768px) {
  .ai-photo-wrapper {
    padding: 20px;
    margin: 20px 10px;
  }
  
  .workflow-steps {
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .step {
    font-size: 14px;
    padding: 6px 12px;
  }
  
  .ocr-preview {
    grid-template-columns: 1fr;
  }
  
  .card-controls {
    flex-direction: column;
  }
  
  .category-filter {
    justify-content: center;
  }
  
  .search-tools {
    width: 100%;
  }
  
  .search-tools input {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .tool-header {
    flex-direction: column;
    gap: 15px;
  }
  
  .result-actions {
    flex-direction: column;
  }
  
  .result-actions button {
    width: 100%;
  }
}