/**
 * Assistant Panel Component Styles
 * Design System: navy, cream, tan, brown, teal, gold, green, coral, purple
 */

:root {
  --navy: #22333B;
  --cream: #EAE0D5;
  --tan: #C6AC8F;
  --brown: #5E503F;
  --teal: #00B4CC;
  --gold: #D4A537;
  --green: #6ECF6E;
  --coral: #E07A5F;
  --purple: #6B4C9A;
}

/* Panel Container */
.assistant-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 380px;
  background: white;
  border-left: 3px solid var(--navy);
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

/* Panel Header */
.panel-header {
  background: linear-gradient(135deg, var(--navy) 0%, rgba(34, 51, 59, 0.95) 100%);
  padding: 16px;
  border-bottom: 1px solid rgba(34, 51, 59, 0.1);
}

.header-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-icon {
  color: var(--gold);
  flex-shrink: 0;
  animation: pulse-icon 2s ease-in-out infinite;
}

@keyframes pulse-icon {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.panel-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: white;
  letter-spacing: 0.3px;
}

/* Tab Bar */
.tab-bar {
  display: flex;
  background: var(--cream);
  border-bottom: 1px solid #ddd;
  padding: 0;
  gap: 0;
}

.tab-button {
  flex: 1;
  padding: 12px 16px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--brown);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tab-button:hover {
  background: rgba(34, 51, 59, 0.04);
  color: var(--navy);
}

.tab-button.active {
  background: white;
  border-bottom-color: var(--teal);
  color: var(--navy);
}

/* Panel Content */
.panel-content {
  flex: 1;
  overflow: hidden;
  display: flex;
}

.tab-content {
  flex: 1;
  display: none;
  overflow-y: auto;
  overflow-x: hidden;
}

.tab-content.active {
  display: flex;
  flex-direction: column;
}

/* Guide Content */
.guide-container {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
}

.step-header {
  margin-bottom: 24px;
}

.step-title {
  margin: 0 0 8px 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.3;
}

.step-description {
  margin: 0;
  font-size: 13px;
  color: var(--brown);
  line-height: 1.5;
}

/* Why This Matters Section */
.why-section {
  margin-bottom: 20px;
  padding: 12px 12px 12px 14px;
  background: rgba(0, 180, 204, 0.06);
  border-left: 4px solid var(--teal);
  border-radius: 3px;
}

.why-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--teal);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.why-text {
  margin: 0;
  font-size: 13px;
  color: var(--navy);
  line-height: 1.6;
  font-weight: 500;
}

/* Best Practices Section */
.best-practices-section {
  margin-bottom: 20px;
}

.section-title {
  margin: 0 0 10px 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.practices-list {
  margin: 0;
  padding-left: 18px;
  list-style: none;
}

.practices-list li {
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--brown);
  line-height: 1.5;
  position: relative;
  padding-left: 8px;
}

.practices-list li:before {
  content: '•';
  position: absolute;
  left: -8px;
  color: var(--teal);
  font-weight: 700;
}

/* Research Section */
.research-section {
  margin-bottom: 20px;
}

.research-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.research-item {
  padding: 10px;
  background: #f8f8f8;
  border-radius: 3px;
  border-left: 3px solid var(--gold);
}

.research-text {
  margin: 0 0 6px 0;
  font-size: 12px;
  color: var(--navy);
  line-height: 1.5;
  font-style: italic;
}

.research-source {
  margin: 0;
  font-size: 11px;
  color: var(--brown);
  font-weight: 600;
}

/* Resources Section */
.resources-section {
  margin-bottom: 20px;
}

.resources-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.download-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--cream);
  border: 1px solid var(--tan);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.download-button:hover {
  background: var(--tan);
  color: white;
  border-color: var(--brown);
  transform: translateX(2px);
}

.download-button svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

/* Pro Tip Section */
.pro-tip-section {
  padding: 12px 12px 12px 14px;
  background: rgba(212, 165, 55, 0.08);
  border-left: 4px solid var(--gold);
  border-radius: 3px;
  margin-bottom: 0;
}

.pro-tip-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.pro-tip-text {
  margin: 0;
  font-size: 13px;
  color: var(--navy);
  line-height: 1.6;
  font-weight: 500;
}

/* Chat Container */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: white;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-message {
  display: flex;
  margin-bottom: 8px;
  animation: slideIn 0.2s ease;
}

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

.user-message {
  justify-content: flex-end;
}

.user-message p {
  background: var(--navy);
  color: white;
  padding: 10px 12px;
  border-radius: 12px 12px 2px 12px;
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
  max-width: 85%;
  word-wrap: break-word;
}

.assistant-message {
  justify-content: flex-start;
}

.assistant-message p {
  background: var(--cream);
  color: var(--navy);
  padding: 10px 12px;
  border-radius: 12px 12px 12px 2px;
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
  max-width: 85%;
  word-wrap: break-word;
}

/* Suggested Questions */
.suggested-questions {
  padding: 12px 16px 0;
  border-top: 1px solid #e0e0e0;
}

.suggested-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--brown);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.question-chips {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.question-chip {
  padding: 8px 10px;
  background: var(--cream);
  border: 1px solid var(--tan);
  border-radius: 20px;
  font-size: 12px;
  color: var(--navy);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  font-weight: 500;
}

.question-chip:hover {
  background: var(--tan);
  color: white;
  border-color: var(--brown);
}

.question-chip:active {
  transform: scale(0.98);
}

/* Chat Input Wrapper */
.chat-input-wrapper {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid #e0e0e0;
  background: white;
  flex-shrink: 0;
}

.chat-input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--tan);
  border-radius: 20px;
  font-size: 13px;
  color: var(--navy);
  outline: none;
  transition: all 0.2s ease;
  font-family: inherit;
}

.chat-input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(0, 180, 204, 0.1);
}

.chat-input::placeholder {
  color: var(--brown);
  opacity: 0.6;
}

/* Chat Send Button */
.chat-send-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: var(--teal);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.chat-send-button:hover {
  background: #0099aa;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 180, 204, 0.3);
}

.chat-send-button:active {
  transform: translateY(0);
}

.chat-send-button svg {
  width: 18px;
  height: 18px;
}

/* Scrollbar Styling */
.guide-container::-webkit-scrollbar,
.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.guide-container::-webkit-scrollbar-track,
.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.guide-container::-webkit-scrollbar-thumb,
.chat-messages::-webkit-scrollbar-thumb {
  background: var(--tan);
  border-radius: 3px;
}

.guide-container::-webkit-scrollbar-thumb:hover,
.chat-messages::-webkit-scrollbar-thumb:hover {
  background: var(--brown);
}

/* Responsive Design */
@media (max-width: 768px) {
  .assistant-panel {
    width: 100%;
    max-height: 500px;
    border-left: none;
    border-top: 3px solid var(--navy);
  }

  .tab-button {
    font-size: 12px;
    padding: 10px 12px;
  }

  .guide-container {
    padding: 12px;
  }

  .question-chips {
    max-height: 150px;
    overflow-y: auto;
  }

  .user-message p,
  .assistant-message p {
    max-width: 90%;
  }
}

@media (max-width: 480px) {
  .assistant-panel {
    width: 100%;
  }

  .panel-title {
    font-size: 16px;
  }

  .step-title {
    font-size: 16px;
  }

  .tab-button {
    font-size: 11px;
    padding: 8px 8px;
  }

  .section-title {
    font-size: 12px;
  }

  .practices-list li,
  .research-text,
  .pro-tip-text,
  .why-text {
    font-size: 12px;
  }
}

/* Print Styles */
@media print {
  .assistant-panel {
    display: none;
  }
}

/* Accessibility */
.assistant-panel:focus-within {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 0 0 2px var(--teal);
}

.tab-button:focus-visible,
.download-button:focus-visible,
.question-chip:focus-visible,
.chat-send-button:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
  .assistant-panel {
    background: #1a1a1a;
    border-left-color: var(--gold);
  }

  .tab-bar {
    background: #2a2a2a;
  }

  .tab-button {
    color: #ccc;
  }

  .tab-button:hover {
    background: rgba(255, 255, 255, 0.08);
  }

  .tab-button.active {
    background: #1a1a1a;
    color: var(--teal);
  }

  .guide-container {
    background: #1a1a1a;
  }

  .step-title {
    color: var(--gold);
  }

  .step-description {
    color: #aaa;
  }

  .why-section {
    background: rgba(0, 180, 204, 0.1);
  }

  .why-text {
    color: var(--teal);
  }

  .research-item {
    background: #2a2a2a;
  }

  .research-text,
  .research-source {
    color: #aaa;
  }

  .download-button {
    background: #2a2a2a;
    color: var(--gold);
    border-color: var(--gold);
  }

  .download-button:hover {
    background: var(--gold);
    color: #1a1a1a;
  }

  .pro-tip-section {
    background: rgba(212, 165, 55, 0.1);
  }

  .pro-tip-text {
    color: var(--gold);
  }

  .chat-messages {
    background: #1a1a1a;
  }

  .user-message p {
    background: var(--teal);
  }

  .assistant-message p {
    background: #2a2a2a;
    color: #e0e0e0;
  }

  .chat-input {
    background: #2a2a2a;
    color: #e0e0e0;
    border-color: #444;
  }

  .chat-input::placeholder {
    color: #888;
  }

  .chat-send-button {
    background: var(--teal);
  }

  .question-chip {
    background: #2a2a2a;
    color: var(--gold);
    border-color: var(--gold);
  }

  .question-chip:hover {
    background: var(--gold);
    color: #1a1a1a;
  }

  .guide-container::-webkit-scrollbar-thumb {
    background: #444;
  }

  .guide-container::-webkit-scrollbar-thumb:hover {
    background: #666;
  }
}
