/* Admin Media Library Styles */

/* Media Library Container */
.media-library-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 3rem;
}

.media-library-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2.4rem;
}

.media-library-header h1 {
  font-size: 3.2rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  color: #111827;
}

.media-subtitle {
  font-size: 1.5rem;
  color: #6b7280;
  margin: 0;
}

.media-library-header .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem 1.6rem;
  font-size: 1.5rem;
  font-weight: 600;
}

.media-library-header .btn svg {
  flex-shrink: 0;
}

/* Media Filters */
.media-filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 2.4rem;
  padding-bottom: 1.6rem;
  border-bottom: 0.2rem solid #e5e7eb;
  flex-wrap: wrap;
}

.media-filters-left {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.8rem 1.6rem;
  font-size: 1.4rem;
  font-weight: 600;
  color: #6b7280;
  background: white;
  border: 0.1rem solid #e5e7eb;
  border-radius: 0.6rem;
  text-decoration: none;
  transition: all 0.15s;
  cursor: pointer;
}

.filter-btn:hover {
  background: #f9fafb;
  color: #374151;
  border-color: #d1d5db;
}

.filter-btn.active {
  background: #3b82f6;
  color: white;
  border-color: #3b82f6;
}

.filter-btn.active:hover {
  background: #2563eb;
  border-color: #2563eb;
}

/* Media Grid */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.media-item {
  background: white;
  border: 0.1rem solid #e5e7eb;
  border-radius: 0.8rem;
  overflow: hidden;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
}

.media-item:hover {
  border-color: #3b82f6;
  box-shadow: 0 0.4rem 1.2rem rgba(59, 130, 246, 0.15);
  transform: translateY(-0.2rem);
}

/* Media Thumbnail */
.media-thumbnail {
  width: 100%;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  overflow: hidden;
  position: relative;
}

.media-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: #9ca3af;
}

/* Media Info */
.media-info {
  padding: 1.2rem;
  flex: 1;
}

.media-title {
  font-size: 1.4rem;
  font-weight: 600;
  color: #111827;
  margin: 0 0 0.8rem 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
  font-size: 1.2rem;
}

.media-type-badge {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  background: #e0e7ff;
  color: #3730a3;
  border-radius: 0.3rem;
  font-weight: 600;
  text-transform: capitalize;
}

.media-size {
  color: #6b7280;
}

/* Copy URL */
.media-copy-url {
  padding: 0 1.2rem 0.4rem;
}

.btn-copy-url {
  background: none;
  border: 0.1rem dashed #d1d5db;
  border-radius: 0.4rem;
  padding: 0.3rem 0.8rem;
  font-size: 1.1rem;
  color: #6b7280;
  cursor: pointer;
  width: 100%;
  transition: color 0.2s, border-color 0.2s;
}

.btn-copy-url:hover {
  color: #374151;
  border-color: #9ca3af;
}

/* Media Actions */
.media-actions {
  display: flex;
  gap: 0.6rem;
  padding: 0.8rem 1.2rem;
  border-top: 0.1rem solid #e5e7eb;
  background: #fafafa;
  justify-content: flex-end;
}

/* Empty State */
.media-empty-state {
  text-align: center;
  padding: 8rem 2rem;
  background: white;
  border-radius: 0.8rem;
  border: 0.2rem dashed #e5e7eb;
}

.media-empty-state svg {
  margin-bottom: 2rem;
  color: #d1d5db;
}

.media-empty-state h2 {
  font-size: 2.4rem;
  font-weight: 600;
  margin: 0 0 1rem 0;
  color: #374151;
}

.media-empty-state p {
  font-size: 1.6rem;
  color: #6b7280;
  margin: 0 0 2.4rem 0;
}

.media-empty-state .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
}

/* Media Upload Form */
.media-upload-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 3rem;
}

.media-upload-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3rem;
}

.media-upload-header h1 {
  font-size: 3.2rem;
  font-weight: 700;
  margin: 0;
  color: #111827;
}

.media-upload-form {
  background: white;
  border-radius: 0.8rem;
  box-shadow: 0 0.1rem 0.3rem rgba(0, 0, 0, 0.1);
  padding: 3rem;
}

/* Upload Dropzone */
.upload-dropzone {
  position: relative;
  border: 0.3rem dashed #d1d5db;
  border-radius: 0.8rem;
  padding: 6rem 2rem;
  text-align: center;
  background: #fafafa;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 2.4rem;
}

.upload-dropzone:hover {
  border-color: #3b82f6;
  background: #f0f9ff;
}

.upload-dropzone.drag-over {
  border-color: #3b82f6;
  background: #dbeafe;
  border-style: solid;
}

.upload-dropzone svg {
  margin-bottom: 1.6rem;
  color: #9ca3af;
}

.upload-dropzone.drag-over svg {
  color: #3b82f6;
}

.upload-dropzone h3 {
  font-size: 1.8rem;
  font-weight: 600;
  margin: 0 0 0.8rem 0;
  color: #374151;
}

.upload-dropzone p {
  font-size: 1.4rem;
  color: #6b7280;
  margin: 0;
}

.file-input {
  position: absolute;
  width: 0.1px;
  height: 0.1px;
  opacity: 0;
  overflow: hidden;
  z-index: -1;
}

/* Upload Preview */
.upload-preview {
  margin-bottom: 2.4rem;
}

.upload-preview h3 {
  font-size: 1.6rem;
  font-weight: 600;
  color: #111827;
  margin: 0 0 1.2rem 0;
}

.preview-content {
  background: #f9fafb;
  border: 0.1rem solid #e5e7eb;
  border-radius: 0.6rem;
  padding: 1.6rem;
}

.file-preview-item {
  display: flex;
  align-items: center;
  gap: 1.6rem;
}

.file-preview-thumbnail {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 0.6rem;
  border: 0.1rem solid #e5e7eb;
  margin-bottom: 1.2rem;
  display: block;
}

.file-preview-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  background: white;
  border-radius: 0.6rem;
  border: 0.1rem solid #e5e7eb;
  color: #6b7280;
}

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

.file-name {
  font-size: 1.5rem;
  font-weight: 600;
  color: #111827;
  margin: 0 0 0.4rem 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-size {
  font-size: 1.3rem;
  color: #6b7280;
  margin: 0;
}

/* Form Groups */
.form-group {
  margin-bottom: 2rem;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  font-size: 1.4rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.6rem;
}

.form-control {
  width: 100%;
  padding: 1rem 1.2rem;
  font-size: 1.5rem;
  border: 0.1rem solid #d1d5db;
  border-radius: 0.6rem;
  transition: border-color 0.15s;
  box-sizing: border-box;
  font-family: system-ui, -apple-system, sans-serif;
}

.form-control:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 0.3rem rgba(59, 130, 246, 0.1);
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

/* Form Actions */
.form-actions {
  display: flex;
  gap: 1.2rem;
  justify-content: flex-end;
  margin-top: 2.4rem;
  padding-top: 2.4rem;
  border-top: 0.1rem solid #e5e7eb;
}

/* Form Errors */
.form-errors {
  background: #fee2e2;
  border: 0.1rem solid #dc2626;
  border-radius: 0.6rem;
  padding: 1.6rem;
  margin-bottom: 2.4rem;
}

.form-errors h2 {
  font-size: 1.6rem;
  font-weight: 600;
  color: #991b1b;
  margin: 0 0 1rem 0;
}

.form-errors ul {
  margin: 0;
  padding-left: 2rem;
}

.form-errors li {
  color: #991b1b;
  font-size: 1.4rem;
  line-height: 1.6;
}

/* Responsive */
@media (max-width: 768px) {
  .media-library-container,
  .media-upload-container {
    padding: 2rem 1.5rem;
  }

  .media-library-header,
  .media-upload-header {
    flex-direction: column;
    gap: 1.6rem;
    align-items: stretch;
  }

  .media-library-header .btn {
    width: 100%;
    justify-content: center;
  }

  .media-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1.2rem;
  }

  .media-thumbnail {
    height: 160px;
  }

  .upload-dropzone {
    padding: 4rem 1.5rem;
  }

  .media-upload-form {
    padding: 2rem;
  }

  .form-actions {
    flex-direction: column;
  }

  .form-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

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

  .media-filters {
    gap: 0.6rem;
  }

  .filter-btn {
    flex: 1;
    text-align: center;
    padding: 0.6rem 1rem;
    font-size: 1.3rem;
  }
}
