/* Modern Reset & Base Styles */
:root {
  --bg-color: #050505;
  --card-bg: rgba(255, 255, 255, 0.03);
  --text-main: #ffffff;
  --text-muted: #a0a0a0;
  --accent: #3b82f6;
  /* Modern Blue */
  --accent-hover: #2563eb;
  --danger: #ef4444;
  --font-main: 'Inter', system-ui, -apple-system, sans-serif;
  --glass-border: 1px solid rgba(255, 255, 255, 0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-color);
  color: var(--text-main);
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

#particles-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  opacity: 0.6;
}

/* Header */
header {
  background: rgba(5, 5, 5, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: var(--glass-border);
  padding: 1.5rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo h1 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -1px;
  background: linear-gradient(to right, #fff, #aaa);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: -2px;
}

.admin-link {
  background: var(--card-bg);
  border: var(--glass-border);
  color: var(--text-main);
  padding: 0.6rem 1.2rem;
  border-radius: 99px;
  /* Pill shape */
  font-size: 0.875rem;
  text-decoration: none;
  transition: all 0.2s ease;
  font-weight: 500;
}

.admin-link:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Bildirim izni banner (mobilde tıklanınca izin sorar) */
.notification-banner {
  position: sticky;
  top: 0;
  z-index: 99;
  background: rgba(59, 130, 246, 0.15);
  border-bottom: 1px solid rgba(59, 130, 246, 0.3);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.notification-banner p {
  flex: 1;
  min-width: 0;
  font-size: 0.875rem;
  color: var(--text-main);
  margin: 0;
}
.notification-allow-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.notification-allow-btn:active {
  background: var(--accent-hover);
}
.notification-dismiss {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem;
}

/* Main Layout */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

/* Grid */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  padding-bottom: 4rem;
}

/* Video Card */
.video-card {
  background: var(--card-bg);
  border: var(--glass-border);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
}

.video-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  /* Slightly lighter on hover */
}

.thumbnail-container {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: #000;
}

.thumbnail-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0.9;
}

.video-card:hover .thumbnail-container img {
  transform: scale(1.08);
  opacity: 1;
}

.play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.video-card:hover .play-overlay {
  opacity: 1;
}

.play-button {
  width: 64px;
  height: 64px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.4);
  transform: scale(0.8);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.video-card:hover .play-button {
  transform: scale(1);
  background: var(--accent);
  border-color: var(--accent);
}

.play-button svg {
  width: 28px;
  height: 28px;
  fill: #fff;
  margin-left: 4px;
  /* Optical centering */
}

.card-content {
  padding: 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #f1f5f9;
}

.card-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(5px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal.active {
  opacity: 1;
  display: flex;
  /* Override via JS logic mostly, but good fallback */
}

.modal-content {
  width: 90%;
  max-width: 1200px;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
  position: relative;
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal.active .modal-content {
  transform: scale(1);
}

.close-modal {
  position: absolute;
  top: -60px;
  right: 0;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.5rem;
  cursor: pointer;
  padding: 0.5rem;
  transition: all 0.2s;
  line-height: 1;
}

.close-modal:hover {
  color: var(--accent);
  transform: rotate(90deg);
}

/* Login Page Styles */
.login-wrapper {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.login-card {
  background: #111;
  border: var(--glass-border);
  padding: 3rem;
  border-radius: 24px;
  width: 100%;
  max-width: 420px;
  text-align: center;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  background: linear-gradient(145deg, rgba(20, 20, 20, 0.8), rgba(10, 10, 10, 0.95));
}

.login-card h2 {
  margin-bottom: 2rem;
  font-size: 1.75rem;
  font-weight: 700;
}

.form-group {
  margin-bottom: 1.5rem;
  text-align: left;
}

.form-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 1rem 1.25rem;
  border-radius: 12px;
  font-size: 1rem;
  transition: all 0.2s;
  font-family: inherit;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  width: 100%;
  padding: 1rem;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -5px rgba(59, 130, 246, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.alert {
  padding: 1rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  font-weight: 500;
  display: flex;
  align-items: center;
}

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-success {
  background: rgba(34, 197, 94, 0.1);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

/* Admin Dashboard */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 1.5rem;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.2);
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  font-weight: 500;
  font-family: inherit;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.3);
}

.add-video-section {
  background: var(--card-bg);
  border: var(--glass-border);
  padding: 2.5rem;
  border-radius: 24px;
  margin-bottom: 3rem;
}

.admin-refresh-btn {
  margin-left: 0.75rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-muted);
  border-radius: 6px;
  cursor: pointer;
}
.admin-refresh-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-main);
}

.video-list-item {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.03);
  transition: background 0.2s;
}

.video-list-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.video-list-item img {
  height: 70px;
  width: 120px;
  object-fit: cover;
  border-radius: 10px;
  margin-right: 1.5rem;
}

.video-list-info {
  flex: 1;
}

.video-list-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: #fff;
  font-size: 1.1rem;
}

.admin-nav-link {
  color: var(--text-muted);
  text-decoration: none;
  margin-right: 2rem;
  transition: color 0.2s;
  font-weight: 500;
}

.admin-nav-link:hover {
  color: white;
}