/* =========================
   Root Variables
========================= */
:root {
  --accent: #0D9488;
  --muted: #64748B;
  --bg-start: #ffffff;
  --bg-end: #f0fdfa;
  --radius: 20px;
}

/* =========================
   Global Reset
========================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  transition: all 0.3s ease;
}

body {
  font-family: "Inter", system-ui, Arial, sans-serif;
  background: linear-gradient(180deg, var(--bg-start) 0%, var(--bg-end) 100%);
  color: #0F172A;
  min-height: 100vh;
  overflow-x: hidden;
  padding: 20px;
}

/* =========================
   Header
========================= */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 20px;
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(12px);
  padding: 12px 24px;
  border-radius: var(--radius);
  box-shadow: 0 4px 25px rgba(0,0,0,0.06);
}

.logo {
  font-weight: 700;
  font-size: 24px;
  background: linear-gradient(90deg, #0D9488, #14B8A6, #0D9488);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 200%;
  animation: shimmer 6s linear infinite;
}

@keyframes shimmer {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

/* =========================
   Tabs
========================= */
.tabs {
  display: flex;
  gap: 10px;
  background: rgba(255,255,255,0.6);
  padding: 6px 12px;
  border-radius: 50px;
  box-shadow: 0 4px 16px rgba(13,148,136,0.12);
  flex-wrap: wrap;
}

.tab {
  padding: 10px 18px;
  border-radius: 50px;
  font-weight: 500;
  cursor: pointer;
  color: var(--muted);
}

.tab:hover {
  transform: translateY(-2px);
  color: var(--accent);
}

.tab.active {
  background: white;
  color: var(--accent);
  border: 1px solid rgba(13,148,136,0.3);
  box-shadow: 0 2px 8px rgba(13,148,136,0.25);
}

/* =========================
   Layout
========================= */
.container {
  max-width: 1000px;
  margin: 0 auto;
  padding-top: 30px;
}

.card {
  background: rgba(255,255,255,0.8);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.05);
  border: 1px solid rgba(255,255,255,0.4);
  backdrop-filter: blur(8px);
  margin-bottom: 30px;
  animation: fadeUp 0.6s ease forwards;
}

/* =========================
   Animations
========================= */
@keyframes fadeUp {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* =========================
   Buttons
========================= */
.btn {
  background: var(--accent);
  color: white;
  padding: 8px 14px;
  border: none;
  border-radius: 30px;
  font-weight: 500;
  cursor: pointer;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(13,148,136,0.3);
}

.btn.ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid #99f6e4;
}

.btn.ghost:hover {
  background: rgba(13,148,136,0.08);
}

/* =========================
   Notes Section
========================= */
.note-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(255,255,255,0.9);
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  margin-bottom: 12px;
}

.note-info strong {
  color: var(--accent);
  font-weight: 600;
}

.note-actions {
  display: flex;
  gap: 8px;
}

/* =========================
   Filter Bar
========================= */
.filter-bar {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0;
}

.filter-btn {
  padding: 8px 18px;
  border-radius: 30px;
  border: 1px solid #d1fae5;
  background: white;
  color: var(--muted);
  cursor: pointer;
  font-weight: 500;
}

.filter-btn:hover {
  background: rgba(13,148,136,0.08);
  color: var(--accent);
}

.filter-btn.active {
  background: white;
  color: var(--accent);
  border: 2px solid var(--accent);
  box-shadow: 0 0 10px rgba(13,148,136,0.3);
  animation: pulseGlow 3s infinite;
}

@keyframes pulseGlow {
  0%,100% { box-shadow: 0 0 10px rgba(13,148,136,0.2); }
  50% { box-shadow: 0 0 20px rgba(13,148,136,0.4); }
}

/* =========================
   Modal
========================= */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.modal {
  background: white;
  border-radius: var(--radius);
  padding: 24px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.15);
  text-align: center;
  animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* =========================
   Fields
========================= */
.field {
  margin-bottom: 14px;
  text-align: left;
}

.field label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
  color: var(--accent);
}

.field input[type="text"],
.field input[type="file"] {
  width: 100%;
  padding: 10px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font-size: 15px;
  outline: none;
}

.field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 5px rgba(13,148,136,0.3);
}

/* =========================
   File Upload Styling
========================= */
.upload-field input[type="file"] {
  cursor: pointer;
  background: #ecfdf5;
  border: 1px dashed #0d9488;
}

.upload-field input[type="file"]:hover {
  background: rgba(13,148,136,0.05);
}

/* =========================
   Success Toast
========================= */
.success-toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--accent);
  color: white;
  padding: 10px 16px;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(13,148,136,0.4);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  z-index: 9999;
}

.success-toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* =========================
   Video Grid
========================= */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(45%, 1fr));
  gap: 20px;
  justify-content: center;
  width: 90%;
  margin: 0 auto;
}

.video-card {
  background: rgba(255,255,255,0.8);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transform: scale(0.97);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.video-card:hover {
  transform: scale(1.01);
  box-shadow: 0 8px 20px rgba(13,148,136,0.15);
}

.video-label {
  padding: 8px 12px;
  font-weight: 600;
  color: var(--accent);
  background: rgba(13,148,136,0.05);
}

/* =========================
   Responsive
========================= */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    align-items: flex-start;
  }

  .tabs {
    justify-content: center;
    flex-wrap: wrap;
  }

  .card {
    padding: 18px;
  }

  .note-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .grid {
    grid-template-columns: 1fr;
    width: 100%;
  }
}
