:root {
  --bg-dark: #0f172a;
  --bg-card: rgba(30, 41, 59, 0.7);
  --accent-primary: #38bdf8;
  --accent-secondary: #818cf8;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --border-color: rgba(255, 255, 255, 0.1);
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --tooltip-bg: #1e293b;
  --slack-bg: #1a1d21;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: radial-gradient(circle at top right, #1e293b, #0f172a);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

.studio-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 1.5rem;
  gap: 1.5rem;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  width: 2.5rem;
  height: 2.5rem;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.25rem;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.3);
}

h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  background: linear-gradient(to right, #fff, var(--text-muted));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.main-layout {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 1.5rem;
  flex: 1;
  min-height: 0;
}

.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  box-shadow: var(--glass-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-title {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.viz-container {
  flex: 1;
  background: #000;
  position: relative;
}

/* Placeholder for Tableau */
.tableau-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.actions-area {
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.action-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 1rem;
  transition: all 0.2s ease;
  /* Allow cards to expand naturally so both the title and description are fully visible */
  position: relative;
  overflow: visible;
  display: flex;
  flex-direction: column;
}

.action-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.action-type {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 1rem;
  margin-bottom: 0.5rem;
  display: inline-block;
}

.type-slack {
  background: rgba(74, 21, 75, 0.3);
  color: #e01e5a;
  border: 1px solid rgba(224, 30, 90, 0.2);
}

.type-sf {
  background: rgba(0, 161, 224, 0.1);
  color: #00a1e0;
  border: 1px solid rgba(0, 161, 224, 0.2);
}

.action-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.action-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.btn {
  cursor: pointer;
  border: none;
  border-radius: 0.5rem;
  padding: 0.6rem 1rem;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-primary {
  background: linear-gradient(to bottom right, var(--accent-primary), var(--accent-secondary));
  color: white;
}

.btn-primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.4);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--text-muted);
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.8125rem;
}

.system-status {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.play-select {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  color: var(--text-main);
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
}

.play-select:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--text-muted);
}

.play-select:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.play-select option {
  background-color: var(--bg-dark);
  color: var(--text-main);
}

.actions-footer {
  margin-top: auto;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.status-badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: 1rem;
  font-weight: 600;
}

.status-online {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.status-offline {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.action-card {
  animation: fadeIn 0.4s ease-out forwards;
}

/* Impact Dashboard Styles */
.impact-dashboard {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  box-shadow: var(--glass-shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.impact-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.impact-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.impact-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 1.25rem;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.impact-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  opacity: 0;
  transition: opacity 0.2s ease;
}

.impact-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.impact-card:hover::before {
  opacity: 1;
}

.impact-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.impact-value {
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.25rem;
  line-height: 1.2;
}

.impact-sublabel {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .impact-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .impact-value {
    font-size: 1.5rem;
  }
}

/* Tooltip & Slack Preview Styles (Instructions 56) */
.slack-preview {
  margin-top: 0.75rem;
  background: var(--slack-bg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 10px;
  font-size: 0.85rem;
  font-family: 'Lato', sans-serif;
  display: none;
  /* Hidden by default */
  animation: fadeIn 0.2s ease-out;
}

.slack-preview.visible {
  display: block;
}

.slack-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-weight: 700;
  color: #fff;
  font-size: 0.9rem;
}

.slack-header img {
  width: 16px;
  height: 16px;
  border-radius: 3px;
}

.slack-btn-mock {
  background: #007a5a;
  color: white;
  border: none;
  padding: 4px 12px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.75rem;
  cursor: default;
  margin-top: 6px;
  display: inline-block;
}

.slack-btn-mock.danger {
  background: #e01e5a;
  margin-left: 6px;
}

.preview-toggle {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 4px;
  transition: all 0.2s;
}

.preview-toggle:hover {
  color: var(--text-main);
  border-color: var(--text-main);
}

/* Tooltip styles */
[data-tooltip] {
  position: relative;
  cursor: help;
}

[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 110%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--tooltip-bg);
  color: var(--text-main);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  z-index: 100;
}

[data-tooltip]:hover::before {
  opacity: 1;
}

/* Toast Notification */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--success);
  color: var(--success);
  padding: 12px 24px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideUp 0.3s ease-out;
  margin-top: 10px;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}