/* Threat Teaming Framework — Shared UI Components */

/* --- Utility Classes --- */
.ttf-hidden { display: none !important; }
.ttf-flex { display: flex; gap: 12px; align-items: center; }
.ttf-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.ttf-col { display: flex; flex-direction: column; gap: 8px; }

/* --- Card Styles --- */
.ttf-card { 
  background: rgba(255,255,255,0.04); 
  border-radius: 12px; 
  padding: 16px 20px;
  border: 1px solid rgba(255,255,255,0.06); 
}

/* --- Chips & Badges --- */
.ttf-chip { 
  font-size: 12px; 
  line-height: 1; 
  padding: 6px 8px; 
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.15); 
  display: inline-block;
}
.ttf-chip.exec { background: rgba(0,180,80,.15); border-color: rgba(0,180,80,.35); }
.ttf-chip.obs  { background: rgba(30,90,255,.15); border-color: rgba(30,90,255,.35); }

.ttf-badge { 
  font-size: 12px; 
  padding: 4px 8px; 
  border: 1px solid rgba(255,255,255,.15); 
  border-radius: 6px; 
}

/* --- Buttons --- */
.ttf-btn { 
  cursor: pointer; 
  padding: 8px 12px; 
  border-radius: 8px; 
  background: #f59e0b; 
  color: #000; 
  border: none; 
  font-weight: 600;
}
.ttf-btn.secondary { background: transparent; border: 1px solid rgba(255,255,255,.25); color: inherit; }
.ttf-btn.ghost { background: transparent; border: none; color: inherit; opacity: .75 }
.ttf-btn[disabled], .is-disabled { opacity: .5; pointer-events: none; }

/* Accent CTA button — amber, used for page-level Create / Refresh / Apply actions */
.btn-accent {
  background: #f59e0b;
  color: #000;
  border: none;
  padding: 10px 24px;
  border-radius: 9999px;
  font-weight: 600;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.btn-accent:hover {
  background: #d97706;
  transform: translateY(-1px);
}
.btn-accent:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* --- Typography & layout --- */
.ttf-monotext, .ttf-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; }
.ttf-hr { height: 1px; border: 0; background: rgba(255,255,255,.08); margin: 12px 0; }
.ttf-evidence { white-space: pre-wrap; border-left: 2px solid rgba(255,255,255,.15); padding-left: 10px; margin: 6px 0; }
.ttf-kv { display: grid; grid-template-columns: 140px 1fr; gap: 10px 16px; }
.ttf-copy { cursor: pointer; opacity: .8; }

/* --- Accordion --- */
details.ttf-acc summary { cursor: pointer; list-style: none; display: flex; gap: 10px; align-items: center; }
details.ttf-acc summary::-webkit-details-marker { display: none; }

.ttf-sticky { 
  position: sticky; top: 0; z-index: 50; backdrop-filter: blur(8px);
  background: linear-gradient(to bottom, rgba(22,22,29,.85), rgba(22,22,29,.50));
  border-bottom: 1px solid rgba(255,255,255,.08); margin: -8px -20px 12px; padding: 10px 20px; 
}

/* --- Tabs & Chat Styles --- */
.tabs {
    display: flex;
    gap: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 20px;
    padding-bottom: 10px;
}

.tab-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-family: 'Big Shoulders Display', sans-serif;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 5px 10px;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-btn:hover { color: #fff; }

.tab-btn.active {
    color: #f59e0b;
    border-bottom-color: #f59e0b;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

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

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

/* Embedded Chat Container */
.embedded-chat-container {
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.05);
    height: 500px;
    display: flex;
    flex-direction: column;
}

.embedded-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.embedded-chat-input {
    padding: 15px;
    background: rgba(255,255,255,0.03);
    border-top: 1px solid rgba(255,255,255,0.05);
    display: flex;
    gap: 10px;
}

.embedded-chat-input input {
    flex: 1;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 10px 15px;
    color: white;
    outline: none;
    font-family: 'Inter', sans-serif;
}

.embedded-chat-input input:focus {
    border-color: #fbbf24;
    background: rgba(0,0,0,0.5);
}

.message {
    padding: 12px 16px;
    border-radius: 8px;
    max-width: 80%;
    line-height: 1.5;
    font-size: 0.95rem;
}

.message.bot {
    background: rgba(255,255,255,0.08);
    align-self: flex-start;
    border-bottom-left-radius: 2px;
    color: #e2e8f0;
}

.message.user {
    background: rgba(245,158,11,0.15);
    color: #f59e0b;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
    margin-left: auto;
}

/* --- NEW: HUBBARD TOOLTIPS --- */
.ttf-tooltip {
  position: relative;
  cursor: help;
}

.ttf-tooltip .ttf-tooltip-text {
  visibility: hidden;
  width: 280px;
  background-color: #16161D;
  color: #fff;
  text-align: left;
  border-radius: 8px;
  padding: 16px;
  position: absolute;
  z-index: 100;
  bottom: 125%; 
  left: 50%;
  margin-left: -140px;
  opacity: 0;
  transition: opacity 0.3s;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6);
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  line-height: 1.5;
  pointer-events: none;
}

.ttf-tooltip:hover .ttf-tooltip-text {
  visibility: visible;
  opacity: 1;
}

.ttf-tooltip .ttf-tooltip-text strong {
    color: #60a5fa;
    display: block;
    margin-bottom: 8px;
    font-family: 'Big Shoulders Display';
    font-size: 1.1rem;
    letter-spacing: 0.05em;
}

.ttf-tooltip .ttf-tooltip-text hr {
    border: 0;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin: 8px 0;
}
