/* ==========================================================================
   Design System Variables & Base Resets
   ========================================================================== */
:root {
  --primary-color: #ff4b4b; /* Blind signature coral red */
  --primary-hover: #e03b3b;
  --secondary-color: #12b886; /* Fresh nutrition green */
  --secondary-hover: #0ca678;
  --bg-page: #f8f9fa; /* Sleek warm gray background */
  --bg-card: #ffffff;
  --border-color: #ececec; /* Subtle gray borders */
  --text-main: #222222;
  --text-sub: #495057;
  --text-muted: #868e96;
  
  --font-kor: 'Noto Sans KR', sans-serif;
  --font-eng: 'Outfit', sans-serif;
  --transition-smooth: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: all 0.15s ease;
}

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

body {
  font-family: var(--font-kor);
  color: var(--text-main);
  background-color: var(--bg-page);
  overflow-x: hidden;
  line-height: 1.5;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition-fast);
}

button {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  outline: none;
}

input, select, textarea {
  font-family: inherit;
  color: inherit;
  outline: none;
}

/* ==========================================================================
   Top Sub-Header (Tiny upper link bar)
   ========================================================================== */
.top-bar {
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-color);
  height: 36px;
  display: flex;
  align-items: center;
}

.top-bar-container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

.top-bar-link {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-sub);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.top-bar-link:hover {
  color: var(--primary-color);
}

.top-bar-arrow {
  width: 12px;
  height: 12px;
  stroke-width: 2.5px;
}

/* ==========================================================================
   Main Header Section
   ========================================================================== */
#main-header {
  position: sticky;
  top: 0;
  z-index: 999;
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-color);
  height: 60px;
  display: flex;
  align-items: center;
  transition: var(--transition-fast);
}

.header-container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo */
.logo-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-symbol {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-symbol svg {
  width: 100%;
  height: 100%;
}

.logo-text {
  font-family: var(--font-eng);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.05em;
  color: var(--text-main);
}

/* Navigation Menu */
.nav-menu ul {
  display: flex;
  list-style: none;
  gap: 24px;
  margin-left: 36px;
  align-items: center;
  height: 60px;
}

.nav-tab-btn {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-sub);
  height: 60px;
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 4px;
  transition: var(--transition-fast);
}

.nav-tab-btn:hover {
  color: var(--primary-color);
}

.nav-tab-btn.active {
  color: var(--primary-color);
}

.nav-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: var(--primary-color);
  border-radius: 3px 3px 0 0;
}

.nav-tab-btn.special-ad {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ad-tag {
  background-color: rgba(255, 75, 75, 0.1);
  color: var(--primary-color);
  font-family: var(--font-eng);
  font-size: 10px;
  font-weight: 800;
  padding: 2px 4px;
  border-radius: 4px;
  line-height: 1;
}

/* Search Box */
.header-search {
  flex-grow: 1;
  max-width: 320px;
  margin: 0 40px;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background-color: #f2f4f6;
  border-radius: 20px;
  height: 38px;
  padding: 0 16px;
  transition: var(--transition-fast);
  border: 1px solid transparent;
}

.search-input-wrapper:focus-within {
  background-color: #ffffff;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(255, 75, 75, 0.1);
}

.search-icon {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  margin-right: 8px;
  flex-shrink: 0;
}

.search-input-wrapper input {
  border: none;
  background: transparent;
  width: 100%;
  font-size: 13px;
  font-weight: 500;
}

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

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-btn {
  background-color: var(--primary-color);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 20px;
  transition: var(--transition-fast);
}

.login-btn:hover {
  background-color: var(--primary-hover);
}

.mobile-toggle-btn {
  display: none;
  color: var(--text-sub);
  padding: 6px;
}

/* ==========================================================================
   Mobile Sidebar Menu
   ========================================================================== */
.mobile-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.4);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mobile-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.mobile-sidebar {
  position: fixed;
  top: 0;
  right: -280px;
  width: 280px;
  height: 100vh;
  background-color: #ffffff;
  z-index: 1001;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-sidebar.active {
  right: 0;
}

.sidebar-header {
  height: 60px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
  font-family: var(--font-eng);
  font-size: 22px;
  font-weight: 800;
  color: var(--text-main);
}

.close-btn {
  color: var(--text-sub);
  padding: 4px;
}

.mobile-nav {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex-grow: 1;
}

.mobile-nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mobile-tab-btn {
  width: 100%;
  text-align: left;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-sub);
  padding: 10px 12px;
  border-radius: 8px;
  transition: var(--transition-fast);
}

.mobile-tab-btn:hover, .mobile-tab-btn.active {
  background-color: #f2f4f6;
  color: var(--primary-color);
}

.mobile-auth {
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
}

.mobile-util-btn {
  width: 100%;
  height: 44px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.mobile-util-btn.primary {
  background-color: var(--primary-color);
  color: #ffffff;
}

.mobile-util-btn.primary:hover {
  background-color: var(--primary-hover);
}

/* ==========================================================================
   Main Content Layout
   ========================================================================== */
.main-content {
  padding-top: 40px;
  padding-bottom: 60px;
  min-height: calc(100vh - 180px);
}

.main-container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Views display logic */
.tab-view {
  display: none;
}

.tab-view.active {
  display: block;
  animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.view-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 24px;
  letter-spacing: -0.02em;
}

.view-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: -16px;
  margin-bottom: 24px;
}

/* ==========================================================================
   VIEW: CHANNELS (Channel Grid & Card styling)
   ========================================================================== */
.category-pills-container {
  margin-bottom: 24px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.category-pills-container::-webkit-scrollbar {
  height: 4px;
}

.category-pills-container::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.08);
  border-radius: 4px;
}

.category-pills {
  display: flex;
  gap: 8px;
  white-space: nowrap;
}

.pill-btn {
  height: 36px;
  padding: 0 16px;
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-sub);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-fast);
}

.pill-btn:hover {
  background-color: #f2f4f6;
  border-color: #ced4da;
}

.pill-btn.active {
  background-color: var(--text-main);
  color: #ffffff;
  border-color: var(--text-main);
}

.pill-icon {
  width: 14px;
  height: 14px;
  stroke-width: 2.2px;
}

/* Channels Grid */
.channels-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.channel-card {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  transition: var(--transition-smooth);
}

.channel-card:hover {
  transform: translateY(-4px);
  border-color: #ced4da;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
}

.channel-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition-fast);
}

.channel-icon svg {
  width: 22px;
  height: 22px;
  stroke-width: 2px;
}

/* Custom background colors for channel categories icons */
.icon-bubble { background-color: #e7f5ff; color: #228be6; }
.icon-briefcase { background-color: #fff4e6; color: #fd7e14; }
.icon-alert { background-color: #fff0f6; color: #f783ac; }
.icon-cooking { background-color: #ebfbee; color: #40c057; }
.icon-menu-plan { background-color: #f3f0ff; color: #7950f2; }
.icon-thumb { background-color: #e6fcf5; color: #20c997; }
.icon-shuffle { background-color: #fff9db; color: #fab005; }
.icon-document { background-color: #e8f7ff; color: #15aabf; }
.icon-folder { background-color: #f8f0fc; color: #be4bdb; }
.icon-ai { background-color: #e3fafc; color: #1098ad; }
.icon-school { background-color: #edf2ff; color: #4c6ef5; }

.channel-card:hover .channel-icon {
  transform: scale(1.08);
}

.channel-info {
  flex-grow: 1;
}

.channel-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 2px;
}

.channel-meta {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 8px;
}

.channel-desc {
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.4;
  word-break: keep-all;
}

/* ==========================================================================
   VIEW: HOME (Dashboard, Keywords, Feed)
   ========================================================================== */
.home-layout {
  display: grid;
  grid-template-columns: 240px 1fr 240px;
  gap: 20px;
}

.widget-card {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
}

.widget-card h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

/* Keywords List widget */
.popular-keywords-list {
  list-style: none;
}

.popular-keywords-list li {
  display: flex;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f8f9fa;
  font-size: 13px;
}

.popular-keywords-list li:last-child {
  border-bottom: none;
}

.popular-keywords-list .rank {
  font-weight: 700;
  width: 20px;
  color: var(--text-muted);
}

.popular-keywords-list li:nth-child(-n+3) .rank {
  color: var(--primary-color);
}

.popular-keywords-list .keyword {
  flex-grow: 1;
  color: var(--text-sub);
  font-weight: 500;
  cursor: pointer;
}

.popular-keywords-list .keyword:hover {
  color: var(--primary-color);
}

.popular-keywords-list .trend {
  display: flex;
  align-items: center;
  font-size: 11px;
}

.popular-keywords-list .trend.up {
  color: var(--primary-color);
}

.popular-keywords-list .trend.down {
  color: #228be6;
}

.popular-keywords-list .trend svg {
  width: 12px;
  height: 12px;
  stroke-width: 3px;
}

/* Topics list widget */
.popular-topics-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.popular-topics-list li a {
  font-size: 13px;
  color: var(--text-sub);
  font-weight: 500;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.popular-topics-list li a:hover {
  color: var(--primary-color);
}

/* Home Feed list */
.feed-header {
  margin-bottom: 16px;
}

.feed-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}

.feed-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feed-post-card {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.feed-post-card:hover {
  border-color: #ced4da;
}

.post-header {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  margin-bottom: 8px;
}

.post-channel {
  font-weight: 700;
  color: var(--primary-color);
  background-color: rgba(255, 75, 75, 0.06);
  padding: 2px 6px;
  border-radius: 4px;
}

.post-author {
  font-weight: 500;
  color: var(--text-sub);
}

.post-date {
  color: var(--text-muted);
  margin-left: auto;
}

.post-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
  line-height: 1.4;
}

.post-content {
  font-size: 13.5px;
  color: var(--text-sub);
  line-height: 1.5;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-all;
}

.post-footer {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid #f8f9fa;
  padding-top: 12px;
}

.post-stat {
  display: flex;
  align-items: center;
  gap: 4px;
}

.post-stat svg {
  width: 14px;
  height: 14px;
}

/* Sidebar Right Promo */
.promo-card {
  height: 180px;
  border-radius: 12px;
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
  margin-bottom: 20px;
}

.promo-content {
  position: absolute;
  inset: 0;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  color: #ffffff;
  background-color: rgba(0, 0, 0, 0.45);
}

.ad-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background-color: rgba(0, 0, 0, 0.6);
  font-size: 9px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 3px;
  letter-spacing: 0.05em;
}

.promo-content h4 {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
  line-height: 1.3;
}

.promo-content p {
  font-size: 11px;
  opacity: 0.85;
  margin-bottom: 12px;
  line-height: 1.3;
}

.promo-btn {
  background-color: var(--secondary-color);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  height: 28px;
  border-radius: 14px;
  width: 100%;
}

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

/* Recommended Channels Right Sidebar */
.recommended-channels-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rec-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rec-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #f2f4f6;
  color: var(--text-sub);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.rec-icon svg {
  width: 16px;
  height: 16px;
}

.rec-info {
  flex-grow: 1;
}

.rec-info h5 {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 110px;
}

.rec-info p {
  font-size: 10px;
  color: var(--text-muted);
}

.follow-btn {
  border: 1px solid var(--border-color);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-sub);
  height: 26px;
  padding: 0 8px;
  border-radius: 13px;
  transition: var(--transition-fast);
}

.follow-btn:hover {
  background-color: var(--primary-color);
  color: #ffffff;
  border-color: var(--primary-color);
}

/* ==========================================================================
   VIEW: REVIEWS (School Reviews Layout & Cards)
   ========================================================================== */
.review-search-container {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
}

.review-search-box {
  display: flex;
  align-items: center;
  border: 1px solid #ced4da;
  border-radius: 24px;
  height: 48px;
  padding: 0 16px 0 20px;
  background-color: #ffffff;
}

.review-search-box:focus-within {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(255, 75, 75, 0.1);
}

.review-search-icon {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  margin-right: 10px;
}

.review-search-box input {
  border: none;
  background: transparent;
  flex-grow: 1;
  font-size: 14px;
  font-weight: 500;
}

.review-search-btn {
  background-color: var(--text-main);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  height: 36px;
  border-radius: 18px;
  padding: 0 20px;
}

.review-search-btn:hover {
  background-color: #000000;
}

/* Reviews List */
.reviews-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.review-card {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
}

.review-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid #f8f9fa;
  padding-bottom: 16px;
  margin-bottom: 16px;
}

.school-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 2px;
}

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

.total-rating {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.total-rating .stars {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 16px;
  font-weight: 700;
  color: #222;
}

.star-filled {
  fill: #ffc107;
  color: #ffc107;
  width: 16px;
  height: 16px;
}

.rating-txt {
  font-size: 11px;
  font-weight: 700;
  color: var(--secondary-color);
  background-color: rgba(18, 184, 134, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
}

.rating-txt.bad {
  color: var(--primary-color);
  background-color: rgba(255, 75, 75, 0.08);
}

/* Review details scores */
.review-scores {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 320px;
  margin-bottom: 20px;
  background-color: #f8f9fa;
  padding: 12px 16px;
  border-radius: 8px;
}

.score-item {
  display: flex;
  align-items: center;
  font-size: 12px;
}

.score-label {
  width: 70px;
  font-weight: 600;
  color: var(--text-sub);
}

.score-bar {
  flex-grow: 1;
  height: 6px;
  background-color: #e9ecef;
  border-radius: 3px;
  overflow: hidden;
  margin: 0 12px;
}

.score-fill {
  height: 100%;
  background-color: var(--primary-color);
  border-radius: 3px;
}

.score-val {
  width: 20px;
  text-align: right;
  font-weight: 700;
  color: var(--text-main);
}

.review-content .review-headline {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}

.review-content .review-body {
  font-size: 13.5px;
  color: var(--text-sub);
  line-height: 1.5;
  margin-bottom: 16px;
}

.review-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  gap: 12px;
}

/* ==========================================================================
   VIEW: AD (Special Deals)
   ========================================================================== */
.ad-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.ad-card {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.ad-img-wrapper {
  height: 220px;
  position: relative;
  overflow: hidden;
}

.ad-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-smooth);
}

.ad-card:hover .ad-img-wrapper img {
  transform: scale(1.04);
}

.ad-discount {
  position: absolute;
  top: 16px;
  left: 16px;
  background-color: var(--primary-color);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
}

.ad-info {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.ad-category {
  font-size: 11px;
  font-weight: 700;
  color: var(--secondary-color);
  margin-bottom: 6px;
  text-transform: uppercase;
}

.ad-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
  line-height: 1.4;
}

.ad-price-section {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 12px;
}

.ad-price-section .old-price {
  font-size: 13px;
  text-decoration: line-through;
  color: var(--text-muted);
}

.ad-price-section .new-price {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary-color);
}

.ad-desc {
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.5;
  margin-bottom: 20px;
}

.ad-buy-btn {
  background-color: var(--secondary-color);
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 700;
  height: 40px;
  border-radius: 8px;
  width: 100%;
  margin-top: auto;
  transition: var(--transition-fast);
}

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

/* ==========================================================================
   Modals System (Login Modal overlay & form styling)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: #ffffff;
  border-radius: 16px;
  width: 90%;
  max-width: 420px;
  padding: 32px;
  position: relative;
  transform: scale(0.95) translateY(10px);
  transition: var(--transition-smooth);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.modal-overlay.active .modal-content {
  transform: scale(1) translateY(0);
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  color: var(--text-muted);
  padding: 4px;
}

.modal-close:hover {
  color: var(--text-main);
}

.modal-header-desc {
  margin-bottom: 24px;
  text-align: center;
}

.modal-header-desc h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.modal-header-desc p {
  color: var(--text-muted);
  font-size: 13px;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-sub);
}

.form-group input {
  height: 42px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  padding: 0 14px;
  font-size: 13.5px;
  transition: var(--transition-fast);
}

.form-group input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(255, 75, 75, 0.1);
}

.form-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-sub);
}

.form-checkbox input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary-color);
}

.submit-btn {
  background-color: var(--primary-color);
  color: #ffffff;
  height: 44px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  transition: var(--transition-fast);
  margin-top: 4px;
}

.submit-btn:hover {
  background-color: var(--primary-hover);
}

/* SNS Login section */
.sns-login {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.sns-title {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

.sns-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.sns-btn {
  width: 100%;
  height: 42px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.sns-btn.kakao {
  background-color: #fee500;
  color: #191919;
}

.sns-btn.kakao:hover {
  background-color: #f7d600;
}

.sns-btn.naver {
  background-color: #03c75a;
  color: #ffffff;
}

.sns-btn.naver:hover {
  background-color: #02b14f;
}

.login-footer {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-muted);
}

.login-footer .divider {
  color: var(--border-color);
}

.login-footer .footer-link:hover {
  color: var(--primary-color);
}

/* ==========================================================================
   Footer Section
   ========================================================================== */
.footer {
  background-color: #ffffff;
  border-top: 1px solid var(--border-color);
  padding: 48px 0;
}

.footer-container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

.footer-logo {
  font-family: var(--font-eng);
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 16px;
  letter-spacing: -0.05em;
}

.footer-links {
  display: flex;
  gap: 20px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.footer-links a {
  font-size: 12.5px;
  color: var(--text-sub);
  font-weight: 500;
}

.footer-links a:hover {
  color: var(--primary-color);
}

.footer-copyright {
  font-size: 11px;
  color: var(--text-muted);
}

/* Hide mobile-specific layout components on Desktop */
.mobile-sub-nav {
  display: none;
}
.mobile-search-bar {
  display: none;
}

/* ==========================================================================
   Media Queries & Responsiveness
   ========================================================================== */

/* Tablet Mode */
@media (max-width: 1024px) {
  .home-layout {
    grid-template-columns: 1fr;
  }
  
  .home-sidebar-left, .home-sidebar-right {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  
  .home-sidebar-left .widget-card, .home-sidebar-right .widget-card {
    margin-bottom: 0;
  }
  
  .promo-card {
    margin-bottom: 0;
  }
  
  .channels-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .header-search {
    margin: 0 20px;
  }
}

/* Mobile Mode */
@media (max-width: 768px) {
  .nav-menu {
    display: none; /* Hide header tabs */
  }
  
  .header-search {
    display: none; /* Hide search in header on mobile */
  }
  
  .mobile-toggle-btn {
    display: block; /* Show menu toggle */
  }
  
  .home-sidebar-left, .home-sidebar-right {
    grid-template-columns: 1fr;
    gap: 0;
  }
  
  .home-sidebar-left .widget-card, .home-sidebar-right .widget-card, .promo-card {
    margin-bottom: 16px;
  }
  
  /* Mobile sub-navigation bar */
  .mobile-sub-nav {
    display: flex;
    justify-content: space-around;
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 60px;
    z-index: 998;
    height: 48px;
  }
  
  .mobile-sub-tab-btn {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-sub);
    height: 48px;
    position: relative;
    display: flex;
    align-items: center;
    padding: 0 8px;
    transition: var(--transition-fast);
  }
  
  .mobile-sub-tab-btn:hover, .mobile-sub-tab-btn.active {
    color: var(--primary-color);
  }
  
  .mobile-sub-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 3px 3px 0 0;
  }
  
  .mobile-sub-tab-btn.special-ad {
    display: flex;
    align-items: center;
    gap: 4px;
  }

  /* Mobile search bar style */
  .mobile-search-bar {
    display: block;
    padding: 10px 20px;
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-color);
  }
  
  .mobile-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background-color: #f2f4f6;
    border-radius: 20px;
    height: 38px;
    padding: 0 16px;
    transition: var(--transition-fast);
    border: 1px solid transparent;
  }
  
  .mobile-search-wrapper:focus-within {
    background-color: #ffffff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 75, 75, 0.1);
  }
  
  .mobile-search-icon {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    margin-right: 8px;
    flex-shrink: 0;
  }
  
  .mobile-search-wrapper input {
    border: none;
    background: transparent;
    width: 100%;
    font-size: 13px;
    font-weight: 500;
  }

  /* Compact Channels Grid for Mobile */
  .channels-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .channel-card {
    padding: 16px;
    gap: 14px;
    background-color: #ffffff;
    border: 1px solid #f1f3f5;
    border-radius: 12px;
  }
  
  .channel-icon {
    width: 44px;
    height: 44px;
  }
  
  .channel-icon svg {
    width: 20px;
    height: 20px;
  }
  
  .channel-name {
    font-size: 15px;
    font-weight: 700;
    color: #222222;
  }
  
  .channel-meta {
    font-size: 11px;
    color: #94969b;
    margin-bottom: 6px;
  }
  
  .channel-desc {
    font-size: 13px;
    color: #4a4a4a;
    line-height: 1.4;
  }

  /* Compact Feed Cards for Mobile (게시판 디자인) */
  .feed-post-card {
    padding: 16px;
    background-color: #ffffff;
    border: 1px solid #f1f3f5;
    border-radius: 12px;
  }
  
  .post-header {
    font-size: 11.5px;
    margin-bottom: 6px;
  }

  .post-channel {
    font-size: 11px;
    font-weight: 700;
    color: var(--primary-color);
    background-color: rgba(255, 75, 75, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
  }
  
  .post-author {
    color: #8c8c8c;
  }

  .post-date {
    color: #b5b5b5;
  }

  .post-title {
    font-size: 15px;
    font-weight: 700;
    color: #111111;
    margin-top: 6px;
    margin-bottom: 6px;
    line-height: 1.4;
  }
  
  .post-content {
    font-size: 13px;
    color: #4a4a4a;
    line-height: 1.45;
    margin-bottom: 12px;
  }

  .post-footer {
    border-top: 1px solid #f8f9fa;
    padding-top: 10px;
    font-size: 11.5px;
    color: #94969b;
  }

  .post-stat svg {
    width: 13px;
    height: 13px;
  }

  /* Compact School Reviews for Mobile */
  .review-card {
    padding: 16px;
  }

  .review-card-header {
    flex-wrap: wrap;
    gap: 10px;
  }

  .total-rating {
    align-items: flex-start;
  }
  
  .review-scores {
    max-width: 100%;
  }

  /* Recommended channels list can use full width on mobile stacked layout */
  .rec-info h5 {
    max-width: none;
  }

  /* Stacked Ads Grid for Mobile */
  .ad-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .ad-img-wrapper {
    height: 160px;
  }
  
  /* Mobile Login Modal Drawer (Bottom Sheet) */
  .modal-overlay {
    align-items: flex-end; /* Show at bottom */
  }
  
  .modal-content {
    width: 100%;
    max-width: 100%;
    border-radius: 20px 20px 0 0;
    padding: 24px 20px 36px 20px;
    transform: translateY(100%); /* Slide out from bottom */
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }
  
  .modal-overlay.active .modal-content {
    transform: translateY(0);
  }
  
  .modal-close {
    top: 16px;
    right: 20px;
  }

  .main-content {
    padding-top: 16px;
  }
}

/* Small Phone Mode (extra tightening for narrow devices) */
@media (max-width: 480px) {
  .top-bar-container,
  .header-container,
  .main-container,
  .footer-container {
    padding: 0 16px;
  }

  .top-bar-link {
    font-size: 11px;
  }

  .logo-text .logo-title {
    font-size: 20px;
  }

  .view-title {
    font-size: 20px;
    margin-bottom: 18px;
  }

  .view-subtitle {
    margin-top: -12px;
    margin-bottom: 18px;
  }

  .pill-btn {
    height: 32px;
    padding: 0 12px;
    font-size: 12.5px;
  }

  .channel-card {
    padding: 14px;
    gap: 12px;
  }

  .review-search-container {
    padding: 16px;
  }

  .review-search-box {
    height: 44px;
    padding: 0 12px 0 16px;
  }

  .school-name {
    font-size: 15.5px;
  }

  .score-label {
    width: 62px;
    font-size: 11.5px;
  }

  .score-bar {
    margin: 0 8px;
  }

  .ad-img-wrapper {
    height: 140px;
  }

  .ad-info {
    padding: 16px;
  }

  .ad-name {
    font-size: 14.5px;
  }

  .modal-content {
    padding: 20px 16px 28px 16px;
  }

  .promo-card {
    height: 150px;
  }
}
