/* PPT 이미지/영상 추출 전용 스타일 */

/* 진행 상태 (다른 구조: progress-bar / progress-fill) */
.progress-section {
  text-align: center;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.3s;
}

/* 결과 섹션 */
.result-section {
  margin-top: 1.5rem;
}

.result-section[hidden] {
  display: none;
}

/* 파일 정보 바 */
.file-info-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

.file-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: rgba(102, 126, 234, 0.1);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--primary);
}

.file-info {
  flex: 1;
  min-width: 0;
}

.file-name {
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-meta {
  font-size: 0.75rem;
  color: var(--text-sub);
}

.btn-change {
  padding: 0.35rem 0.75rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-sub);
  font-size: 0.8rem;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: border-color 0.2s, color 0.2s;
}

.btn-change:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* 필터 탭 */
.filter-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.filter-tab {
  padding: 0.4rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-sub);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.filter-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* 미디어 그리드 */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.media-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.media-card .preview {
  width: 100%;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  overflow: hidden;
}

.media-card .preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.media-card .preview video {
  max-width: 100%;
  max-height: 100%;
}

.media-card .preview .video-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  color: var(--text-sub);
  font-size: 0.75rem;
}

.media-card .preview .video-placeholder .play-icon {
  font-size: 2rem;
}

.media-card .card-info {
  padding: 0.5rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.media-card .card-detail {
  flex: 1;
  min-width: 0;
}

.media-card .card-name {
  font-size: 0.75rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.media-card .card-size {
  font-size: 0.7rem;
  color: var(--text-sub);
}

.media-card .card-type {
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  color: white;
  background: var(--primary);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  flex-shrink: 0;
}

.media-card .card-type.video {
  background: #e85d04;
}

.media-card .btn-download {
  padding: 0.3rem 0.6rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 5px;
  font-size: 0.7rem;
  font-weight: 500;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s;
}

.media-card .btn-download:hover {
  background: var(--primary-hover);
}

/* 빈 상태 */
.empty-message {
  text-align: center;
  padding: 2rem;
  color: var(--text-sub);
  font-size: 0.9rem;
  grid-column: 1 / -1;
}

/* 전체 다운로드 (override: 풀 width, 다른 padding) */
.btn-download-all {
  width: 100%;
  padding: 0.75rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  margin-top: 0;
}

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

.btn-reset {
  display: block;
  width: 100%;
  padding: 0.6rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-sub);
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.btn-reset:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* 미리보기 클릭 커서 */
.media-card .preview {
  cursor: pointer;
  position: relative;
}

/* 비디오 썸네일 위 재생 아이콘 오버레이 */
.media-card .preview .video-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.25);
  pointer-events: none;
  transition: background 0.2s;
}

.media-card .preview:hover .video-overlay {
  background: rgba(0, 0, 0, 0.4);
}

.media-card .preview .video-overlay svg {
  width: 40px;
  height: 40px;
  fill: white;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.4));
}

/* 라이트박스 */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-close {
  position: absolute;
  top: -2.5rem;
  right: -0.5rem;
  background: none;
  border: none;
  color: white;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  z-index: 1;
  padding: 0.25rem 0.5rem;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.lightbox-close:hover {
  opacity: 1;
}

.lightbox-body img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox-body video {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: 4px;
  background: #000;
}

/* 반응형 */
@media (max-width: 480px) {
  .media-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }

  .media-card .preview {
    height: 110px;
  }

  .file-info-bar {
    flex-wrap: wrap;
  }
}
