* {
  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 {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 30px 40px;
}

.header-content {
  text-align: center;
  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;
  text-align: center;
}

.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 {
  padding: 40px;
  max-width: 1800px;
  margin: 0 auto;
}

section {
  margin-bottom: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid #e0e0e0;
}

section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

h2 {
  font-size: 20px;
  margin-bottom: 20px;
  color: #333;
}

/* Upload Area */
.upload-area {
  border: 2px dashed #667eea;
  border-radius: 8px;
  padding: 40px;
  text-align: center;
  background: #f8f9ff;
  cursor: pointer;
  transition: all 0.3s;
  margin-bottom: 20px;
}

.upload-area:hover {
  background: #f0f2ff;
  border-color: #764ba2;
}

.upload-label {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.upload-icon {
  font-size: 48px;
}

.file-info {
  background: #f5f5f5;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.file-info p {
  margin: 5px 0;
  color: #555;
}

/* Buttons */
.btn {
  padding: 12px 30px;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  width: 100%;
}

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

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-success {
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  color: white;
}

.btn-success:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(17, 153, 142, 0.4);
}

.btn-danger {
  background: linear-gradient(135deg, #eb3941 0%, #f15e64 100%);
  color: white;
}

.btn-danger:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(235, 57, 65, 0.4);
}

/* Extract Info */
.extract-info {
  background: #f8f9ff;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  border-left: 4px solid #667eea;
}

.extract-info p {
  margin: 0;
  color: #555;
}

.extract-progress-area {
  margin-bottom: 20px;
}

.extract-details {
  margin-top: 15px;
}

.extract-details p {
  margin: 5px 0;
  color: #555;
}

/* Timer Info */
.timer-info {
  background: #f0f2ff;
  padding: 10px 15px;
  border-radius: 6px;
  margin-top: 10px;
  border-left: 3px solid #667eea;
}

.timer-info p {
  margin: 0;
  font-family: 'Courier New', monospace;
}

/* Slider Container */
.slider-container {
  background: #f8f9ff;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  border-left: 4px solid #667eea;
}

.slider-container label {
  display: block;
  margin-bottom: 15px;
  color: #333;
  font-weight: 600;
  font-size: 15px;
}

.slider-with-value {
  display: flex;
  align-items: center;
  gap: 20px;
}

.slider-with-value input[type="range"] {
  flex: 1;
  height: 8px;
  background: #e0e0e0;
  border-radius: 5px;
  outline: none;
  -webkit-appearance: none;
}

.slider-with-value input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s;
}

.slider-with-value input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.slider-with-value input[type="range"]::-moz-range-thumb {
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  transition: transform 0.2s;
}

.slider-with-value input[type="range"]::-moz-range-thumb:hover {
  transform: scale(1.2);
}

#imageCountValue {
  min-width: 30px;
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  color: #667eea;
}

/* Progress Bar */
.progress-area {
  margin-bottom: 20px;
}

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

.progress-fill {
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  width: 0%;
  transition: width 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
}

.progress-text {
  text-align: center;
  color: #555;
  font-weight: 500;
}

/* Results Info */
.results-info {
  background: #f5f5f5;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.results-info p {
  margin: 5px 0;
  color: #555;
}

/* Collapsible Extracted Data */
.extracted-data {
  margin-bottom: 20px;
}

.collapsible {
  width: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  cursor: pointer;
  padding: 15px;
  border: none;
  border-radius: 8px;
  text-align: left;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s;
}

.collapsible:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.collapsible .arrow {
  transition: transform 0.3s;
}

.collapsible.active .arrow {
  transform: rotate(180deg);
}

.collapsible-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  background: #f8f9ff;
  border-radius: 0 0 8px 8px;
}

.collapsible-content.active {
  max-height: 500px;
  overflow-y: auto;
  padding: 20px;
  margin-top: 5px;
  border: 1px solid #e0e0e0;
}

/* Scrollbar styling for collapsible content */
.collapsible-content::-webkit-scrollbar {
  width: 8px;
}

.collapsible-content::-webkit-scrollbar-track {
  background: #e0e0e0;
  border-radius: 4px;
}

.collapsible-content::-webkit-scrollbar-thumb {
  background: #667eea;
  border-radius: 4px;
}

.collapsible-content::-webkit-scrollbar-thumb:hover {
  background: #764ba2;
}

.row-item {
  background: white;
  padding: 15px;
  margin-bottom: 15px;
  border-radius: 8px;
  border-left: 4px solid #667eea;
}

.row-item:last-child {
  margin-bottom: 0;
}

.row-item h4 {
  margin: 0 0 10px 0;
  color: #667eea;
  font-size: 16px;
}

.row-item p {
  margin: 5px 0;
  color: #555;
  font-size: 14px;
}

.row-item strong {
  color: #333;
}

.row-item .links {
  margin-top: 8px;
  padding-left: 20px;
}

.row-item .links li {
  margin: 3px 0;
  font-size: 13px;
  color: #667eea;
  word-break: break-all;
}

/* Image Grid */
.image-category {
  margin-bottom: 20px;
}

.image-category:last-child {
  margin-bottom: 0;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
  margin-top: 10px;
}

.image-item {
  background: #f8f9ff;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 2px solid #e0e0e0;
}

.image-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  border-color: #667eea;
}

.image-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

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

.extracted-images-section {
  margin-bottom: 20px;
}

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