/* ==========================================================================
   LNB Interaction Prototype Stylesheet
   - 1440x900 Desktop Portal Theme
   - Colors: White #FFFFFF, Point Blue #1D4ED8, Select Bg #EFF6FF, Dark Text #172033
   - Complete styling for Case 01, Case 02, Case 03, accessibility & developer bar
   ========================================================================== */

:root {
  --bg-white: #ffffff;
  --bg-page: #f8fafc;
  --color-primary: #1d4ed8;
  --color-primary-hover: #1e40af;
  --color-primary-light: #eff6ff;
  --color-primary-border: #93c5fd;
  --color-hover-border: #60a5fa;
  --text-primary: #172033;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border-light: #e2e8f0;
  --border-block: #d1d5db;
  --border-focus: #1d4ed8;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-flyout: 0 10px 25px -5px rgba(29, 78, 216, 0.14), 0 8px 10px -6px rgba(0, 0, 0, 0.06);
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --font-family: -apple-system, BlinkMacSystemFont, "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
}

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

body {
  font-family: var(--font-family);
  background-color: #f1f5f9;
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px;
}

/* Screen reader only utility for accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   DEVELOPER / EVALUATOR CONTROL BAR (Top Switcher)
   ========================================================================== */
.control-bar {
  width: 100%;
  max-width: 1440px;
  background: #1e293b;
  color: #f8fafc;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 12px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--shadow-md);
  z-index: 100;
}

.control-bar__section {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.control-bar__label {
  font-size: 13px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-right: 4px;
}

.btn-group {
  display: inline-flex;
  background: #0f172a;
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 3px;
}

.ctrl-btn {
  background: transparent;
  color: #cbd5e1;
  border: none;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ctrl-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.ctrl-btn:focus-visible {
  outline: 2px solid #60a5fa;
  outline-offset: 1px;
}

.ctrl-btn.active {
  background: var(--color-primary);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.task-btn {
  background: #334155;
  color: #f1f5f9;
  border: 1px solid #475569;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.task-btn:hover {
  background: #475569;
  border-color: #64748b;
  color: #ffffff;
}

.task-btn:focus-visible {
  outline: 2px solid #60a5fa;
}

.task-btn.reset-btn {
  background: #475569;
  border-color: #64748b;
}

.task-btn.reset-btn:hover {
  background: #e11d48;
  border-color: #be123c;
}

.status-badge {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 9999px;
  background: #0f172a;
  color: #38bdf8;
  border: 1px solid #1e3a8a;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  display: inline-block;
  box-shadow: 0 0 8px #22c55e;
}

/* ==========================================================================
   MAIN PROTOTYPE WINDOW CONTAINER (1440x900 Frame)
   ========================================================================== */
.prototype-window {
  width: 1440px;
  height: 900px;
  max-width: 100%;
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* Fullscreen mode override */
body.fullscreen-mode .prototype-window {
  width: 100vw;
  height: calc(100vh - 70px);
  border-radius: 0;
}

/* ==========================================================================
   PORTAL HEADER
   ========================================================================== */
.portal-header {
  height: 56px;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  padding: 0 24px;
  position: relative;
  z-index: 20;
  user-select: none;
}

/* Case 03 specifies 64px header height */
.prototype-window[data-case="case03"] .portal-header {
  height: 64px;
  padding: 0 24px;
}

.portal-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-right: 36px;
  cursor: pointer;
  flex-shrink: 0;
}

.portal-brand__icon {
  width: 22px;
  height: 22px;
  color: var(--color-primary);
}

/* Case 03 Horizontal Navigation in Header */
.portal-nav-h {
  display: none; /* Only visible in Case 03 */
  height: 100%;
  align-items: stretch;
  gap: 8px;
  overflow-x: auto;
}

.prototype-window[data-case="case03"] .portal-nav-h {
  display: flex;
}

.nav-h-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  background: transparent;
  border: none;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.nav-h-item:hover {
  background: #f8fafc;
  color: var(--color-primary);
}

.nav-h-item:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: -2px;
}

/* Selected state in Case 03 Header: light blue pill background + blue underline */
.nav-h-item.active {
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-weight: 600;
}

.nav-h-item.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background-color: var(--color-primary);
}

.header-user-status {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-secondary);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #475569;
  font-weight: 600;
  font-size: 12px;
}

/* ==========================================================================
   PORTAL MAIN BODY LAYOUT (LNB + CONTENT)
   ========================================================================== */
.portal-body {
  display: flex;
  flex: 1;
  height: calc(100% - 56px);
  position: relative;
  overflow: hidden;
}

.prototype-window[data-case="case03"] .portal-body {
  height: calc(100% - 64px);
}

/* ==========================================================================
   LNB SIDEBAR COMMON & CASE SPECIFIC
   ========================================================================== */
.portal-lnb {
  background: var(--bg-white);
  border-right: 1px solid var(--border-light);
  height: 100%;
  overflow-y: auto;
  position: relative;
  flex-shrink: 0;
}

/* Custom sleek scrollbar for LNB */
.portal-lnb::-webkit-scrollbar {
  width: 6px;
}

.portal-lnb::-webkit-scrollbar-track {
  background: transparent;
}

.portal-lnb::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.portal-lnb::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Chevron Icon Styling */
.chevron-icon {
  width: 14px;
  height: 14px;
  transition: transform 0.2s ease;
  flex-shrink: 0;
  stroke-width: 2.5;
}

/* ==========================================================================
   CASE 01: BLOCK ACCORDION (Width 280px)
   ========================================================================== */
.prototype-window[data-case="case01"] .portal-lnb {
  width: 280px;
  padding: 16px;
}

.lnb-case01-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Depth 1 Block (Height 56px) */
.c01-d1-item {
  width: 100%;
}

.c01-d1-btn {
  width: 100%;
  height: 56px;
  background: var(--bg-white);
  border: 1px solid var(--border-block);
  border-radius: var(--radius-md);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.c01-d1-btn:hover {
  background: #f8fafc;
  border-color: var(--color-primary-border);
}

.c01-d1-btn:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 1px;
}

/* Expanded / Active Depth 1 */
.c01-d1-btn[aria-expanded="true"] {
  background: var(--color-primary-light);
  border-color: var(--color-primary-border);
  color: var(--color-primary);
  font-size: 18px;
  font-weight: 700;
}

.c01-d1-btn[aria-expanded="true"] .chevron-icon {
  transform: rotate(180deg);
  stroke: var(--color-primary);
}

/* Depth 2 Container (Indented by 16px) */
.c01-d2-list {
  list-style: none;
  margin-top: 8px;
  margin-left: 16px; /* 16px Indent */
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Depth 2 Block (Height 48px) */
.c01-d2-btn {
  width: 100%;
  height: 48px;
  background: var(--bg-white);
  border: 1px solid var(--border-block);
  border-radius: var(--radius-md);
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.c01-d2-btn:hover {
  background: #f8fafc;
  border-color: var(--color-primary-border);
}

.c01-d2-btn:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 1px;
}

.c01-d2-btn[aria-expanded="true"] {
  font-weight: 700;
  color: var(--text-primary);
}

.c01-d2-btn[aria-expanded="true"] .chevron-icon {
  transform: rotate(180deg);
}

/* Depth 3 List (Indented 16px further: Total 32px indent from LNB left) */
.c01-d3-list {
  list-style: none;
  margin-top: 4px;
  margin-left: 16px; /* 16px Indent inside Depth 2 */
  margin-bottom: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Depth 3 Link (Height 40px) */
.c01-d3-link {
  display: flex;
  align-items: center;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 400;
  color: #475569;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  position: relative;
}

.c01-d3-link:hover {
  background: #f1f5f9;
  color: var(--text-primary);
}

.c01-d3-link:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: -1px;
}

/* Depth 3 Selected State */
.c01-d3-link.active {
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-weight: 600;
}

.c01-d3-link .selected-bar {
  display: none;
  width: 3px;
  height: 16px;
  background-color: var(--color-primary);
  border-radius: 2px;
  margin-right: 8px;
  flex-shrink: 0;
}

.c01-d3-link.active .selected-bar {
  display: inline-block;
}

/* ==========================================================================
   CASE 02: HOVER FLYOUT PANEL (LNB Width 224px, Row Height 48px)
   ========================================================================== */
.prototype-window[data-case="case02"] .portal-lnb {
  width: 224px;
  padding: 16px 12px;
}

.lnb-case02-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.c02-d1-item {
  width: 100%;
}

.c02-d1-btn {
  width: 100%;
  height: 48px;
  background: var(--bg-white);
  border: 1px solid var(--border-block);
  border-radius: var(--radius-md);
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  position: relative;
}

.c02-d1-btn:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 1px;
}

/* When the current selected page belongs to this Depth 1 item */
.c02-d1-btn.has-active-child {
  color: var(--color-primary);
  font-weight: 600;
}

.c02-d1-btn .c02-active-indicator {
  display: none;
  position: absolute;
  left: 6px;
  width: 3px;
  height: 18px;
  background-color: var(--color-primary);
  border-radius: 2px;
}

.c02-d1-btn.has-active-child .c02-active-indicator {
  display: block;
}

/* Hovered / Flyout Open state for Depth 1 Item */
.c02-d1-btn.hovered,
.c02-d1-btn:hover {
  background: var(--color-primary-light);
  border-color: var(--color-hover-border);
  color: var(--color-primary);
  font-weight: 600;
}

.c02-d1-btn.hovered .chevron-icon {
  transform: rotate(180deg);
  stroke: var(--color-primary);
}

/* Case 02 Floating Flyout Panel */
.c02-flyout-panel {
  position: absolute;
  left: 224px; /* Right edge of LNB */
  top: 16px;
  background-color: #ffffff;
  border: 1.5px solid var(--color-hover-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-flyout);
  padding: 20px 24px;
  min-width: 420px;
  max-width: 540px;
  max-height: calc(100% - 32px);
  overflow-y: auto;
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-4px);
  transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s ease;
  pointer-events: none;
}

.c02-flyout-panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  pointer-events: auto;
}

.c02-flyout-header {
  margin-bottom: 14px;
}

.c02-flyout-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-primary);
}

.c02-flyout-divider {
  height: 1px;
  background: var(--border-light);
  margin-top: 10px;
}

/* 2-Column Grid inside Flyout Panel */
.c02-flyout-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  gap: 28px;
}

.c02-group-col {
  display: flex;
  flex-direction: column;
}

.c02-group-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
  padding-bottom: 4px;
  border-bottom: 1px solid #f1f5f9;
}

.c02-links-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.c02-link {
  display: block;
  padding: 6px 8px;
  font-size: 14px;
  color: #334155;
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: all 0.12s ease;
  cursor: pointer;
}

.c02-link:hover {
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-weight: 600;
  padding-left: 12px;
}

.c02-link:focus-visible {
  outline: 2px solid var(--border-focus);
  background: var(--color-primary-light);
}

.c02-link.active {
  color: var(--color-primary);
  font-weight: 700;
  background: var(--color-primary-light);
}

/* ==========================================================================
   CASE 03: HEADER + LNB SYNC (LNB Width 240px)
   ========================================================================== */
.prototype-window[data-case="case03"] .portal-lnb {
  width: 240px;
  padding: 20px 16px;
}

.c03-lnb-header {
  margin-bottom: 16px;
}

.c03-lnb-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.c03-lnb-divider {
  height: 1px;
  background: var(--border-light);
  margin-top: 14px;
}

.c03-d2-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Depth 2 Block (Height 48px) */
.c03-d2-btn {
  width: 100%;
  height: 48px;
  background: var(--bg-white);
  border: 1px solid var(--border-block);
  border-radius: var(--radius-md);
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.c03-d2-btn:hover {
  background: #f8fafc;
  border-color: var(--color-primary-border);
}

.c03-d2-btn:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 1px;
}

.c03-d2-btn[aria-expanded="true"] {
  font-weight: 700;
  color: var(--text-primary);
}

.c03-d2-btn[aria-expanded="true"] .chevron-icon {
  transform: rotate(180deg);
}

/* Depth 3 Links inside Case 03 */
.c03-d3-list {
  list-style: none;
  margin-top: 4px;
  margin-left: 12px;
  margin-bottom: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.c03-d3-link {
  display: flex;
  align-items: center;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 400;
  color: #475569;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.c03-d3-link:hover {
  background: #f1f5f9;
  color: var(--text-primary);
}

.c03-d3-link:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: -1px;
}

.c03-d3-link.active {
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-weight: 600;
}

.c03-d3-link .selected-bar {
  display: none;
  width: 3px;
  height: 16px;
  background-color: var(--color-primary);
  border-radius: 2px;
  margin-right: 8px;
  flex-shrink: 0;
}

.c03-d3-link.active .selected-bar {
  display: inline-block;
}

/* ==========================================================================
   MAIN CONTENT AREA
   ========================================================================== */
.portal-content {
  flex: 1;
  height: 100%;
  overflow-y: auto;
  padding: 24px 36px 40px 36px;
  background: var(--bg-white);
}

.content-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.breadcrumb-sep {
  color: var(--text-muted);
}

.breadcrumb-current {
  color: var(--text-primary);
  font-weight: 500;
}

.content-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 24px;
  letter-spacing: -0.5px;
}

.content-card {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.content-card__desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.6;
}

/* Data Table Styling */
.data-table-container {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 1.5px solid var(--border-light);
}

.data-table th:last-child {
  text-align: right;
}

.data-table td {
  padding: 14px 16px;
  font-size: 14px;
  color: #334155;
  border-bottom: 1px solid #f1f5f9;
}

.data-table td:last-child {
  text-align: right;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background-color: #f8fafc;
}

.badge-status {
  display: inline-block;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 9999px;
  background: #f1f5f9;
  color: #475569;
}

.badge-status.active {
  background: #dcfce7;
  color: #15803d;
}

/* Form Styling */
.mock-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 600px;
}

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

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 9px 12px;
  font-size: 14px;
  font-family: inherit;
  border: 1px solid var(--border-block);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--text-primary);
  transition: border-color 0.15s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
}

.form-textarea {
  min-height: 80px;
  resize: vertical;
}

.form-submit-btn {
  align-self: flex-start;
  margin-top: 8px;
  background: var(--color-primary);
  color: #ffffff;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

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

.form-submit-btn:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

/* ==========================================================================
   TASK HINT MODAL / TOAST
   ========================================================================== */
.toast-notice {
  position: absolute;
  bottom: 24px;
  right: 24px;
  background: #1e293b;
  color: #ffffff;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  box-shadow: var(--shadow-md);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.2s ease;
  pointer-events: none;
}

.toast-notice.show {
  opacity: 1;
  transform: translateY(0);
}
