/* ============================================================
   VIDEOS PAGE STYLESHEET
   ============================================================ */

.videos-page body { background: var(--bg-dark); }

/* ---- PAGE HEADER ---- */
.page-header {
  min-height: 200px; padding: 140px 20px 60px;
  text-align: center; position: relative;
  background: radial-gradient(ellipse at center, rgba(212,168,67,0.08) 0%, transparent 70%);
  border-bottom: 1px solid var(--border);
}
.page-header h1 {
  font-family: var(--font-head);
  font-size: clamp(2rem, 5vw, 3rem);
  color: var(--accent-gold); margin-bottom: 8px;
}
.page-header p { color: var(--text-muted); font-size: 1.05rem; }

/* ---- ACCESS GATE ---- */
.access-gate { padding: 60px 0; }
.gate-card {
  max-width: 620px; margin: 0 auto;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 50px 40px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.gate-icon { font-size: 3.5rem; text-align: center; margin-bottom: 16px; }
.gate-card h2 {
  font-family: var(--font-head); font-size: 1.8rem;
  color: var(--text-primary); text-align: center; margin-bottom: 10px;
}
.gate-card > p { color: var(--text-muted); text-align: center; margin-bottom: 24px; }

/* Check access area */
.email-check-form { margin-bottom: 24px; }
/* ---- HELPER: Status Msg ---- */
.access-status-msg {
  padding: 12px 15px; border-radius: 8px; font-size: 0.95rem; margin-top: 20px;
  display: flex; align-items: center; gap: 10px; line-height: 1.5;
}
.access-status-msg.hidden { display: none; }
.access-status-msg.error { background: rgba(239, 68, 68, 0.1); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.2); }
.access-status-msg.success { background: rgba(16, 185, 129, 0.1); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.2); }
.access-status-msg.pending { background: rgba(245, 158, 11, 0.1); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.2); }

/* Admin Empty Slot */
.empty-slot {
  border: 2px dashed rgba(255,255,255,0.2);
  background: rgba(13, 21, 48, 0.4);
  display: flex; align-items: center; justify-content: center;
  min-height: 320px; cursor: pointer; transition: var(--transition);
}
.empty-slot:hover { border-color: var(--accent-gold); background: rgba(13, 21, 48, 0.8); }
.empty-slot-content { text-align: center; color: var(--text-muted); }
.empty-slot-content i { font-size: 3rem; margin-bottom: 15px; color: rgba(255,255,255,0.3); transition: var(--transition); }
.empty-slot:hover .empty-slot-content i { color: var(--accent-gold); transform: scale(1.1); }
.empty-slot-content h4 { font-size: 1.1rem; color: var(--text-primary); margin-bottom: 5px; }
.empty-slot-content p { font-size: 0.85rem; }

/* Divider */
.gate-divider {
  display: flex; align-items: center; gap: 16px; margin: 24px 0;
}
.gate-divider::before, .gate-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.gate-divider span { color: var(--text-muted); font-size: 0.85rem; white-space: nowrap; }

/* Request section */
.request-access-section h3 {
  font-family: var(--font-head); font-size: 1.2rem;
  color: var(--text-primary); margin-bottom: 8px; text-align: center;
}
.request-access-section > p { color: var(--text-muted); font-size: 0.9rem; text-align: center; margin-bottom: 20px; }
.btn-outline { background: transparent; border: 2px solid var(--accent-gold); color: var(--accent-gold); }
.btn-outline:hover { background: rgba(212,168,67,0.1); transform: translateY(-2px); }

/* ---- VIDEO LIBRARY ---- */
.video-library { padding: 0 0 80px; }
.library-header { padding: 30px 0; }
.welcome-banner {
  display: flex; align-items: center; gap: 16px;
  background: linear-gradient(135deg, rgba(16,185,129,0.1), rgba(74,159,212,0.08));
  border: 1px solid rgba(16,185,129,0.3);
  border-radius: var(--radius-lg); padding: 20px 28px;
  flex-wrap: wrap;
}
.welcome-banner i { font-size: 2rem; color: #34d399; }
.welcome-banner h3 { font-family: var(--font-head); color: var(--text-primary); margin-bottom: 4px; }
.welcome-banner p { color: var(--text-muted); font-size: 0.9rem; margin: 0; }
.welcome-banner strong { color: var(--accent-gold); }
.btn-logout {
  margin-left: auto; padding: 8px 18px; border-radius: 50px;
  background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3);
  color: #f87171; cursor: pointer; font-family: var(--font-body);
  font-weight: 700; font-size: 0.85rem; transition: var(--transition);
  display: flex; align-items: center; gap: 6px;
}
.btn-logout:hover { background: rgba(239,68,68,0.2); }

/* Course filter tabs */
.course-tabs {
  display: flex; gap: 10px; flex-wrap: wrap; margin: 24px 0;
}
.tab-btn {
  padding: 10px 24px; border-radius: 50px;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-muted); font-family: var(--font-body);
  font-weight: 700; font-size: 0.88rem; cursor: pointer;
  transition: var(--transition);
}
.tab-btn:hover { border-color: var(--accent-gold); color: var(--accent-gold); }
.tab-btn.active {
  background: linear-gradient(135deg, var(--accent-gold), #b8860b);
  color: #1a0e00; border-color: transparent;
}

/* ---- VIDEOS GRID ---- */
.videos-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px;
}
.video-item {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  transition: var(--transition);
  display: flex; flex-direction: column;
}
.video-item:hover { transform: translateY(-6px); box-shadow: 0 16px 40px rgba(0,0,0,0.4); border-color: rgba(212,168,67,0.4); }
.video-item.locked-item { opacity: 0.7; }
.video-item.locked-item:hover { opacity: 1; }

.video-thumbnail {
  position: relative; aspect-ratio: 16/9; background: #0d1530;
  overflow: hidden;
}
.video-thumbnail img { width: 100%; height: 100%; object-fit: cover; transition: var(--transition); }
.locked-thumb img { filter: blur(6px) brightness(0.4); transform: scale(1.1); }
.locked-thumb:hover img { filter: blur(4px) brightness(0.5); }

/* Small WhatsApp button on cards */
.btn-whatsapp-small {
  margin: 0 20px 20px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 12px; border-radius: var(--radius); text-decoration: none;
  background: rgba(37, 211, 102, 0.15); border: 1px solid rgba(37, 211, 102, 0.4);
  color: #25d366; font-weight: 700; font-size: 0.85rem; transition: var(--transition);
}
.btn-whatsapp-small:hover { background: rgba(37, 211, 102, 0.25); transform: translateY(-2px); }
.play-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.3); opacity: 0; transition: var(--transition);
}
.video-item:hover .play-overlay { opacity: 1; }
.play-overlay i { font-size: 3.5rem; color: var(--accent-gold); text-shadow: var(--glow-gold); }
.video-duration {
  position: absolute; bottom: 8px; right: 8px;
  background: rgba(0,0,0,0.8); color: white;
  font-size: 0.75rem; font-weight: 700; padding: 3px 8px; border-radius: 4px;
}

/* Course badge overlay */
.course-badge-overlay {
  position: absolute; top: 12px; right: 12px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(7,11,26,0.85); border: 1px solid var(--border);
  width: 36px; height: 36px; border-radius: 50%;
  color: var(--accent-gold); font-size: 1rem;
  backdrop-filter: blur(4px);
}

.video-info { padding: 18px 20px; flex: 1; }
.video-course-tag {
  display: inline-block; font-size: 0.7rem; font-weight: 700;
  padding: 2px 10px; border-radius: 50px; letter-spacing: 0.08em;
  margin-bottom: 8px; text-transform: uppercase;
}
.video-course-tag.basic { background: rgba(74,159,212,0.15); color: var(--accent-blue); border: 1px solid rgba(74,159,212,0.3); }
.video-course-tag.intermediate { background: rgba(212,168,67,0.15); color: var(--accent-gold); border: 1px solid rgba(212,168,67,0.3); }
.video-course-tag.advanced { background: rgba(124,58,237,0.2); color: #a78bfa; border: 1px solid rgba(124,58,237,0.3); }
.video-course-tag.traditional { background: rgba(16,185,129,0.15); color: #34d399; border: 1px solid rgba(16,185,129,0.3); }

.video-info h4 { font-family: var(--font-head); font-size: 1rem; color: var(--text-primary); margin-bottom: 6px; }
.video-info p { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 8px; }
.video-meta { font-size: 0.78rem; color: rgba(154,163,184,0.6); }
.video-meta i { color: var(--accent-gold); }

.btn-play, .btn-locked {
  margin: 0 20px 20px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px; border-radius: var(--radius); font-family: var(--font-body);
  font-weight: 700; font-size: 0.9rem; cursor: pointer; transition: var(--transition); border: none;
}
.btn-play { background: linear-gradient(135deg, var(--accent-gold), #b8860b); color: #1a0e00; }
.btn-play:hover { box-shadow: var(--glow-gold); transform: translateY(-2px); }
.btn-locked { background: rgba(255,255,255,0.04); border: 1px solid var(--border); color: var(--text-muted); }
.btn-locked:hover { border-color: var(--accent-gold); color: var(--accent-gold); }

/* ---- VIDEO MODAL ---- */
.video-modal, .purchase-modal {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.85); backdrop-filter: blur(4px);
}
.modal-content {
  position: relative; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  width: 100%; max-width: 860px; z-index: 1;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
}
.modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.1); border: 1px solid var(--border);
  color: var(--text-muted); cursor: pointer; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition); z-index: 2;
}
.modal-close:hover { background: rgba(239,68,68,0.2); color: #f87171; }
.video-embed-wrap { aspect-ratio: 16/9; border-radius: var(--radius-lg); overflow: hidden; }
.video-embed-wrap iframe { width: 100%; height: 100%; }

/* Purchase modal */
.purchase-content { max-width: 440px; }
.purchase-info { padding: 40px; text-align: center; }
.purchase-icon { font-size: 3rem; margin-bottom: 16px; }
.purchase-info h3 { font-family: var(--font-head); font-size: 1.5rem; color: var(--text-primary); margin-bottom: 12px; }
.purchase-info > p { color: var(--text-muted); margin-bottom: 24px; }
.purchase-contacts { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.btn-whatsapp {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 24px; border-radius: 50px; text-decoration: none;
  background: #25d366; color: white; font-weight: 700; font-size: 1rem; transition: var(--transition);
}
.btn-whatsapp:hover { background: #20b858; transform: translateY(-2px); }
.btn-phone {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 24px; border-radius: 50px; text-decoration: none;
  background: rgba(74,159,212,0.15); border: 1px solid rgba(74,159,212,0.4);
  color: var(--accent-blue); font-weight: 700; font-size: 1rem; transition: var(--transition);
}
.btn-phone:hover { background: rgba(74,159,212,0.25); transform: translateY(-2px); }
.purchase-note { font-size: 0.82rem; color: var(--text-muted); }

/* ---- FOOTER MINI ---- */
.footer-mini { padding: 24px 0; }

/* ---- AUTH BOX & TABS ---- */
.auth-box {
  background: var(--bg-card); border-radius: var(--radius-lg);
  border: 1px solid var(--border); overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}
.auth-tabs { display: flex; border-bottom: 1px solid var(--border); }
.auth-tab-btn {
  flex: 1; padding: 15px; background: rgba(255,255,255,0.02);
  border: none; color: var(--text-muted); cursor: pointer;
  font-family: var(--font-body); font-weight: 700; transition: var(--transition);
}
.auth-tab-btn.active {
  background: transparent; color: var(--accent-gold);
  border-bottom: 2px solid var(--accent-gold);
}
.auth-form-item { padding: 30px; }

/* ---- STUDENT ADMIN PANEL REDESIGN ---- */
.student-list-card {
    display: flex; justify-content: space-between; align-items: center;
    background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.05);
    padding: 15px 20px; border-radius: var(--radius); cursor: pointer; transition: var(--transition);
}
.student-list-card:hover { background: rgba(255,255,255,0.05); border-color: rgba(212,168,67,0.3); transform: translateX(5px); }
.student-list-info strong { color: var(--text-primary); font-size: 1.1rem; display: block; margin-bottom: 6px; }
.student-list-info span { color: var(--text-muted); font-size: 0.85rem; margin-right: 12px; }
.student-list-action i { color: var(--accent-gold); font-size: 1.2rem; }

/* CSS Toggle Switch Styles */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255,255,255,0.1); transition: .4s; border-radius: 34px; border: 1px solid rgba(255,255,255,0.1);
}
.slider:before {
    position: absolute; content: ""; height: 16px; width: 16px; left: 3px; bottom: 3px;
    background-color: white; transition: .4s; border-radius: 50%; box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}
input:checked + .slider { background-color: #10b981; border-color: #10b981; }
input:focus + .slider { box-shadow: 0 0 1px #10b981; }
input:checked + .slider:before { transform: translateX(20px); }

/* Toggle Grid Item */
.lesson-toggle-item {
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    background: rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.05);
    padding: 15px; border-radius: var(--radius); transition: var(--transition);
}
.lesson-toggle-item:hover { border-color: rgba(212,168,67,0.3); }
.lesson-toggle-item span { font-size: 0.9rem; color: var(--text-muted); font-weight: bold; }
.lesson-toggle-item.active { border-color: rgba(16,185,129,0.3); background: rgba(16,185,129,0.05); }
.lesson-toggle-item.active span { color: #10b981; }

.user-badge {
  font-size: 0.7rem; padding: 3px 8px; border-radius: 4px; font-weight: 700;
  background: rgba(16,185,129,0.15); color: #10b981;
}
.user-badge.blocked { background: rgba(239,68,68,0.15); color: #f87171; }
.session-info-small { font-size: 0.75rem; color: var(--text-muted); display: block; margin-top: 4px; }

/* ---- VIDEO WATERMARK & SECURITY ---- */
.yt-shield { position: absolute; background: transparent; z-index: 10; }
.yt-shield-top { top: 0; left: 0; right: 0; height: 65px; } /* Blocks title bar / share buttons */
.yt-shield-bottom-right { bottom: 0; right: 0; width: 140px; height: 60px; } /* Blocks YouTube logo */
.yt-shield-bottom-left { bottom: 0; left: 0; width: 120px; height: 60px; } /* Blocks Play on Youtube / Watch later */

.video-watermark {
  position: absolute; pointer-events: none; z-index: 100;
  color: rgba(255,255,255,0.4); font-family: monospace;
  font-size: 1.1rem; white-space: nowrap; text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
  animation: moveWatermark 25s linear infinite;
  user-select: none;
}

@keyframes moveWatermark {
  0%   { top: 15%; left: 10%; opacity: 0.3; }
  25%  { top: 15%; left: 60%; opacity: 0.8; }
  50%  { top: 80%; left: 60%; opacity: 0.3; }
  75%  { top: 80%; left: 10%; opacity: 0.8; }
  100% { top: 15%; left: 10%; opacity: 0.3; }
}

/* Modal sizing for wide admin tables */
#adminUserModal .modal-content { background: #070b1a; border-color: rgba(212,168,67,0.3); }

/* Responsive */
@media (max-width: 768px) {
  .gate-card { padding: 36px 24px; }
  .welcome-banner { flex-direction: column; align-items: flex-start; gap: 15px; }
  .btn-logout { margin-left: 0; }
  
  /* Mobile Table */
  .user-table thead { display: none; }
  .user-table tr { display: block; border-bottom: 2px solid var(--border); padding: 15px 0; }
  .user-table td { display: block; padding: 5px 0; text-align: left; }
  .user-table td::before { content: attr(data-label); font-weight: 700; color: var(--accent-gold); display: block; font-size: 0.7rem; text-transform: uppercase; margin-bottom: 2px; }
}
