/**
 * Annual Calendar 2026 Review Console Stylesheet
 * Responsive, accessible, mobile-first medical review interface
 */

:root {
  --rev-bg: #071524;
  --rev-card-bg: #0c2035;
  --rev-card-subtle: #102942;
  --rev-border: #1a3a5c;
  --rev-border-highlight: #2a5a8c;
  --rev-text: #e2e8f0;
  --rev-text-muted: #94a3b8;
  --rev-text-bright: #ffffff;
  
  /* Status Colors */
  --status-approved: #10b981;
  --status-pending: #f59e0b;
  --status-revision: #f97316;
  --status-conflict: #3b82f6;
  --status-addition: #8b5cf6;
  --status-retained: #06b6d4;
  --status-danger: #ef4444;
}

/* App Mode Navigation Bar */
.app-mode-bar {
  background: #040e18;
  border-bottom: 2px solid var(--rev-border);
  padding: 8px 16px;
  position: static;
  top: 0;
  max-width: 100vw;
  box-sizing: border-box;
  overflow-x: hidden;
}

.mode-bar-inner {
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  box-sizing: border-box;
}

.mode-switch-group {
  display: flex;
  background: #091a2b;
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--rev-border);
  gap: 4px;
  max-width: 100%;
  box-sizing: border-box;
}

.mode-tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: var(--rev-text-muted);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.mode-tab-btn:hover {
  color: var(--rev-text-bright);
  background: rgba(255, 255, 255, 0.05);
}

.mode-tab-btn.active {
  background: #00d2b4;
  color: #040e18;
  box-shadow: 0 2px 8px rgba(0, 210, 180, 0.3);
}

.mode-tab-btn .mode-tag {
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.2);
}

.mode-tab-btn.active .mode-tag {
  background: #040e18;
  color: #00d2b4;
}

.mode-tab-btn .mode-tag.review-tag {
  background: #f59e0b;
  color: #040e18;
  font-weight: 700;
}

.mode-status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--rev-text-muted);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

/* Review Layout Container */
.review-layout {
  display: none;
  background: var(--rev-bg);
  min-height: calc(100vh - 120px);
  padding: 16px;
  box-sizing: border-box;
  max-width: 100vw;
  overflow-x: hidden;
}

.review-layout.active {
  display: block;
}

/* Review Notice Banner */
.review-banner {
  background: linear-gradient(135deg, #0c2035 0%, #15324d 100%);
  border: 1px solid var(--rev-border-highlight);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  box-sizing: border-box;
}

.review-banner-text h2 {
  margin: 0 0 4px 0;
  font-size: 1.25rem;
  color: #ffffff;
}

.review-banner-text p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--rev-text-muted);
}

.review-banner-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.banner-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-amber {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.badge-emerald {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.badge-blue {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.4);
}

/* Sticky Controls & Filter Toolbar */
.review-controls-bar {
  background: var(--rev-card-bg);
  border: 1px solid var(--rev-border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

.controls-row-top {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  max-width: 100%;
  box-sizing: border-box;
}

.review-search-box {
  flex: 1 1 200px;
  min-width: 0;
  position: relative;
  display: flex;
  align-items: center;
  box-sizing: border-box;
}

.review-search-box input {
  width: 100%;
  padding: 10px 36px 10px 14px;
  background: #081624;
  border: 1px solid var(--rev-border);
  border-radius: 8px;
  color: #ffffff;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.review-search-box input:focus {
  border-color: #00d2b4;
}

.search-clear-btn {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  color: var(--rev-text-muted);
  cursor: pointer;
  font-size: 1rem;
}

.review-month-select {
  padding: 10px 14px;
  background: #081624;
  border: 1px solid var(--rev-border);
  border-radius: 8px;
  color: #ffffff;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  box-sizing: border-box;
}

.controls-row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  box-sizing: border-box;
}

.btn-review-action {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  background: #102942;
  border: 1px solid var(--rev-border-highlight);
  border-radius: 8px;
  color: #e2e8f0;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.btn-review-action:hover {
  background: #16385a;
  color: #ffffff;
}

.btn-review-action.btn-accent {
  background: rgba(0, 210, 180, 0.15);
  color: #00d2b4;
  border-color: rgba(0, 210, 180, 0.4);
}

.btn-review-action.btn-accent:hover {
  background: rgba(0, 210, 180, 0.25);
}

/* Filter Chips Bar */
.filter-chips-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  max-width: 100%;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
}

.filter-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  background: #081624;
  border: 1px solid var(--rev-border);
  color: var(--rev-text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  flex-shrink: 0;
  box-sizing: border-box;
}

.filter-chip:hover {
  color: #ffffff;
  border-color: var(--rev-border-highlight);
}

.filter-chip.active {
  background: #102942;
  color: #ffffff;
  border-color: #00d2b4;
}

.filter-chip .chip-count {
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 10px;
}

.filter-chip.active .chip-count {
  background: #00d2b4;
  color: #040e18;
}

/* Review Workspace Grid */
.review-workspace-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  max-width: 100%;
  box-sizing: border-box;
}

/* Left Column: Date Navigation List */
.review-list-column {
  background: var(--rev-card-bg);
  border: 1px solid var(--rev-border);
  border-radius: 12px;
  overflow: hidden;
  max-height: calc(100vh - 240px);
  display: flex;
  flex-direction: column;
  min-width: 0;
  box-sizing: border-box;
}

.list-column-header {
  padding: 12px 16px;
  background: #081624;
  border-bottom: 1px solid var(--rev-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-sizing: border-box;
}

.list-column-header h3 {
  margin: 0;
  font-size: 0.95rem;
  color: #ffffff;
}

.list-matching-count {
  font-size: 0.8rem;
  color: var(--rev-text-muted);
  background: #102942;
  padding: 2px 8px;
  border-radius: 10px;
}

.review-date-scroll {
  overflow-y: auto;
  flex: 1;
  padding: 8px;
  box-sizing: border-box;
}

.date-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  margin-bottom: 6px;
  border-radius: 8px;
  background: #081624;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  box-sizing: border-box;
  min-width: 0;
}

.date-list-item:hover {
  background: #102942;
  border-color: var(--rev-border-highlight);
}

.date-list-item.selected {
  background: #12304d;
  border-color: #00d2b4;
  box-shadow: inset 3px 0 0 #00d2b4;
}

.item-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
  padding-right: 8px;
}

.item-date-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #00d2b4;
}

.item-weekday {
  color: var(--rev-text-muted);
  font-weight: normal;
}

.item-topic-title {
  font-size: 0.85rem;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.item-status-pill {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.pill-approved { background: rgba(16, 185, 129, 0.2); color: #10b981; }
.pill-pending { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }
.pill-revision { background: rgba(249, 115, 22, 0.2); color: #f97316; }
.pill-retained { background: rgba(6, 182, 212, 0.2); color: #06b6d4; }
.pill-conflict { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.pill-addition { background: rgba(139, 92, 246, 0.2); color: #a78bfa; }

/* Right Column: Date Detail Workspace */
.review-detail-column {
  background: var(--rev-card-bg);
  border: 1px solid var(--rev-border);
  border-radius: 12px;
  padding: 20px;
  min-width: 0;
  box-sizing: border-box;
}

.detail-date-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--rev-border);
  margin-bottom: 16px;
  box-sizing: border-box;
}

.detail-date-titles h2 {
  margin: 0 0 4px 0;
  font-size: 1.4rem;
  color: #ffffff;
}

.detail-date-titles p {
  margin: 0;
  font-size: 0.95rem;
  color: #00d2b4;
}

.detail-nav-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-nav-day {
  padding: 8px 14px;
  background: #102942;
  border: 1px solid var(--rev-border-highlight);
  border-radius: 8px;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  box-sizing: border-box;
}

.btn-nav-day:hover {
  background: #173b5f;
}

.btn-nav-day kbd {
  background: #081624;
  padding: 1px 4px;
  border-radius: 4px;
  font-size: 0.75rem;
  color: var(--rev-text-muted);
}

/* Status Badges Row */
.detail-status-ribbon {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
  align-items: center;
  box-sizing: border-box;
}

.ribbon-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  box-sizing: border-box;
}

.ribbon-decision-btn {
  background: rgba(139, 92, 246, 0.15);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.4);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.ribbon-decision-btn:hover {
  background: rgba(139, 92, 246, 0.3);
}

/* Side-by-Side Comparison Container */
.comparison-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  margin-bottom: 24px;
  min-width: 0;
  box-sizing: border-box;
}

.comparison-column {
  background: #081624;
  border: 1px solid var(--rev-border);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  box-sizing: border-box;
}

.column-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rev-border);
  box-sizing: border-box;
}

.column-header-bar h3 {
  margin: 0;
  font-size: 1.1rem;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.column-tag {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

.topic-meta-box {
  background: #0d2238;
  border-radius: 8px;
  padding: 12px;
  min-width: 0;
  box-sizing: border-box;
  word-break: break-word;
}

.topic-meta-title-en {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 4px;
}

.topic-meta-title-gu {
  font-size: 1.05rem;
  font-weight: 600;
  color: #00d2b4;
  margin-bottom: 8px;
}

.topic-meta-desc {
  font-size: 0.85rem;
  color: var(--rev-text-muted);
  line-height: 1.4;
}

.authority-box {
  background: #0b1c2e;
  border-left: 3px solid #3b82f6;
  padding: 10px 12px;
  border-radius: 0 6px 6px 0;
  font-size: 0.85rem;
  min-width: 0;
  box-sizing: border-box;
  word-break: break-word;
}

.authority-label {
  font-weight: 700;
  color: #93c5fd;
  margin-bottom: 2px;
}

.authority-sources {
  color: #cbd5e1;
}

.authority-sources a {
  color: #60a5fa;
  text-decoration: underline;
}

/* 4-Card Mini Grid inside Comparison */
.comparison-cards-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  box-sizing: border-box;
}

.review-card-item {
  background: #0c2035;
  border: 1px solid var(--rev-border);
  border-radius: 8px;
  padding: 12px;
  min-width: 0;
  box-sizing: border-box;
  word-break: break-word;
}

.card-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 6px;
}

.card-num-badge {
  font-size: 0.8rem;
  font-weight: 700;
  color: #00d2b4;
  background: rgba(0, 210, 180, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

.card-visual-pill {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.pill-asset-active {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.pill-asset-draft {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px dashed #f59e0b;
}

.card-content-bilingual {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.card-lang-block {
  font-size: 0.85rem;
  line-height: 1.45;
  min-width: 0;
  word-break: break-word;
}

.card-lang-block strong {
  display: block;
  font-size: 0.9rem;
  color: #ffffff;
  margin-bottom: 2px;
}

.card-lang-block.gu strong {
  color: #5eead4;
}

.card-image-preview {
  margin-top: 8px;
  border-radius: 6px;
  overflow: hidden;
  max-width: 140px;
  border: 1px solid var(--rev-border);
}

.card-image-preview img {
  width: 100%;
  height: auto;
  display: block;
}

.card-visual-prompt-box {
  margin-top: 8px;
  background: #071524;
  border: 1px dashed var(--rev-border-highlight);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 0.8rem;
  min-width: 0;
  box-sizing: border-box;
}

.prompt-box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
  color: #f59e0b;
  font-weight: 700;
  flex-wrap: wrap;
  gap: 4px;
}

.prompt-copy-btn {
  background: #102942;
  border: 1px solid var(--rev-border-highlight);
  color: var(--rev-text-muted);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.75rem;
  cursor: pointer;
}

.prompt-copy-btn:hover {
  color: #ffffff;
  background: #173b5f;
}

.prompt-content-text {
  color: #94a3b8;
  font-style: italic;
  font-size: 0.75rem;
  line-height: 1.35;
  word-break: break-word;
}

.prompt-warning-banner {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fbbf24;
  padding: 6px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 6px;
  line-height: 1.3;
}

/* Linked Decision Box in Detail View */
.linked-decision-card {
  background: #102135;
  border: 1px solid #8b5cf6;
  border-radius: 10px;
  padding: 16px;
  margin-top: 16px;
  min-width: 0;
  box-sizing: border-box;
}

.decision-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.decision-card-top h4 {
  margin: 0;
  font-size: 1.05rem;
  color: #c4b5fd;
}

.decision-status-tag {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
}

.decision-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  font-size: 0.85rem;
  color: #cbd5e1;
  min-width: 0;
  box-sizing: border-box;
}

.decision-field {
  min-width: 0;
  word-break: break-word;
}

.decision-field strong {
  display: block;
  color: #ffffff;
  margin-bottom: 4px;
}

/* Modals */
.review-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 14, 24, 0.85);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.review-modal-backdrop.open {
  display: flex;
}

.review-modal-content {
  background: var(--rev-card-bg);
  border: 1px solid var(--rev-border-highlight);
  border-radius: 14px;
  width: 100%;
  max-width: 900px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  box-sizing: border-box;
}

.review-modal-header {
  padding: 16px 20px;
  background: #081624;
  border-bottom: 1px solid var(--rev-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-sizing: border-box;
}

.review-modal-header h3 {
  margin: 0;
  font-size: 1.2rem;
  color: #ffffff;
}

.review-modal-body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-sizing: border-box;
}

.decision-item-card {
  background: #081624;
  border: 1px solid var(--rev-border);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-sizing: border-box;
}

.decision-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.decision-item-title {
  font-size: 1rem;
  font-weight: 700;
  color: #c4b5fd;
}

.btn-filter-dates {
  background: #102942;
  border: 1px solid var(--rev-border-highlight);
  color: #00d2b4;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  box-sizing: border-box;
}

.btn-filter-dates:hover {
  background: #173b5f;
}

/* Responsive Adaptations */
@media (max-width: 992px) {
  .review-workspace-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  
  .review-list-column {
    max-height: 280px;
    min-width: 0;
    max-width: 100%;
  }
  
  .review-detail-column {
    min-width: 0;
    max-width: 100%;
  }
  
  .comparison-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  
  .decision-content-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 600px) {
  .review-banner {
    padding: 12px;
  }
  
  .review-controls-bar {
    padding: 10px;
  }
  
  .detail-date-header-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .mode-switch-group {
    width: 100%;
  }

  .mode-tab-btn {
    flex: 1;
    justify-content: center;
    padding: 6px 6px;
    font-size: 0.82rem;
  }

  .mode-tab-btn .mode-tag {
    display: none;
  }
}
