/* 
  TAXRICA COPILOT UI (v2.0)
  Premium "Light Luxury" Intelligence Layer
*/

:root {
  --copilot-bg: rgba(255, 255, 255, 0.75);
  --copilot-blur: blur(20px);
  --copilot-border: rgba(255, 255, 255, 0.5);
  --copilot-accent: #f7b159;
  --copilot-text: #1a1a1a;
  --copilot-muted: #6b6b6b;
  --copilot-shadow: 0 20px 80px rgba(0, 0, 0, 0.12);
  --copilot-width: 420px;
  --copilot-margin: 24px;
}

/* 1. The Trigger/Launcher (Modern Glass Pill) */
#copilot-trigger {
  position: fixed;
  bottom: var(--copilot-margin);
  right: var(--copilot-margin);
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(26, 26, 26, 0.95);
  backdrop-filter: blur(8px);
  color: white;
  padding: 12px 24px;
  border-radius: 99px;
  cursor: pointer;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 9999;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

#copilot-trigger:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

#copilot-trigger .insight-dot {
  width: 10px;
  height: 10px;
  background: var(--copilot-accent);
  border-radius: 50%;
  box-shadow: 0 0 15px var(--copilot-accent);
  animation: pulse-gold-v2 2s infinite;
}

@keyframes pulse-gold-v2 {
  0% { transform: scale(1); opacity: 1; filter: brightness(1); }
  50% { transform: scale(1.5); opacity: 0.5; filter: brightness(1.5); }
  100% { transform: scale(1); opacity: 1; filter: brightness(1); }
}

/* 2. The Drawer (Floating Glass Architecture) */
#copilot-drawer {
  position: fixed;
  top: var(--copilot-margin);
  right: calc(-1 * (var(--copilot-width) + 40px));
  width: var(--copilot-width);
  height: calc(100vh - (var(--copilot-margin) * 2));
  background: var(--copilot-bg);
  backdrop-filter: var(--copilot-blur);
  -webkit-backdrop-filter: var(--copilot-blur);
  border: var(--copilot-border);
  border-radius: 32px;
  box-shadow: var(--copilot-shadow);
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#copilot-drawer.expanded {
  right: var(--copilot-margin);
}

/* Header (Integrated Branding) */
.copilot-header {
  padding: 32px 32px 24px 32px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.copilot-title-group h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  color: var(--copilot-text);
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #1a1a1a 0%, #4a4a4a 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.copilot-context-label {
  font-size: 0.73rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--copilot-accent);
  letter-spacing: 0.15em;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.copilot-status-dot {
  width: 6px;
  height: 6px;
  background: #10B981;
  border-radius: 50%;
}

.copilot-close {
  width: 36px;
  height: 36px;
  background: rgba(0,0,0,0.05);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.copilot-close:hover {
  background: rgba(0,0,0,0.1);
  transform: rotate(90deg);
}

/* Segmented Toggle Control (Premium Design) */
.copilot-tabs {
  margin: 0 32px 24px 32px;
  background: rgba(0, 0, 0, 0.04);
  padding: 4px;
  border-radius: 16px;
  display: flex;
  position: relative;
}

.copilot-tab {
  flex: 1;
  text-align: center;
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--copilot-muted);
  padding: 10px 0;
  cursor: pointer;
  position: relative;
  z-index: 1;
  transition: color 0.3s;
}

.copilot-tab.active {
  color: var(--copilot-text);
}

.copilot-tab-slider {
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(33.33% - 4px);
  height: calc(100% - 8px);
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 0;
}

/* Content Area */
.copilot-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 32px 32px 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Insight Cards (Sophisticated Detail) */
.insight-card {
  background: white;
  border-radius: 20px;
  padding: 20px;
  border: 1px solid rgba(0,0,0,0.05);
  transition: all 0.3s;
  box-shadow: 0 4px 20px rgba(0,0,0,0.02);
}

.insight-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.06);
  border-color: var(--copilot-accent);
}

.insight-tag {
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(0,0,0,0.04);
}

.insight-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--copilot-text);
  margin-bottom: 6px;
}

.insight-desc {
  font-size: 0.85rem;
  color: var(--copilot-muted);
  line-height: 1.5;
}

/* Operational Shortcuts / Chips */
.copilot-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.copilot-chip {
  background: rgba(0, 0, 0, 0.04);
  color: var(--copilot-text);
  padding: 10px 18px;
  border-radius: 99px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid transparent;
}

.copilot-chip:hover {
  background: white;
  border-color: var(--copilot-accent);
  color: var(--copilot-accent);
  box-shadow: 0 6px 20px rgba(247, 177, 89, 0.15);
  transform: translateY(-2px);
}

/* Modern "Empty State" */
.copilot-empty {
  text-align: center;
  padding-top: 60px;
}

.copilot-empty-icon {
  width: 80px;
  height: 80px;
  background: rgba(247, 177, 89, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px auto;
  color: var(--copilot-accent);
  position: relative;
}

.copilot-empty-icon::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border: 1px solid var(--copilot-accent);
  border-radius: 50%;
  animation: ripple-gold 3s infinite;
}

@keyframes ripple-gold {
  0% { transform: scale(1); opacity: 0.5; }
  100% { transform: scale(1.8); opacity: 0; }
}

/* Action Cards */
.action-card {
  background: rgba(26, 26, 26, 0.03);
  border: 1px solid transparent;
  border-radius: 20px;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s;
}

.action-card:hover {
  background: white;
  border-color: var(--copilot-accent);
  box-shadow: 0 10px 25px rgba(247, 177, 89, 0.1);
  transform: translateX(4px);
}

/* Messages */
.copilot-msg {
  background: rgba(0,0,0,0.03);
  padding: 16px 20px;
  border-radius: 20px;
  border-bottom-left-radius: 4px;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--copilot-text);
  max-width: 90%;
}

.copilot-msg strong {
  color: var(--copilot-accent);
  font-weight: 700;
}

/* Input Area (Floating) */
.copilot-input-area {
  padding: 24px 32px 40px 32px;
  background: linear-gradient(to top, var(--copilot-bg) 80%, transparent);
}

.input-glass {
  background: white;
  border: 1px solid var(--copilot-border);
  border-radius: 18px;
  padding: 8px;
  display: flex;
  gap: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.copilot-input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 10px 16px;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  outline: none;
  color: var(--copilot-text);
}

.copilot-send-btn {
  background: var(--copilot-text);
  color: white;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.copilot-send-btn:hover {
  background: #000;
  transform: scale(1.05);
}

/* Dashboard Attention Card (Luxury Polish) */
.dash-copilot-card {
  background: rgba(26, 26, 26, 0.95);
  backdrop-filter: blur(10px);
  color: white;
  padding: 32px;
  border-radius: 32px;
  box-shadow: 0 30px 60px rgba(0,0,0,0.2);
  margin-bottom: 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid rgba(255,255,255,0.1);
  position: relative;
  overflow: hidden;
}

.dash-copilot-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(247, 177, 89, 0.1) 0%, transparent 70%);
  pointer-events: none;
}

.dash-copilot-header h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 0 8px 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.dash-copilot-header .copilot-badge {
  background: var(--copilot-accent);
  color: #1a1a1a;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
