* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  min-height: 100vh;
  color: #fff;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

/* Header */
.header {
  text-align: center;
  padding: 40px 20px;
  margin-bottom: 30px;
}

.header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 10px;
  background: linear-gradient(90deg, #00d9ff, #00ff88);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header p {
  color: #94a3b8;
  font-size: 1.1rem;
}

/* Search Box */
.search-box {
  display: flex;
  gap: 12px;
  max-width: 600px;
  margin: 0 auto 40px;
}

.search-input {
  flex: 1;
  padding: 16px 24px;
  font-size: 1.1rem;
  border: 2px solid #334155;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  outline: none;
  transition: all 0.3s ease;
}

.search-input:focus {
  border-color: #00d9ff;
  box-shadow: 0 0 20px rgba(0, 217, 255, 0.2);
}

.search-input::placeholder {
  color: #64748b;
}

.search-btn {
  padding: 16px 32px;
  font-size: 1.1rem;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #00d9ff, #00ff88);
  color: #1a1a2e;
  cursor: pointer;
  transition: all 0.3s ease;
}

.search-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 217, 255, 0.3);
}

.search-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Loading */
.loading {
  display: none;
  text-align: center;
  padding: 60px;
}

.loading.show {
  display: block;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(0, 217, 255, 0.2);
  border-top-color: #00d9ff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Results */
.results {
  display: none;
}

.results.show {
  display: block;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #334155;
}

.results-count {
  font-size: 1.2rem;
  color: #94a3b8;
}

.results-count span {
  color: #00ff88;
  font-weight: 600;
}

/* Flat Items Layout */
.folder-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 12px;
  border: 1px solid #334155;
  transition: all 0.3s ease;
}

.folder-item:hover {
  border-color: #fbbf24;
  background: rgba(251, 191, 36, 0.05);
}

.folder-item-icon {
  font-size: 1.5rem;
  color: #fbbf24;
}

.folder-item-name {
  flex: 1;
  font-size: 1rem;
  font-weight: 500;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.folder-item-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Files Grid Layout */
.files-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.file-item {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #334155;
  transition: all 0.3s ease;
}

.file-item:hover {
  border-color: #00d9ff;
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.file-item.psd-file {
  display: none;
}

.file-item.psd-file.show-psd {
  display: block;
}

.file-item-thumbnail {
  width: 100%;
  height: 140px;
  overflow: hidden;
  background: #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
}

.file-item-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.file-item-thumbnail:hover img {
  transform: scale(1.1);
}

.file-item-thumbnail .no-thumb {
  font-size: 2.5rem;
  color: #475569;
}

.file-item-info {
  padding: 12px;
}

.file-item-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
}

.file-item-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #64748b;
  margin-bottom: 10px;
}

.file-item-actions {
  display: flex;
  gap: 6px;
}

.file-item-actions .file-btn {
  flex: 1;
  padding: 6px 8px;
  font-size: 0.75rem;
}

/* Folder Link */
.folder-link {
  padding: 8px 16px;
  background: rgba(0, 217, 255, 0.1);
  border: 1px solid #00d9ff;
  border-radius: 8px;
  color: #00d9ff;
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.folder-link:hover {
  background: #00d9ff;
  color: #1a1a2e;
}

/* File Buttons */
.file-btn {
  flex: 1;
  padding: 8px;
  border: none;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.file-btn.view {
  background: rgba(100, 116, 139, 0.3);
  color: #94a3b8;
}

.file-btn.view:hover {
  background: rgba(100, 116, 139, 0.5);
}

.file-btn.download {
  background: linear-gradient(135deg, #00d9ff, #00ff88);
  color: #1a1a2e;
}

.file-btn.download:hover {
  transform: scale(1.05);
}

.file-btn.copy {
  background: rgba(100, 116, 139, 0.3);
  color: #94a3b8;
}

.file-btn.copy:hover {
  background: rgba(100, 116, 139, 0.5);
}

.file-btn.copy.copied {
  background: rgba(0, 255, 136, 0.2);
  color: #00ff88;
}

/* Copy Button */
.copy-btn {
  padding: 8px 12px;
  background: rgba(100, 116, 139, 0.2);
  border: 1px solid #64748b;
  border-radius: 8px;
  color: #94a3b8;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.copy-btn:hover {
  background: rgba(100, 116, 139, 0.4);
  border-color: #94a3b8;
}

.copy-btn.copied {
  background: rgba(0, 255, 136, 0.2);
  border-color: #00ff88;
  color: #00ff88;
}

/* Load More Button */
.load-more-container {
  text-align: center;
  padding: 20px;
  margin-top: 10px;
}

.load-more-btn {
  padding: 14px 40px;
  font-size: 1rem;
  font-weight: 600;
  border: 2px solid #00d9ff;
  border-radius: 12px;
  background: transparent;
  color: #00d9ff;
  cursor: pointer;
  transition: all 0.3s ease;
}

.load-more-btn:hover {
  background: #00d9ff;
  color: #1a1a2e;
}

.load-more-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.load-more-btn .mini-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0, 217, 255, 0.2);
  border-top-color: #00d9ff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

/* Error */
.error-box {
  display: none;
  text-align: center;
  padding: 40px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid #ef4444;
  border-radius: 12px;
  margin-top: 20px;
}

.error-box.show {
  display: block;
}

.error-box i {
  font-size: 3rem;
  color: #ef4444;
  margin-bottom: 16px;
}

.error-box p {
  color: #fca5a5;
  font-size: 1.1rem;
}

/* Filter Toggle */
.filter-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: #94a3b8;
  cursor: pointer;
}

.filter-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #00d9ff;
  cursor: pointer;
}

/* Image Zoom Modal */
.zoom-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(10px);
  animation: fadeIn 0.2s ease;
}

.zoom-modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.zoom-modal-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.zoom-modal-content img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  cursor: zoom-in;
  transition: transform 0.3s ease, opacity 0.2s ease;
}

.zoom-modal-content img.zoomed {
  cursor: zoom-out;
  transform: scale(2);
}

.zoom-modal-content img.loading {
  opacity: 0.3;
}

.zoom-loading-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 3px solid rgba(0, 217, 255, 0.2);
  border-top-color: #00d9ff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: none;
}

.zoom-loading-spinner.show {
  display: block;
}

.zoom-counter {
  position: absolute;
  bottom: -40px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.85rem;
  color: #64748b;
}

.zoom-modal-close {
  position: absolute;
  top: -50px;
  right: 0;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.zoom-modal-close:hover {
  background: rgba(239, 68, 68, 0.8);
  transform: rotate(90deg);
}

.zoom-modal-info {
  margin-top: 16px;
  text-align: center;
  color: #94a3b8;
}

.zoom-modal-info .filename {
  font-size: 1rem;
  font-weight: 500;
  color: #e2e8f0;
  margin-bottom: 8px;
}

.zoom-modal-info .hint {
  font-size: 0.8rem;
  color: #64748b;
}

.zoom-modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.zoom-modal-nav:hover {
  background: rgba(0, 217, 255, 0.3);
}

.zoom-modal-nav.prev {
  left: 20px;
}

.zoom-modal-nav.next {
  right: 20px;
}

/* Responsive */
@media (max-width: 768px) {
  .header h1 {
    font-size: 1.8rem;
  }
  
  .search-box {
    flex-direction: column;
  }
  
  .files-container {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
  
  .file-item-thumbnail {
    height: 100px;
  }
  
  .folder-item {
    flex-wrap: wrap;
  }
  
  .folder-item-actions {
    width: 100%;
    justify-content: flex-end;
  }
}
