/**
 * Guidelines Page Styles
 * 
 * ⚠️ LAYOUT LOCKED - DO NOT MODIFY CORE STRUCTURE ⚠️
 * Last modified: 2025-10-22
 * This file provides the two-column layout (sidebar + main content),
 * diagnosis list, search functionality, and tabbed interface
 * for the guidelines & teaching page (#/guidelines route).
 */

/* Guidelines Layout */
#guidelines-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  height: calc(100vh - 60px);
  gap: 0;
}

/* Guidelines Sidebar */
#guidelines-sidebar {
  background: var(--panel);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 0;
}

.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(
    145deg,
    var(--panel) 0%,
    rgba(220, 38, 38, 0.05) 100%
  );
}

.sidebar-header h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 1rem;
  color: var(--ink);
  font-size: 1.1rem;
  font-weight: 600;
}

.sidebar-header svg {
  color: var(--cardio-primary);
}

.guidelines-search {
  position: relative;
}

.guidelines-search input {
  width: 100%;
  padding: 12px 40px 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--ink);
  font-size: 0.9rem;
}

.guidelines-search input:focus {
  outline: none;
  border-color: var(--cardio-primary);
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.1);
}

.guidelines-search svg {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}

/* Guidelines Diagnosis List */
.guidelines-dx-list {
  padding: 0;
}

.guidelines-dx-item {
  display: block;
  padding: 12px 1.5rem;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.3s ease;
  cursor: pointer;
  font-size: 0.9rem;
}

.guidelines-dx-item:hover {
  background: rgba(59, 130, 246, 0.1);
  color: var(--ink);
  padding-left: 2rem;
}

.guidelines-dx-item.active {
  background: rgba(220, 38, 38, 0.1);
  color: var(--cardio-primary);
  border-left: 3px solid var(--cardio-primary);
  font-weight: 500;
}

/* Guidelines Main Content */
#guidelines-main {
  overflow-y: auto;
  padding: 0;
  background: var(--bg);
}

/* Welcome Screen */
.guidelines-welcome {
  padding: 3rem;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.welcome-content h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--cardio-primary) 0%, #f97316 100%);
  background-clip: text;
  color: transparent;
}

.welcome-content p {
  color: var(--muted);
  font-size: 1.1rem;
  margin-bottom: 3rem;
  line-height: 1.6;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.feature-card {
  background: var(--panel);
  padding: 2rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  text-align: center;
  transition: all 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(220, 38, 38, 0.3);
}

.feature-card svg {
  color: var(--cardio-primary);
  margin-bottom: 1rem;
}

.feature-card h4 {
  color: var(--ink);
  margin: 1rem 0 0.5rem 0;
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
  display: block;
}

.feature-card p {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0;
  text-align: center;
}

/* Guidelines Content Area */
.guidelines-content-area {
  padding: 2rem;
}

.guidelines-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border);
}

.guidelines-header h2 {
  color: var(--ink);
  font-size: 2rem;
  margin: 0 0 1rem 0;
}

.guidelines-meta {
  display: flex;
  gap: 2rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.guidelines-meta span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Guidelines Tabs */
.guidelines-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.guidelines-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.3s ease;
}

.guidelines-tab:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.05);
}

.guidelines-tab.active {
  color: var(--cardio-primary);
  border-bottom-color: var(--cardio-primary);
  background: rgba(220, 38, 38, 0.1);
}

.guidelines-tab svg {
  opacity: 0.7;
}

.guidelines-tab.active svg {
  opacity: 1;
}

/* Tab Panels */
.guidelines-tab-content {
  min-height: 400px;
}

.tab-panel {
  display: none;
}

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

.guidelines-section {
  background: var(--panel);
  border-radius: 12px;
  padding: 2rem;
  border: 1px solid var(--border);
  margin-bottom: 2rem;
}

.guidelines-section h3 {
  color: var(--ink);
  font-size: 1.3rem;
  margin: 0 0 1.5rem 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.content-area {
  color: var(--muted);
  line-height: 1.7;
}

.content-area h4 {
  color: var(--ink);
  font-size: 1.1rem;
  margin: 1.5rem 0 0.8rem 0;
  font-weight: 600;
}

.content-area p {
  margin-bottom: 1rem;
}

.content-area ul {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

.content-area li {
  margin-bottom: 0.5rem;
}

.content-area .guideline-recommendation {
  background: rgba(59, 130, 246, 0.1);
  border-left: 4px solid var(--accent-2);
  padding: 1rem;
  margin: 1rem 0;
  border-radius: 8px;
}

.content-area .safety-alert {
  background: rgba(239, 68, 68, 0.1);
  border-left: 4px solid var(--danger);
  padding: 1rem;
  margin: 1rem 0;
  border-radius: 8px;
}

.content-area .teaching-point {
  background: rgba(16, 185, 129, 0.1);
  border-left: 4px solid var(--success);
  padding: 1rem;
  margin: 1rem 0;
  border-radius: 8px;
}

/* Evidence levels */
.evidence-a {
  color: #10b981;
  font-weight: 600;
}
.evidence-b {
  color: #f59e0b;
  font-weight: 600;
}
.evidence-c {
  color: #ef4444;
  font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
  #guidelines-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  #guidelines-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

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

  .guidelines-welcome {
    padding: 2rem 1rem;
  }

  .guidelines-content-area {
    padding: 1rem;
  }

  .guidelines-tabs {
    flex-wrap: wrap;
  }

  .guidelines-tab {
    flex: 1;
    min-width: 120px;
  }
}
