:root {
  --bg: #121212;
  --bg-elevated: #1e1e1e;
  --bg-hover: #2a2a2a;
  --border: #2f2f2f;
  --text: #e8e8e8;
  --text-muted: #9a9a9a;
  --accent: #e50914;
  --accent-hover: #ff1a25;
  --accent-dim: rgba(229, 9, 20, 0.15);
  --radius: 8px;
  --shadow: 0 4px 20px rgba(0,0,0,0.4);
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
}

button {
  cursor: pointer;
  background: #161616;
  border: 1px solid var(--accent);
  color: var(--text);
  padding: 0.5rem 1.1rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition:
    background 0.22s ease,
    color 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease,
    transform 0.18s ease;
}

button:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 1px var(--accent), 0 4px 16px rgba(229, 9, 20, 0.35);
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
  box-shadow: 0 0 0 1px var(--accent);
}

button.primary {
  background: #161616;
  border: 1px solid var(--accent);
  color: var(--text);
  font-weight: 600;
}

button.primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 1px var(--accent), 0 4px 16px rgba(229, 9, 20, 0.35);
}

button.ghost {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

button.ghost:hover {
  background: var(--bg-hover);
  border-color: transparent;
  color: var(--text);
  box-shadow: none;
  transform: none;
}

button.danger {
  background: #161616;
  border: 1px solid var(--accent);
  color: var(--accent);
}

button.danger:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 1px var(--accent), 0 4px 16px rgba(229, 9, 20, 0.35);
}

/* Layout */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(18,18,18,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: 1rem;
}

.logo {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo span {
  color: var(--accent);
}

.nav {
  display: flex;
  gap: 0.25rem;
}

.nav a {
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-muted);
  transition: color 0.15s, background 0.15s;
}

.nav a:hover,
.nav a.active {
  color: var(--text);
  background: var(--bg-hover);
}

.nav a.active {
  color: var(--accent);
}

.menu-toggle {
  display: none;
  background: transparent;
  border: none;
  padding: 0.4rem;
  color: var(--text);
}

/* Home */
.hero {
  text-align: center;
  padding: 4rem 0 3rem;
}

.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
}

.hero p {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 480px;
  margin: 0 auto;
}

.categories {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  padding-bottom: 4rem;
}

.cat-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem 1.5rem;
  text-align: center;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.cat-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.cat-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: var(--accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.cat-icon svg {
  width: 32px;
  height: 32px;
}

.cat-card h2 {
  font-size: 1.25rem;
  font-weight: 600;
}

.cat-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Page header */
.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.75rem 0 1.25rem;
}

.page-header h1 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

/* Toolbar */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
}

.toolbar select,
.toolbar input[type="search"] {
  padding: 0.45rem 0.75rem;
  min-width: 140px;
}

.view-toggles {
  display: flex;
  gap: 0.25rem;
  margin-left: auto;
}

.view-toggles button {
  padding: 0.4rem 0.55rem;
  border-radius: 6px;
  background: #161616;
  border: 1px solid var(--accent);
  color: var(--text);
  box-shadow: none;
  transform: none;
}

.view-toggles button:hover {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 12px rgba(229, 9, 20, 0.3);
  transform: none;
}

.view-toggles button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Cloud file views */
.file-grid {
  display: grid;
  gap: 1rem;
  padding-bottom: 3rem;
}

.file-grid.view-tiles {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.file-grid.view-large {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.file-grid.view-list {
  grid-template-columns: 1fr;
  gap: 0.4rem;
}

.file-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
}

.file-card:hover {
  border-color: #444;
  background: var(--bg-hover);
}

.file-grid.view-list .file-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.65rem 1rem;
}

.file-preview {
  background: #0d0d0d;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  overflow: hidden;
  cursor: pointer;
}

.file-grid.view-list .file-preview {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  aspect-ratio: auto;
  border-radius: 6px;
}

.file-grid.view-large .file-preview {
  aspect-ratio: 16/10;
}

.file-preview img,
.file-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-preview .file-icon {
  color: var(--text-muted);
  opacity: 0.7;
}

.file-info {
  padding: 0.75rem;
}

.file-grid.view-list .file-info {
  padding: 0;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 1rem;
}

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

.file-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.file-grid.view-list .file-meta {
  margin-top: 0;
  margin-left: auto;
  flex-shrink: 0;
}

.file-actions {
  display: flex;
  gap: 0.25rem;
  padding: 0 0.75rem 0.75rem;
  flex-wrap: wrap;
}

.file-grid.view-list .file-actions {
  padding: 0;
  margin-left: 0.5rem;
}

.file-actions button {
  padding: 0.3rem 0.55rem;
  font-size: 0.8rem;
  border-radius: 6px;
  background: #161616;
  border: 1px solid var(--accent);
  color: var(--text);
  box-shadow: none;
  transform: none;
}

.file-actions button:hover {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 10px rgba(229, 9, 20, 0.3);
  transform: none;
}

.file-actions button.danger {
  color: var(--accent);
}

.file-actions button.danger:hover {
  background: var(--accent);
  color: #fff;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-muted);
}

.empty-state svg {
  width: 64px;
  height: 64px;
  margin-bottom: 1rem;
  opacity: 0.4;
}

/* Videos page - Pornhub style */
.video-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.video-filters button {
  padding: 0.4rem 0.95rem;
  font-size: 0.9rem;
  border-radius: 999px;
  background: #161616;
  border: 1px solid var(--accent);
  color: var(--text);
  box-shadow: none;
  transform: none;
}

.video-filters button:hover {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 12px rgba(229, 9, 20, 0.3);
  transform: none;
}

.video-filters button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  padding-bottom: 3rem;
}

.video-card {
  background: var(--bg-elevated);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: transform 0.2s, border-color 0.2s;
  cursor: pointer;
}

.video-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}

.video-thumb {
  position: relative;
  aspect-ratio: 16/9;
  background: #0d0d0d;
  overflow: hidden;
}

.video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.video-card:hover .video-thumb img {
  transform: scale(1.04);
}

.video-duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0,0,0,0.8);
  color: #fff;
  font-size: 0.75rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-weight: 600;
}

.video-info {
  padding: 0.85rem;
}

.video-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Video watch page */
.watch-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.5rem;
  padding-bottom: 3rem;
}

.player-wrap {
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16/9;
  position: relative;
}

.player-wrap video {
  width: 100%;
  height: 100%;
  display: block;
}

.player-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a1a1a, #0d0d0d);
  color: var(--text-muted);
  font-size: 1.1rem;
}

.watch-info {
  margin-top: 1rem;
}

.watch-info h1 {
  font-size: 1.35rem;
  margin-bottom: 0.5rem;
}

.watch-stats {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.watch-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.watch-actions button {
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.watch-actions button.active-like {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

.related-videos h3 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
  color: var(--text-muted);
}

.related-item {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  cursor: pointer;
  border-radius: 6px;
  padding: 0.25rem;
  transition: background 0.15s;
}

.related-item:hover {
  background: var(--bg-hover);
}

.related-thumb {
  width: 140px;
  aspect-ratio: 16/9;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  background: #0d0d0d;
}

.related-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.related-title {
  font-size: 0.9rem;
  font-weight: 500;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.related-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* Photos */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
  padding-bottom: 3rem;
}

.photo-card {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
}

.photo-card:hover {
  transform: scale(1.02);
  border-color: var(--accent);
  z-index: 2;
}

.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 50%, rgba(0,0,0,0.7));
  opacity: 0;
  transition: opacity 0.2s;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0.75rem;
  gap: 0.4rem;
}

.photo-card:hover .photo-overlay {
  opacity: 1;
}

.photo-overlay button {
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
  background: #161616;
  border: 1px solid var(--accent);
  color: var(--text);
  box-shadow: none;
  transform: none;
}

.photo-overlay button:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 12px rgba(229, 9, 20, 0.35);
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.92);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.lightbox.open {
  display: flex;
}

.lightbox-content {
  max-width: 95vw;
  max-height: 90vh;
  position: relative;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 85vh;
  border-radius: 4px;
  display: block;
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
}

.lightbox-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

/* Notes */
.notes-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.25rem;
  min-height: calc(100vh - 140px);
  padding-bottom: 2rem;
}

.notes-sidebar {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.notes-sidebar-header {
  padding: 0.85rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 0.5rem;
}

.notes-list {
  flex: 1;
  overflow-y: auto;
}

.note-item {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}

.note-item:hover,
.note-item.active {
  background: var(--bg-hover);
}

.note-item.active {
  border-left: 3px solid var(--accent);
}

.note-item-title {
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.note-item-preview {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.note-editor {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.note-editor-header {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.note-editor-header input {
  flex: 1;
  background: transparent;
  border: none;
  font-size: 1.15rem;
  font-weight: 600;
  padding: 0.25rem 0;
}

.note-editor-header input:focus {
  outline: none;
}

.note-editor textarea {
  flex: 1;
  background: transparent;
  border: none;
  padding: 1rem;
  resize: none;
  min-height: 300px;
  line-height: 1.6;
}

.note-editor textarea:focus {
  outline: none;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 150;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 100%;
  max-width: 420px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.modal h2 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

.modal label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.modal input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  margin-bottom: 1rem;
}

.modal-actions {
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
}

/* Upload dropzone */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
  transition: border-color 0.2s, background 0.2s;
  cursor: pointer;
  margin-bottom: 1.5rem;
}

.dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.dropzone strong {
  color: var(--accent);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 300;
  opacity: 0;
  transition: transform 0.3s, opacity 0.3s;
  max-width: 90vw;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast.success {
  border-color: var(--accent);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: auto;
}

/* Responsive */
@media (max-width: 900px) {
  .categories {
    grid-template-columns: repeat(2, 1fr);
  }
  .watch-layout {
    grid-template-columns: 1fr;
  }
  .notes-layout {
    grid-template-columns: 1fr;
  }
  .notes-sidebar {
    max-height: 240px;
  }
}

@media (max-width: 640px) {
  .categories {
    grid-template-columns: 1fr;
  }
  .nav {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 0.5rem;
  }
  .nav.open {
    display: flex;
  }
  .nav a {
    padding: 0.75rem 1rem;
  }
  .menu-toggle {
    display: block;
  }
  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .file-grid.view-tiles {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }
  .video-grid {
    grid-template-columns: 1fr;
  }
  .photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
  .view-toggles {
    margin-left: 0;
  }
}

/* Utility */
.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}
