/* =========================================================
   ODITJI Dark Modern UI
   기본 컨셉: 다크그레이 / 모던 / OTT 통합검색
   파일 위치 예시: /src/main/resources/static/css/oditji.css
   JSP 연결: <link rel="stylesheet" href="${contextPath}/css/oditji.css">
========================================================= */

:root {
  --bg: #080a0c;
  --bg-soft: #0e1114;
  --panel: #14181c;
  --panel-2: #191e23;
  --panel-3: #20262c;

  --text: #f5f7fa;
  --text-soft: #c7cdd4;
  --text-muted: #89919c;

  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);

  --white: #ffffff;
  --black: #000000;

  --accent: #ffffff;
  --danger: #ff3b4f;
  --star: #ffbf3c;

  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;

  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  --shadow-soft: 0 12px 40px rgba(0, 0, 0, 0.25);

  --max-width: 1180px;
}

/* ===== Reset ===== */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 0%, rgba(255,255,255,0.08), transparent 28%),
    radial-gradient(circle at 85% 8%, rgba(255,255,255,0.05), transparent 24%),
    linear-gradient(180deg, #07090b 0%, #0c0f12 48%, #080a0c 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Pretendard",
               "Noto Sans KR", "Apple SD Gothic Neo", Arial, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

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

ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* ===== Layout ===== */
.odi-page {
  width: min(var(--max-width), calc(100% - 40px));
  margin: 0 auto;
}

.odi-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(8, 10, 12, 0.78);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}

.odi-nav {
  width: min(var(--max-width), calc(100% - 40px));
  height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.odi-logo {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.odi-menu {
  display: flex;
  align-items: center;
  gap: 28px;
  color: var(--text-soft);
  font-size: 14px;
}

.odi-menu a {
  transition: color 0.2s ease;
}

.odi-menu a:hover {
  color: var(--white);
}

.odi-nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text);
  background: rgba(255,255,255,0.04);
  cursor: pointer;
}

.icon-btn:hover {
  background: rgba(255,255,255,0.08);
}

/* ===== Hero ===== */
.hero {
  position: relative;
  overflow: hidden;
  margin-top: 28px;
  min-height: 520px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(90deg, rgba(8,10,12,0.96) 0%, rgba(8,10,12,0.82) 42%, rgba(8,10,12,0.55) 100%),
    url("https://image.tmdb.org/t/p/w1280/5YZbUmjbMa3ClvSW1Wj3D6XGolb.jpg") center/cover no-repeat;
  box-shadow: var(--shadow);
}

.hero-inner {
  position: relative;
  z-index: 2;
  width: min(620px, calc(100% - 48px));
  padding: 72px 0 56px 56px;
}

.hero-kicker {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 18px;
}

.hero-title {
  margin: 0;
  font-size: clamp(38px, 5vw, 68px);
  line-height: 1.05;
  letter-spacing: -0.07em;
}

.hero-desc {
  margin: 22px 0 28px;
  color: var(--text-soft);
  line-height: 1.7;
  font-size: 15px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(560px, 100%);
  padding: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(16, 20, 24, 0.72);
  backdrop-filter: blur(12px);
}

.search-box input {
  flex: 1;
  min-width: 0;
  height: 46px;
  border: 0;
  outline: none;
  color: var(--text);
  background: transparent;
  padding: 0 16px;
  font-size: 15px;
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.search-btn {
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  color: var(--black);
  background: var(--white);
  font-weight: 800;
  cursor: pointer;
}

.search-btn.dark {
  color: var(--white);
  background: var(--black);
  border: 1px solid var(--line-strong);
}

.ott-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.ott-badge {
  min-width: 124px;
  height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.045);
  color: var(--white);
  font-weight: 900;
  letter-spacing: -0.04em;
  box-shadow: var(--shadow-soft);
}

.ott-netflix { color: #ff3040; }
.ott-disney { color: #dbe8ff; }
.ott-tving { color: #ff3158; }
.ott-wavve { color: #4c78ff; }
.ott-watcha { color: #ff4f9a; }

/* ===== Section ===== */
.section {
  margin-top: 48px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.section-title {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.04em;
}

.section-sub {
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 14px;
}

.more-link {
  color: var(--text-muted);
  font-size: 14px;
}

.more-link:hover {
  color: var(--white);
}

/* ===== Cards ===== */
.poster-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 18px;
}

.poster-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.poster-card:hover {
  transform: translateY(-6px);
  border-color: var(--line-strong);
  background: var(--panel-2);
}

.poster-img {
  aspect-ratio: 2 / 3;
  width: 100%;
  object-fit: cover;
  background: var(--panel-3);
}

.poster-info {
  padding: 12px 12px 14px;
}

.poster-title {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.poster-meta {
  color: var(--text-muted);
  font-size: 12px;
}

/* ===== Feature ===== */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.feature-card {
  min-height: 170px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.025));
}

.feature-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 22px;
}

.feature-title {
  margin: 0 0 8px;
  font-size: 17px;
}

.feature-desc {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.6;
  font-size: 13px;
}

/* ===== Search Results ===== */
.sub-hero {
  margin-top: 28px;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--panel);
}

.content-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 24px;
  margin-top: 24px;
}

.filter-panel,
.result-panel,
.detail-panel,
.mypage-panel,
.admin-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: rgba(20, 24, 28, 0.78);
  box-shadow: var(--shadow-soft);
}

.filter-panel {
  padding: 22px;
  height: fit-content;
  position: sticky;
  top: 98px;
}

.filter-title {
  margin: 0 0 14px;
  font-size: 15px;
}

.filter-group + .filter-group {
  margin-top: 24px;
}

.check-list {
  display: grid;
  gap: 10px;
  color: var(--text-soft);
  font-size: 14px;
}

.check-list label {
  display: flex;
  align-items: center;
  gap: 9px;
}

.result-panel {
  padding: 22px;
}

.result-list {
  display: grid;
  gap: 14px;
}

.result-card {
  display: grid;
  grid-template-columns: 98px 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.035);
}

.result-thumb {
  width: 98px;
  height: 140px;
  object-fit: cover;
  border-radius: var(--radius-md);
  background: var(--panel-3);
}

.result-title {
  margin: 0 0 8px;
  font-size: 20px;
  letter-spacing: -0.04em;
}

.result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--text-muted);
  font-size: 13px;
}

.platform-mini {
  display: flex;
  gap: 7px;
  margin-top: 13px;
}

.platform-chip {
  min-width: 30px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  padding: 0 8px;
  border-radius: 8px;
  background: #ffffff;
  color: #000000;
  font-size: 12px;
  font-weight: 900;
}

.arrow-link {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text-soft);
}

/* ===== Detail ===== */
.detail-panel {
  padding: 34px;
}

.detail-wrap {
  display: grid;
  grid-template-columns: 310px 1fr;
  gap: 36px;
}

.detail-poster {
  width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.detail-title {
  margin: 0;
  font-size: 38px;
  letter-spacing: -0.06em;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 16px 0;
  color: var(--text-muted);
  font-size: 14px;
}

.rating {
  color: var(--star);
  font-weight: 800;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0;
}

.tag {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-soft);
  background: rgba(255,255,255,0.04);
  font-size: 13px;
}

.detail-overview {
  color: var(--text-soft);
  line-height: 1.8;
}

.watch-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 22px;
}

.watch-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.045);
}

.watch-card strong {
  display: block;
  font-size: 24px;
  margin-bottom: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--white);
  background: rgba(255,255,255,0.06);
  cursor: pointer;
}

.btn:hover {
  background: rgba(255,255,255,0.1);
}

.btn-primary {
  color: var(--black);
  background: var(--white);
  border-color: var(--white);
  font-weight: 800;
}

.btn-primary:hover {
  background: #e7e9ec;
}

/* ===== My Page ===== */
.mypage-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 24px;
  margin-top: 28px;
}

.mypage-panel {
  padding: 24px;
}

.profile-box {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 22px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.avatar {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--white);
  color: var(--black);
  font-weight: 900;
}

.side-menu {
  display: grid;
  gap: 8px;
}

.side-menu a {
  padding: 13px 14px;
  border-radius: var(--radius-md);
  color: var(--text-soft);
}

.side-menu a.active,
.side-menu a:hover {
  color: var(--white);
  background: rgba(255,255,255,0.07);
}

.list-card {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.035);
}

.list-card + .list-card {
  margin-top: 14px;
}

.list-thumb {
  width: 120px;
  height: 78px;
  border-radius: var(--radius-md);
  object-fit: cover;
}

/* ===== Admin ===== */
.admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  margin-top: 28px;
}

.admin-panel {
  padding: 24px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}

.stat-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.04);
}

.stat-label {
  color: var(--text-muted);
  font-size: 13px;
}

.stat-value {
  margin-top: 8px;
  font-size: 30px;
  font-weight: 900;
}

.table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.table th,
.table td {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 14px;
}

.table th {
  color: var(--text-muted);
  font-weight: 600;
  background: rgba(255,255,255,0.035);
}

/* ===== Footer ===== */
.odi-footer {
  margin-top: 72px;
  padding: 38px 0;
  border-top: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 13px;
}

/* ===== Responsive ===== */
@media (max-width: 980px) {
  .odi-menu {
    display: none;
  }

  .hero-inner {
    padding-left: 28px;
  }

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

  .feature-grid,
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .content-layout,
  .detail-wrap,
  .mypage-layout,
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .filter-panel {
    position: static;
  }

  .admin-panel {
    overflow-x: auto;
  }

  .table {
    min-width: 640px;
  }
}

@media (max-width: 640px) {
  .odi-page,
  .odi-nav {
    width: min(100% - 24px, var(--max-width));
  }

  .hero {
    min-height: auto;
  }

  .hero-inner {
    width: 100%;
    padding: 48px 22px;
  }

  .hero-title {
    font-size: 38px;
  }

  .ott-badge {
    min-width: calc(50% - 6px);
  }

  .poster-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .result-card,
  .list-card {
    grid-template-columns: 82px 1fr;
  }

  .result-thumb {
    width: 82px;
    height: 118px;
  }

  .arrow-link,
  .list-card .icon-btn {
    display: none;
  }

  .watch-grid {
    grid-template-columns: 1fr;
  }

  .detail-title {
    font-size: 28px;
  }

  .detail-panel {
    padding: 22px;
  }
}

@media (max-width: 480px) {
  .stat-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
}

/* =========================================================
   인기 랭킹 (contentRanking.jsp)
========================================================= */
.ranking-page {
    width: min(1400px, calc(100% - 40px));
    margin: 0 auto;
    padding: 60px 0 100px;
}

.ranking-header {
    margin-bottom: 36px;
}

.ranking-header h1 {
    margin: 0 0 12px;
    font-size: 38px;
    line-height: 1.25;
}

.ranking-header p {
    margin: 0;
    color: #888;
    font-size: 15px;
    line-height: 1.7;
}

.ranking-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 36px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.ranking-tab-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 105px;
    padding: 12px 20px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.045);
    color: var(--text-soft);
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease;
}

.ranking-tab-logo {
    display: block;
    width: 20px;
    height: 20px;
    border-radius: 5px;
    object-fit: cover;
    background: #fff;
    flex-shrink: 0;
}

.ranking-tab-button:hover {
    border-color: var(--line-strong);
    background: rgba(255, 255, 255, 0.08);
    color: var(--white);
}

.ranking-tab-button.active {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.16);
    color: #ffffff;
}

.ranking-panel {
    display: none;
}

.ranking-panel.active {
    display: block;
}

.ranking-panel-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.ranking-panel-title {
    margin: 0;
    font-size: 28px;
}

.ranking-panel-description {
    margin: 8px 0 0;
    color: #888;
    font-size: 14px;
}

.ranking-list {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 28px 18px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ranking-card {
    position: relative;
    min-width: 0;
}

.ranking-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.ranking-poster-wrap {
    position: relative;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 2 / 3;
    border-radius: 12px;
    background: #ececec;
}

.ranking-poster {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.25s ease;
}

.ranking-link:hover .ranking-poster {
    transform: scale(1.04);
}

.ranking-no-poster {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 20px;
    box-sizing: border-box;
    color: #999;
    font-size: 13px;
    text-align: center;
}

.ranking-number {
    position: absolute;
    left: 10px;
    bottom: 8px;
    z-index: 2;
    font-size: 52px;
    font-weight: 900;
    line-height: 1;
    color: #fff;
    text-shadow:
        -2px -2px 0 #111,
        2px -2px 0 #111,
        -2px 2px 0 #111,
        2px 2px 0 #111,
        0 4px 12px rgba(0, 0, 0, 0.65);
}

.ranking-number.top-rank {
    color: #ffe35c;
}

.ranking-info {
    padding: 14px 4px 0;
}

.ranking-content-title {
    overflow: hidden;
    margin: 0 0 9px;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ranking-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    color: #777;
    font-size: 13px;
}

.ranking-type {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #f0f0f0;
    color: #444;
    font-size: 11px;
    font-weight: 800;
}

.ranking-score {
    color: #555;
    font-weight: 700;
}

.ranking-empty {
    padding: 80px 20px;
    border: 1px solid #e5e5e5;
    border-radius: 16px;
    color: #888;
    text-align: center;
}

@media (max-width: 1100px) {
    .ranking-list {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .ranking-page {
        width: min(100% - 28px, 1400px);
        padding-top: 40px;
    }

    .ranking-header h1 {
        font-size: 30px;
    }

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

    .ranking-number {
        font-size: 44px;
    }
}

@media (max-width: 560px) {
    .ranking-tabs {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        padding-bottom: 14px;
    }

    .ranking-tab-button {
        width: 100%;
        min-width: 0;
        padding: 8px 10px;
        font-size: 12px;
        gap: 6px;
    }

    .ranking-tab-logo {
        width: 16px;
        height: 16px;
    }

    .ranking-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 18px 10px;
    }

    .ranking-panel-title {
        font-size: 23px;
    }

    .ranking-number {
        font-size: 30px;
        left: 7px;
        bottom: 6px;
    }

    .ranking-content-title {
        font-size: 13px;
        margin: 0 0 5px;
    }

    .ranking-meta {
        font-size: 11px;
    }

    .ranking-info {
        padding: 10px 3px 0;
    }
}
