:root {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-tertiary: #21262d;
  --text-primary: #c9d1d9;
  --text-secondary: #8b949e;
  --border-color: #30363d;
  --accent-color: #58a6ff;
  --danger-color: #f85149;
  --success-color: #56d364;
  --hover-color: #1f6feb;
  --folder-color: #e3b341;
  --file-color: #8b949e;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial,
    sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.logo-container {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.site-logo {
  height: 40px;
  width: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.header-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: center;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.header-link:hover {
  opacity: 0.9;
  transform: scale(1.01);
}

.header-link img,
.header-link h1 {
  cursor: pointer;
}

header h1 {
  font-size: 24px;
  font-weight: 600;
}

.user-menu {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.user-menu .username {
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

.user-menu a {
  padding: 6px 12px;
  border-radius: 6px;
  background-color: rgba(36, 41, 47, 0.5);
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

main {
  flex: 1;
}

.breadcrumb {
  display: flex;
  padding: 10px 0;
  margin-bottom: 20px;
  font-size: 14px;
  align-items: center;
}

.breadcrumb a {
  color: #58a6ff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb .separator {
  margin: 0 8px;
  color: #8b949e;
}

.breadcrumb span:last-child {
  font-weight: 500;
  color: #c9d1d9;
}

.content {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  overflow: hidden;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  background-color: rgba(22, 27, 34, 0.5);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 30px;
}

.empty-state i {
  color: #8b949e;
  margin-bottom: 20px;
}

.empty-state p {
  color: #8b949e;
  margin-bottom: 10px;
}

.empty-state p:last-of-type {
  margin-bottom: 0;
}

.folders {
  display: grid;
  gap: 16px;
  padding: 16px;
}

.folder-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--text-primary);
  padding: 16px;
  border-radius: 6px;
  transition: background-color 0.2s;
  text-align: center;
}

.folder-item:hover {
  background-color: var(--bg-tertiary);
}

.folder-item i {
  color: var(--folder-color);
  margin-bottom: 10px;
}

.folder-item span {
  word-break: break-word;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.folders-section,
.subfolder-section,
.videos-section,
.folder-section {
  margin-bottom: 20px;
}

.folders-section h2,
.subfolder-section h2,
.videos-section h2,
.folder-section h2 {
  padding: 12px 16px;
  font-size: 18px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  background-color: var(--bg-tertiary);
}

.folder-link {
  text-decoration: none;
  color: var(--accent-color);
}

.folder-link:hover {
  text-decoration: underline;
}

.files-header {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  padding: 8px 16px;
  gap: 10px;
}

.file-item {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  padding: 12px 16px;
  gap: 10px;
  align-items: center;
}

.file-name {
  flex: 2;
  display: flex;
  align-items: center;
}

.file-name i {
  color: var(--file-color);
  margin-right: 10px;
}

.file-name span {
  word-break: break-word;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.file-modified,
.file-size {
  flex: 1;
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
}

.file-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.action-btn {
  padding: 6px 12px;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.download-btn:hover {
  background-color: var(--success-color);
  color: var(--bg-primary);
}

.copy-btn:hover {
  background-color: var(--accent-color);
  color: var(--bg-primary);
}

.view-btn:hover {
  background-color: var(--danger-color);
  color: var(--bg-primary);
}

.back-btn:hover {
  background-color: var(--folder-color);
  color: var(--bg-primary);
}

.notification {
  position: fixed;
  bottom: -60px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  padding: 12px 20px;
  border-radius: 4px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  transition: bottom 0.3s ease-in-out;
  z-index: 1000;
}

.notification.show {
  bottom: 20px;
}

.video-info {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
}

.video-info h2 {
  font-size: 18px;
  margin-bottom: 10px;
  word-break: break-word;
}

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

.video-container {
  padding: 20px;
  background-color: var(--bg-primary);
}

.video-container video {
  width: 100%;
  max-height: 70vh;
  background-color: #000;
}

footer {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
}

@media (max-width: 575.98px) {
  .container {
    padding: 10px;
  }

  header h1 {
    font-size: 20px;
  }

  .logo-container {
    justify-content: center;
    text-align: center;
  }

  .user-menu {
    width: 100%;
    justify-content: center;
    margin-top: 15px;
  }

  .files-header {
    grid-template-columns: 2fr 1fr;
  }

  .file-item {
    grid-template-columns: 2fr 1fr;
  }

  .file-modified,
  .file-size {
    display: none;
  }

  .action-btn span {
    display: none;
  }

  .action-btn {
    padding: 8px;
  }

  .action-btn i {
    margin: 0;
  }

  .breadcrumb {
    font-size: 12px;
    flex-wrap: wrap;
  }
}

@media (min-width: 576px) and (max-width: 767.98px) {
  .container {
    padding: 15px;
  }

  .files-header {
    grid-template-columns: 2fr 1fr 1fr;
  }

  .file-item {
    grid-template-columns: 2fr 1fr 1fr;
  }

  .file-size {
    display: none;
  }

  .action-btn span {
    display: none;
  }
}

@media (min-width: 768px) and (max-width: 991.98px) {
  .files-header {
    grid-template-columns: 2fr 1fr 1fr 1fr;
  }

  .file-item {
    grid-template-columns: 2fr 1fr 1fr 1fr;
  }

  .video-card {
    width: calc(50% - 10px);
    float: left;
    margin: 5px;
  }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
  .video-card {
    width: calc(33.333% - 10px);
    float: left;
    margin: 5px;
  }
}

@media (min-width: 1200px) {
  .video-card {
    width: calc(25% - 10px);
    float: left;
    margin: 5px;
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  .container {
    padding: 10px;
  }

  header {
    margin-bottom: 10px;
    padding-bottom: 10px;
  }

  .video-thumbnail {
  }
}

@media (prefers-color-scheme: dark) {
  :root {
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

@media (min-width: 576px) {
  .folders {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .folders {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 992px) {
  .folders {
    grid-width: repeat(4, 1fr);
  }
}

@media (min-width: 1200px) {
  .folders {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .site-logo {
    image-rendering: -webkit-optimize-contrast;
  }
}

.videos-section::after {
  content: '';
  display: table;
  clear: both;
}

@media print {
  .action-btn,
  .video-actions,
  .conversion-tools {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }

  .container {
    max-width: 100%;
    padding: 0;
  }
}

.mkv-warning {
  background-color: rgba(248, 81, 73, 0.1);
  border-left: 4px solid var(--danger-color);
  padding: 10px 15px;
  margin-bottom: 15px;
  border-radius: 4px;
}

.mkv-warning p {
  margin-bottom: 8px;
  font-weight: 500;
}

.mkv-warning ul {
  margin-left: 20px;
  color: var(--text-secondary);
}

.mkv-warning li {
  margin-bottom: 4px;
}

.conversion-tools {
  margin: 20px 0;
  display: flex;
  justify-content: flex-end;
}

.conversion-button {
  background-color: var(--accent-color);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 10px 20px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  transition: background-color 0.2s;
}

.conversion-button:hover {
  background-color: var(--hover-color);
}

.conversion-button i {
  margin-right: 8px;
}
