/* ============================================================
   BASE LOCAL DE TUTORIAIS — style.css
   Tema: VIMEO LIGHT / SHADCN Edition
   Aesthetic: Clean, Minimal, High-Contrast
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  /* ── LIGHT PALETTE (SHADCN INSPIRED) ── */
  --bg:            #f8fafc;
  --surface:       #ffffff;
  --surface-muted: #f1f5f9;
  
  --primary:       #00adef; /* Vimeo Blue */
  --primary-hover: #0096d1;
  --primary-foreground: #ffffff;
  
  --secondary:      #f1f5f9;
  --secondary-hover: #e2e8f0;
  
  --accent:         #f8fafc;
  --accent-foreground: #0f172a;
  
  --text:           #0f172a;
  --text-muted:     #64748b;
  --text-dim:       #94a3b8;
  
  --border:         #e2e8f0;
  --border-focus:   #00adef;
  
  --danger:         #ef4444;
  --success:        #22c55e;
  
  /* ── DIMENSÕES ── */
  --sidebar-w:     260px;
  --topbar-h:      70px;
  --radius:        12px;
  --radius-sm:     8px;
  --radius-lg:     16px;
  --radius-pill:   999px;
  
  /* ── EFFECTS ── */
  --shadow-sm:     0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow:        0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --shadow-md:     0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --transition:    all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme='dark'] {
  --bg:            #020817;
  --surface:       #020817;
  --surface-muted: #1e293b;
  --border:        #1e293b;
  --text:          #f8fafc;
  --text-muted:    #94a3b8;
  --secondary:     #1e293b;
  --secondary-hover: #334155;
}

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

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* ── LAYOUT BASE ───────────────────────────────────────────── */
.app-wrapper {
  display: flex;
  height: 100vh;
  width: 100vw;
}

/* ── SIDEBAR (VIMEO STYLE) ─────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg); /* Same as BG in reference */
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  gap: 32px;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
.sidebar:hover::-webkit-scrollbar-thumb { background: var(--text-dim); }

.sidebar-header {
  padding: 0 12px;
  margin-bottom: 24px;
}
.logo {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; transition: var(--transition);
}
.logo img {
  max-width: 100%;
  height: auto;
  display: block;
}
.logo:hover { opacity: 0.8; }

.nav-section { display: flex; flex-direction: column; gap: 4px; }
.nav-section-title { 
  padding: 0 12px 8px; font-size: 12px; font-weight: 600; 
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; 
}

.nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--text-muted); font-size: 14px; font-weight: 500;
  text-decoration: none; transition: var(--transition);
}
.nav-link i { font-size: 16px; width: 20px; }

.nav-link:hover { background: var(--secondary); color: var(--text); }

.nav-link.active {
  background: var(--secondary-hover);
  color: var(--text);
  font-weight: 600;
}

/* ── MAIN LAYOUT ───────────────────────────────────────────── */
.main-layout {
  flex: 1; display: flex; flex-direction: column;
  min-width: 0; background: var(--surface); /* Contrast with sidebar BG */
  overflow-y: auto;
}

/* ── TOP BAR (CLEAN SEARCH) ────────────────────────────────── */
.top-bar {
  height: var(--topbar-h);
  padding: 0 40px;
  display: flex; align-items: center;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 90;
}

.search-wrapper { position: relative; width: 100%; max-width: 800px; }
.search-input {
  width: 100%; padding: 12px 20px 12px 48px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-size: 14px;
  transition: var(--transition);
}
.search-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text-dim); }
.search-input:focus { 
  outline: none; border-color: var(--primary); 
  box-shadow: 0 0 0 2px rgba(0, 173, 239, 0.1); 
}

/* ── CONTENT BODY ──────────────────────────────────────────── */
.content-body { padding: 40px; }

/* ── VIMEO CARDS ────────────────────────────────────────────── */
.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.card {
  display: flex; flex-direction: column; gap: 12px;
  cursor: pointer; transition: var(--transition);
}
.card:hover { opacity: 0.9; }

.card-thumb {
  position: relative; width: 100%; aspect-ratio: 16/9;
  border-radius: var(--radius); overflow: hidden;
  background: var(--surface-muted);
}
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }

.card-duration {
  position: absolute; bottom: 8px; right: 8px;
  background: rgba(0, 0, 0, 0.8); color: white;
  padding: 2px 6px; border-radius: 4px; font-size: 11px; font-weight: 600;
}

.card-info { display: flex; flex-direction: column; gap: 4px; }
.card-title {
  font-size: 14px; font-weight: 600; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  line-height: 1.3;
}
.card-meta { font-size: 12px; color: var(--text-muted); }

/* ── MODALS (SHADCN STYLE) ─────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px); z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transition: var(--transition);
}
.modal-overlay.active { opacity: 1; visibility: visible; }

.modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px; width: 100%; max-width: 400px;
  box-shadow: var(--shadow-md);
  transform: scale(0.95); transition: var(--transition);
}
.modal-overlay.active .modal { transform: scale(1); }

.modal h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.modal p { color: var(--text-muted); font-size: 14px; margin-bottom: 24px; }

.modal-actions { display: flex; gap: 12px; justify-content: flex-end; }

/* ── BUTTONS (SHADCN STYLE) ── */
.btn {
  padding: 8px 16px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 14px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: var(--transition); border: 1px solid transparent;
}
.btn-primary { background: var(--primary); color: var(--primary-foreground); }
.btn-primary:hover { background: var(--primary-hover); }

.btn-secondary { background: var(--secondary); color: var(--text); }
.btn-secondary:hover { background: var(--secondary-hover); }

.btn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { background: var(--secondary); }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { opacity: 0.9; }

/* ── FORM ELEMENTS ── */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; text-transform: uppercase; }
.form-input {
  width: 100%; padding: 10px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-size: 14px; transition: var(--transition);
}
.form-input:focus { outline: none; border-color: var(--primary); }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 100px; }

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  :root { --sidebar-w: 220px; }
  .content-body { padding: 32px; }
}

/* ── HAMBURGER BUTTON ── */
.hamburger-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--border);
  cursor: pointer;
  color: var(--text-muted);
  font-size: 16px;
  transition: var(--transition);
  flex-shrink: 0;
}
.hamburger-btn:hover { background: var(--secondary); color: var(--text); }

/* ── SIDEBAR OVERLAY (MOBILE) ── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 199;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.active { display: block; }

/* ── TABLET (768px – 1024px) ── */
@media (max-width: 1024px) and (min-width: 769px) {
  :root { --sidebar-w: 200px; }
  .content-body { padding: 28px; }
  .cms-container { grid-template-columns: 1fr 300px !important; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}

/* ── MOBILE (≤768px) ── */
@media (max-width: 768px) {
  :root { --topbar-h: 60px; }

  /* Sidebar slides in as overlay */
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 200;
    height: 100vh;
    width: 280px !important;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-md);
  }
  .sidebar.open { transform: translateX(0); }

  /* Hamburger button visible */
  .hamburger-btn { display: flex; }

  /* Top bar adjustments */
  .top-bar { padding: 0 16px; gap: 12px; }
  .search-wrapper { max-width: none; }

  /* Content */
  .content-body { padding: 20px 16px; }

  /* Grid: 1 column on mobile */
  .grid { grid-template-columns: 1fr; }

  /* CMS form: single column */
  .cms-container { grid-template-columns: 1fr !important; }
  .preview-section { display: none !important; } /* Hide preview on mobile to save space */

  /* 2-col grids inside forms: stack */
  [style*="grid-template-columns:1fr 1fr"],
  [style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Category form grid */
  [style*="grid-template-columns:1fr 120px auto"],
  [style*="grid-template-columns: 1fr 120px auto"] {
    grid-template-columns: 1fr !important;
  }

  /* Stats grid on gerenciar */
  [style*="grid-template-columns:1fr 1fr"][id="data-stats"] {
    grid-template-columns: 1fr !important;
  }

  /* Modals full-width on mobile */
  .modal { max-width: 90vw; padding: 20px; }

  /* Tutorial player grid */
  .tutorial-grid { grid-template-columns: 1fr; gap: 24px; }
  .tutorial-sidebar { order: -1; } /* Actions on top for mobile */
}

/* ── SMALL MOBILE (≤480px) ── */
@media (max-width: 480px) {
  .content-body { padding: 16px 12px; }
  .grid { grid-template-columns: 1fr; gap: 16px; }
  .top-bar { padding: 0 12px; }
}

