/* Color Variables */
:root {
  /* Brand Colors */
  --primary-orange: #FF6B35;
  --primary-dark: #2D3748;
  --accent-teal: #0D9488;
  --accent-yellow: #FBBF24;

  /* Text Colors */
  --text-dark: #1A202C;
  --text-gray: #718096;

  /* Background Colors */
  --bg-white: #FFFFFF;
  --bg-light: #F7FAFC;
  --sidebar-bg: #FFF7ED;

  /* Border Colors */
  --border-color: #E2E8F0;

  /* Button Colors */
  --button-navy: rgba(2, 10, 64, 1);
  --button-navy-hover: rgba(2, 10, 64, 0.9);

  /* Link Colors */
  --link-color: #06B6D4;
  --link-hover: #06B6D4;

  /* Tooltip Colors */
  --tooltip-bg: #1F2937;
  --tooltip-trigger: #3B82F6;
  --tooltip-trigger-hover: #2563EB;

  /* Shadows */
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
  background: var(--bg-light);
  color: var(--text-dark);
  line-height: 1.6;
  padding: 2rem;
}

/* Two Column Layout */
.page-wrapper {
  display: flex;
  gap: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* Main Content Area (75%) */
.main-content {
  flex: 3;
  background: var(--bg-white);
  border-radius: 12px;
  padding: 2.5rem;
  box-shadow: var(--shadow-md);
}

/* Sidebar (25%) */
.sidebar {
  flex: 1;
  background: var(--sidebar-bg);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary-orange);
  position: sticky;
  top: 2rem;
  height: fit-content;
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
}

.sidebar h3 {
  color: var(--primary-dark);
  font-size: 1.1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary-orange);
}

.sidebar .section {
  margin-bottom: 1.5rem;
}

.sidebar .section h4 {
  color: var(--accent-teal);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.sidebar ul {
  margin-left: 1.25rem;
  font-size: 0.875rem;
  color: var(--text-gray);
}

.sidebar li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.sidebar .note {
  background: rgba(255, 107, 53, 0.1);
  padding: 0.75rem;
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--text-dark);
  margin-top: 1rem;
}

.sidebar .note strong {
  color: var(--primary-orange);
}

/* Header */
h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary-dark);
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin: 2rem 0 1rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid var(--primary-orange);
}

p {
  font-size: 0.95rem;
  color: var(--text-dark);
  margin-bottom: 2rem;
  line-height: 1.8;
}

/* Section summary - same styling as intro but gray */
p.section-summary {
  font-size: 0.95rem;
  color: var(--text-gray);
  margin-bottom: 1rem;
  line-height: 1.8;
}

a {
  color: var(--link-color);
  text-decoration: underline;
  font-weight: 500;
  transition: opacity 0.2s ease;
}

a:hover {
  opacity: 0.8;
}

/* State Table */
#uid_state {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.875rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}

#uid_state tr {
  border-bottom: 1px solid var(--border-color);
}

#uid_state tr:nth-child(even) {
  background-color: var(--bg-light);
}

#uid_state tr:last-child {
  border-bottom: none;
}

#uid_state td {
  padding: 1rem;
  vertical-align: top;
}

.label {
  font-weight: 600;
  color: var(--text-dark);
  white-space: nowrap;
  padding-right: 2rem;
  width: 15em;
}

.value {
  color: var(--text-gray);
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
}

.value pre {
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0;
}

/* Forms */
.form {
  margin-top: 2rem;
}

.form.top-form {
  margin-top: 0;
  margin-bottom: 2rem;
}

.email_prompt {
  display: flex;
  gap: 0;
  max-width: 600px;
  box-shadow: var(--shadow);
  border-radius: 8px;
  overflow: hidden;
}

#email {
  flex: 1;
  padding: 0.875rem 1.25rem;
  border: 2px solid var(--border-color);
  border-right: none;
  font-size: 0.95rem;
  color: var(--text-dark);
  outline: none;
  transition: border-color 0.2s ease;
}

#email:focus {
  border-color: var(--primary-orange);
}

#email::placeholder {
  color: var(--text-gray);
}

/* Buttons */
.button {
  padding: 0.875rem 2rem;
  background: var(--button-navy);
  color: white;
  border: none;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-shadow: var(--shadow);
}

.button:hover {
  background: var(--button-navy-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(2, 10, 64, 0.3);
}

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

/* Full width button for logout */
#logout_form .button {
  width: 100%;
  max-width: 600px;
  border-radius: 8px;
}

/* Success Message */
.message {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(34, 197, 94, 0.05) 100%);
  border-left: 4px solid #22C55E;
  color: #15803D;
  padding: 1.25rem;
  margin: 1.5rem 0;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 6px;
}

.product-tables {
  display: flex;
  flex-direction: row;
  gap: 2rem;
  margin-top: 2rem;
}

/* Tooltip Styles - Matching Self-Serve Portal */
.tooltip-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: help;
}

.tooltip-trigger {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: var(--tooltip-trigger);
  color: white;
  border: none;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: help;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.tooltip-trigger:hover {
  background-color: var(--tooltip-trigger-hover);
  transform: scale(1.05);
}

.tooltip-content {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: calc(100% + 8px); /* Position above with gap */
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--tooltip-bg);
  color: white;
  padding: 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  line-height: 1.125; 
  min-width: 300px; 
  max-width: 570px; 
  white-space: normal;
  z-index: 10000; 
  box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
  transition: opacity 0.2s ease, visibility 0.2s ease;
  font-weight: 400;
  pointer-events: none;
}

.tooltip-content::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: #1F2937 transparent transparent transparent;
}

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

/* Ensure table doesn't clip tooltips */
#uid_state {
  position: relative;
  overflow: visible;
}

@media (max-width: 1024px) {
  .page-wrapper {
    flex-direction: column;
  }
  
  .sidebar {
    position: static;
    max-height: none;
  }
  
  body {
    padding: 1rem;
  }
  
  .main-content {
    padding: 1.5rem;
  }
  
  .email_prompt {
    flex-direction: column;
  }
  
  #email {
    border-right: 2px solid var(--border-color);
    border-bottom: none;
  }
  
  .button {
    width: 100%;
  }
}
