:root {
  --bg: #eef4ff;
  --bg-2: #dfeafe;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-strong: rgba(255, 255, 255, 0.94);
  --line: rgba(38, 84, 164, 0.14);
  --text: #15315f;
  --muted: #5671a5;
  --brand-1: #33a7e8;
  --brand-2: #365fc7;
  --brand-3: #7ed7ff;
  --shadow: 0 16px 40px rgba(34, 80, 163, 0.12);
  --folder-top: #5cc7f2;
  --folder-body: #dff4ff;
  --folder-line: #7ab2ea;
  --video-ring: rgba(53, 109, 214, 0.12);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(111, 204, 255, 0.22), transparent 30%),
    radial-gradient(circle at bottom right, rgba(86, 124, 229, 0.18), transparent 30%),
    linear-gradient(180deg, var(--bg) 0%, #f8fbff 100%);
  color: var(--text);
}

body {
  position: relative;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

button,
input {
  font: inherit;
}

.is-hidden {
  display: none !important;
}

.bg-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(30px);
  z-index: 0;
  pointer-events: none;
  opacity: 0.6;
}

.orb-1 {
  width: 280px;
  height: 280px;
  top: -60px;
  left: -40px;
  background: rgba(87, 192, 255, 0.35);
}

.orb-2 {
  width: 240px;
  height: 240px;
  right: -60px;
  top: 140px;
  background: rgba(75, 104, 216, 0.24);
}

.orb-3 {
  width: 200px;
  height: 200px;
  left: 40px;
  bottom: 40px;
  background: rgba(110, 212, 255, 0.18);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
  z-index: 1;
}

.login-card {
  width: 100%;
  max-width: 620px;
  background: var(--panel);
  border: 1px solid rgba(255,255,255,0.7);
  backdrop-filter: blur(18px);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 28px 24px 24px;
}

.brand-block {
  text-align: center;
  margin-bottom: 24px;
}

.brand-mark-wrap {
  width: 92px;
  height: 92px;
  margin: 0 auto 14px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(236,245,255,0.88));
  border: 1px solid rgba(72, 132, 215, 0.12);
  display: grid;
  place-items: center;
  box-shadow: 0 10px 30px rgba(53, 109, 214, 0.08);
  padding: 12px;
}

.brand-mark {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-title {
  margin: 0;
  font-size: 2rem;
  line-height: 1.1;
  color: var(--brand-2);
  letter-spacing: 0.03em;
}

.brand-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.message-box {
  margin: 0 0 18px;
  padding: 14px 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(247, 251, 255, 0.96), rgba(231, 243, 255, 0.96));
  border: 1px solid rgba(71, 126, 222, 0.16);
  color: var(--text);
  box-shadow: 0 8px 24px rgba(55, 108, 214, 0.08);
  font-size: 1rem;
  line-height: 1.5;
}

.login-form {
  display: grid;
  gap: 12px;
}

.field-label {
  font-size: 1rem;
  font-weight: bold;
  color: var(--brand-2);
  margin-top: 4px;
}

.text-input,
.search-input {
  width: 100%;
  min-height: 58px;
  border-radius: 18px;
  border: 1px solid rgba(64, 111, 205, 0.14);
  background: rgba(255,255,255,0.94);
  padding: 14px 16px;
  outline: none;
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}

.text-input:focus,
.search-input:focus {
  border-color: rgba(57, 113, 224, 0.35);
  box-shadow:
    0 0 0 4px rgba(61, 131, 233, 0.08),
    inset 0 1px 0 rgba(255,255,255,0.9);
}

.primary-btn,
.ghost-btn,
.video-close-btn {
  cursor: pointer;
  border: 0;
}

.primary-btn {
  min-height: 60px;
  margin-top: 10px;
  border-radius: 18px;
  color: white;
  font-weight: bold;
  font-size: 1.08rem;
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  box-shadow: 0 14px 28px rgba(54, 95, 199, 0.22);
}

.primary-btn:active,
.ghost-btn:active,
.video-close-btn:active {
  transform: scale(0.99);
}

.login-help {
  margin-top: 16px;
  text-align: center;
  color: var(--muted);
  font-size: 0.96rem;
}

.app-shell {
  position: relative;
  z-index: 1;
  padding: 14px 14px 34px;
  max-width: 1240px;
  margin: 0 auto;
}

.topbar {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  background: var(--panel);
  border-radius: 22px;
  padding: 14px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,0.75);
  backdrop-filter: blur(18px);
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  background: rgba(255,255,255,0.85);
  border-radius: 14px;
  padding: 6px;
}

.topbar-title {
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--brand-2);
}

.profile-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 12px;
  margin-top: 4px;
  border-radius: 999px;
  background: rgba(53, 106, 213, 0.09);
  color: var(--brand-2);
  font-weight: bold;
  font-size: 0.92rem;
}

.ghost-btn {
  min-height: 46px;
  padding: 0 16px;
  border-radius: 14px;
  background: rgba(255,255,255,0.92);
  color: var(--brand-2);
  border: 1px solid rgba(62, 114, 212, 0.14);
  box-shadow: 0 6px 20px rgba(57, 106, 202, 0.08);
}

.search-wrap,
.path-wrap,
.section-block {
  margin-top: 14px;
}

.breadcrumb {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: var(--panel-strong);
  border-radius: 18px;
  border: 1px solid rgba(64, 111, 205, 0.12);
  box-shadow: 0 10px 24px rgba(53, 109, 214, 0.06);
  color: var(--muted);
  font-size: 0.95rem;
}

.breadcrumb .crumb {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.section-block {
  padding: 14px;
  border-radius: 22px;
  background: var(--panel);
  border: 1px solid rgba(255,255,255,0.75);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.section-header h2 {
  margin: 0 0 12px;
  font-size: 1.2rem;
  color: var(--brand-2);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.card-grid-horizontal {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 240px));
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.media-card {
  position: relative;
  background: rgba(255,255,255,0.96);
  border: 1px solid rgba(62, 114, 212, 0.12);
  border-radius: 22px;
  padding: 12px;
  min-height: 180px;
  box-shadow: 0 12px 26px rgba(53, 109, 214, 0.07);
  overflow: hidden;
}

.media-card.folder-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.media-card.video-card {
  padding: 0;
}

.card-btn {
  width: 100%;
  height: 100%;
  min-height: 150px;
  border: 0;
  background: transparent;
  text-align: left;
  color: inherit;
  cursor: pointer;
}

.folder-visual {
  position: relative;
  width: 100%;
  height: 82px;
  margin-bottom: 14px;
}

.folder-tab {
  width: 46%;
  height: 24px;
  border-radius: 14px 14px 0 0;
  background: linear-gradient(180deg, var(--folder-top), #89dbfb);
  border: 1px solid rgba(90, 173, 223, 0.2);
  border-bottom: 0;
}

.folder-body {
  width: 100%;
  height: 62px;
  margin-top: -2px;
  border-radius: 0 20px 20px 20px;
  background: linear-gradient(180deg, var(--folder-body), #cfeeff);
  border: 1px solid rgba(115, 180, 233, 0.25);
  box-shadow: inset 0 -8px 14px rgba(255,255,255,0.55);
}

.folder-title,
.video-title {
  font-size: 1rem;
  font-weight: bold;
  line-height: 1.35;
  color: var(--text);
}

.folder-subtitle,
.video-subtitle {
  margin-top: 6px;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.4;
}

.thumb-wrap {
  position: relative;
  aspect-ratio: 16 / 10;
  width: 100%;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(188, 221, 255, 0.55), rgba(219, 239, 255, 0.8));
  border-bottom: 1px solid rgba(62, 114, 212, 0.1);
}

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

.file-icon {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(255,255,255,0.9);
  box-shadow: 0 6px 18px rgba(57, 106, 202, 0.14);
  display: grid;
  place-items: center;
  font-size: 1.2rem;
}

.video-card-body {
  padding: 12px;
}

.watch-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: bold;
  color: #23599f;
  background: rgba(255,255,255,0.92);
  box-shadow: 0 6px 18px rgba(53, 109, 214, 0.12);
}

.progress-bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(88, 120, 193, 0.12);
  overflow: hidden;
  margin-top: 10px;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand-1), var(--brand-2));
}

.empty-state {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255,255,255,0.84);
  color: var(--muted);
  border: 1px dashed rgba(62, 114, 212, 0.2);
}

.video-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
}

.video-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 18, 50, 0.68);
  backdrop-filter: blur(4px);
}

.video-dialog {
  position: relative;
  z-index: 2;
  width: min(94vw, 1080px);
  margin: 18px auto;
  background: rgba(245, 250, 255, 0.98);
  border-radius: 24px;
  box-shadow: 0 30px 70px rgba(0, 20, 70, 0.32);
  padding: 18px;
}

.video-close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  font-size: 2rem;
  line-height: 1;
  background: white;
  color: var(--brand-2);
  box-shadow: 0 10px 24px rgba(0, 20, 70, 0.12);
}

.video-header {
  padding-right: 64px;
}

.video-header h3 {
  margin: 0;
  font-size: 1.2rem;
  color: var(--text);
}

.video-meta {
  margin: 8px 0 0;
  color: var(--muted);
}

.video-player-wrap {
  margin-top: 14px;
  aspect-ratio: 16 / 9;
  border-radius: 18px;
  overflow: hidden;
  background: #091b42;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
}

.video-player {
  width: 100%;
  height: 100%;
  border: 0;
  background: black;
}

.theme-men {
  --bg: #edf5ff;
  --bg-2: #dfeefe;
  --brand-1: #2cb4ec;
  --brand-2: #335fc4;
  --brand-3: #8edcff;
  --folder-top: #59c8ef;
  --folder-body: #dff2ff;
}

.theme-women {
  --bg: #fff1f8;
  --bg-2: #ffe3f0;
  --brand-1: #ff72b6;
  --brand-2: #c64d8b;
  --brand-3: #ffc1de;
  --folder-top: #ff9bc7;
  --folder-body: #ffe4f1;
  --text: #6b2950;
  --muted: #9b5d7b;
}

.theme-boys {
  --bg: #eef9ff;
  --bg-2: #def2ff;
  --brand-1: #43c4ff;
  --brand-2: #3270d8;
  --brand-3: #9fe8ff;
  --folder-top: #75d5ff;
  --folder-body: #e0f7ff;
}

.theme-girls {
  --bg: #fff1fa;
  --bg-2: #ffe5f6;
  --brand-1: #ff8ac8;
  --brand-2: #9c63ff;
  --brand-3: #ffd1ec;
  --folder-top: #ffb3d8;
  --folder-body: #ffe8f4;
  --text: #5d3b7e;
  --muted: #8a6aa9;
}

.theme-boys .media-card,
.theme-girls .media-card {
  border-radius: 26px;
}

.theme-boys .primary-btn,
.theme-girls .primary-btn,
.theme-boys .ghost-btn,
.theme-girls .ghost-btn {
  min-height: 50px;
}

@media (min-width: 720px) {
  .login-card {
    padding: 34px 34px 30px;
  }

  .brand-title {
    font-size: 2.4rem;
  }

  .card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .card-grid-horizontal {
    grid-template-columns: repeat(3, minmax(0, 280px));
  }

  .media-card {
    min-height: 210px;
  }
}

@media (min-width: 1024px) {
  .card-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.library-text {
  background: linear-gradient(90deg, #365FC7, #8A6DFF);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* =========================================================
   LOGIN PAGE REDESIGN
   Runs only on .page-login
========================================================= */

body.page-login {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(1100px 500px at 20% -5%, rgba(42, 167, 255, 0.25), transparent 60%),
    radial-gradient(900px 520px at 90% 10%, rgba(47, 89, 255, 0.24), transparent 55%),
    radial-gradient(900px 700px at 50% 115%, rgba(105, 215, 255, 0.12), transparent 60%),
    linear-gradient(180deg, #050b18, #07142b);
  color: #eaf2ff;
}

.login-bubbles-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  display: block;
  filter: saturate(1.06) contrast(1.03);
}

body.page-login .bg-orb {
  position: fixed;
  border-radius: 999px;
  z-index: 0;
  pointer-events: none;
  opacity: 0.65;
  filter: blur(42px);
}

body.page-login .orb-1 {
  width: 320px;
  height: 320px;
  top: -80px;
  left: -40px;
  background: rgba(42, 167, 255, 0.22);
}

body.page-login .orb-2 {
  width: 280px;
  height: 280px;
  right: -70px;
  top: 90px;
  background: rgba(47, 89, 255, 0.18);
}

body.page-login .orb-3 {
  width: 240px;
  height: 240px;
  left: 10%;
  bottom: -40px;
  background: rgba(105, 215, 255, 0.14);
}

body.page-login .login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
  z-index: 1;
}

body.page-login .login-card {
  position: relative;
  width: 100%;
  max-width: 620px;
  padding: 30px 24px 24px;
  border-radius: 30px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.16), rgba(255,255,255,0.08)),
    linear-gradient(180deg, rgba(11, 28, 58, 0.76), rgba(10, 34, 72, 0.62));
  border: 1px solid rgba(255,255,255,0.14);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow:
    0 18px 60px rgba(0,0,0,0.34),
    inset 0 1px 0 rgba(255,255,255,0.08);
}

body.page-login .login-card-glow {
  position: absolute;
  inset: -1px;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(460px 180px at 18% 0%, rgba(42,167,255,0.18), transparent 60%),
    radial-gradient(420px 180px at 95% 12%, rgba(47,89,255,0.18), transparent 60%),
    radial-gradient(340px 140px at 50% 100%, rgba(105,215,255,0.10), transparent 60%);
}

body.page-login .brand-block,
body.page-login .message-box,
body.page-login .login-form,
body.page-login .login-help {
  position: relative;
  z-index: 1;
}

body.page-login .brand-block {
  text-align: center;
  margin-bottom: 24px;
}

body.page-login .brand-mark-wrap {
  width: 96px;
  height: 96px;
  margin: 0 auto 14px;
  border-radius: 24px;
  padding: 12px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.96), rgba(234,244,255,0.90));
  border: 1px solid rgba(255,255,255,0.25);
  box-shadow:
    0 16px 38px rgba(0,0,0,0.18),
    inset 0 1px 0 rgba(255,255,255,0.65);
}

body.page-login .brand-mark {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

body.page-login .brand-title {
  margin: 0;
  font-size: 2.1rem;
  line-height: 1.08;
  color: #eef5ff;
  letter-spacing: 0.02em;
  text-shadow: 0 4px 18px rgba(0,0,0,0.18);
}

body.page-login .library-text {
  background: linear-gradient(90deg, #69d7ff, #2aa7ff, #2f59ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

body.page-login .brand-subtitle {
  margin: 8px 0 0;
  color: rgba(234,242,255,0.76);
  font-size: 1rem;
}

body.page-login .message-box {
  margin: 0 0 18px;
  padding: 14px 16px;
  border-radius: 18px;
  color: #eef5ff;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0.06));
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: 0 10px 24px rgba(0,0,0,0.12);
}

body.page-login .field-label {
  font-size: 1rem;
  font-weight: bold;
  color: #d8e8ff;
  margin-top: 4px;
}

body.page-login .text-input {
  width: 100%;
  min-height: 58px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.10);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0.06));
  color: #ffffff;
  padding: 14px 16px;
  outline: none;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    0 8px 24px rgba(0,0,0,0.08);
}

body.page-login .text-input::placeholder {
  color: rgba(234,242,255,0.46);
}

body.page-login .text-input:focus {
  border-color: rgba(105, 215, 255, 0.32);
  box-shadow:
    0 0 0 4px rgba(42, 167, 255, 0.10),
    inset 0 1px 0 rgba(255,255,255,0.10);
}

body.page-login .primary-btn {
  min-height: 60px;
  margin-top: 10px;
  border-radius: 18px;
  color: white;
  font-weight: bold;
  font-size: 1.08rem;
  background: linear-gradient(135deg, #2aa7ff, #2f59ff);
  box-shadow:
    0 14px 28px rgba(31, 77, 194, 0.28),
    inset 0 1px 0 rgba(255,255,255,0.20);
}

body.page-login .primary-btn:hover {
  filter: brightness(1.03);
}

body.page-login .login-help {
  margin-top: 16px;
  text-align: center;
  color: rgba(234,242,255,0.68);
  font-size: 0.96rem;
}

@media (min-width: 720px) {
  body.page-login .login-card {
    padding: 36px 34px 30px;
  }

  body.page-login .brand-title {
    font-size: 2.5rem;
  }
}

.folder-thumb-wrap {
  aspect-ratio: 16 / 10;
  border-bottom: 1px solid rgba(62, 114, 212, 0.1);
}

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