/*
 * PicaPica Chat Application - Main Stylesheet
 * Consolidated from inline styles across templates
 * Uses Bootstrap 5 as base framework
 */

/* ==========================================================================
   CSS CUSTOM PROPERTIES (CSS Variables) - Theme System
   ========================================================================== */

/* Default theme variables (fallbacks) */
:root {
  /* Layout and spacing (theme-independent) */
  --answer-spacing: 1.5rem;
  --conversation-max-width: 800px;
  --question-container-radius: 0.5rem;
  
  /* Default theme colors (fallback) */
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-tertiary: #f1f3f4;
  --text-primary: #212529;
  --text-secondary: #495057;
  --text-muted: #6c757d;
  --border-primary: #dee2e6;
  --border-secondary: #e9ecef;
  --shadow-color: rgba(0, 0, 0, 0.1);
  
  /* Interactive colors */
  --success-bg: rgba(25, 135, 84, 0.15);
  --warning-bg: rgba(255, 193, 7, 0.20);
  --danger-bg: rgba(220, 53, 69, 0.15);
  --neutral-bg: rgba(108, 117, 125, 0.12);
  --auth-bg: rgba(108, 117, 125, 0.20);
}

/* Original Light Theme */
:root.theme-original-light {
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-tertiary: #f1f3f4;
  --text-primary: #212529;
  --text-secondary: #495057;
  --text-muted: #6c757d;
  --border-primary: #dee2e6;
  --border-secondary: #e9ecef;
  --shadow-color: rgba(0, 0, 0, 0.1);
  
  /* Interactive colors */
  --success-bg: rgba(25, 135, 84, 0.15);
  --warning-bg: rgba(255, 193, 7, 0.20);
  --danger-bg: rgba(220, 53, 69, 0.15);
  --neutral-bg: rgba(108, 117, 125, 0.12);
  --auth-bg: rgba(108, 117, 125, 0.20);
  
  /* Derived theme-specific colors */
  --icon-hover-add-bg: var(--success-bg);
  --icon-hover-edit-bg: var(--warning-bg);
  --icon-hover-delete-bg: var(--danger-bg);
  --icon-hover-neutral-bg: var(--neutral-bg);
  --icon-hover-auth-bg: var(--auth-bg);
  
  --question-bg: var(--bg-secondary);
  --question-border: var(--border-secondary);
  --question-text: var(--text-secondary);
  --question-timestamp: var(--text-muted);
  --code-block-bg: var(--bg-tertiary);
}

/* Original Dark Theme */
:root.theme-original-dark {
  --bg-primary: #1a1a1a;
  --bg-secondary: #2d2d2d;
  --bg-tertiary: #3a3a3a;
  --text-primary: #ffffff;
  --text-secondary: #e0e0e0;
  --text-muted: #b8b8b8;
  --border-primary: #404040;
  --border-secondary: #4a4a4a;
  --shadow-color: rgba(0, 0, 0, 0.3);
  
  /* Interactive colors (adjusted for dark theme) */
  --success-bg: rgba(40, 167, 69, 0.25);
  --warning-bg: rgba(255, 193, 7, 0.25);
  --danger-bg: rgba(220, 53, 69, 0.25);
  --neutral-bg: rgba(108, 117, 125, 0.25);
  --auth-bg: rgba(108, 117, 125, 0.30);
  
  /* Derived theme-specific colors */
  --icon-hover-add-bg: var(--success-bg);
  --icon-hover-edit-bg: var(--warning-bg);
  --icon-hover-delete-bg: var(--danger-bg);
  --icon-hover-neutral-bg: var(--neutral-bg);
  --icon-hover-auth-bg: var(--auth-bg);
  
  --question-bg: var(--bg-secondary);
  --question-border: var(--border-secondary);
  --question-text: var(--text-secondary);
  --question-timestamp: var(--text-muted);
  --code-block-bg: var(--bg-tertiary);
}

/* ==========================================================================
   BASE ELEMENT STYLING
   ========================================================================== */

pre {
  background: #ddd;
  padding: 10px;
}

h2 {
  margin-top: 20px;
}

footer {
  margin: 20px;
}

/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */

.wrap-text {
  word-wrap: break-word;
}

/* ==========================================================================
   MODERN CONVERSATION INTERFACE STYLING
   ========================================================================== */

.conversation-content {
  max-width: var(--conversation-max-width);
  margin: 0 auto;
}

.question-container {
  background: var(--question-bg);
  border: 1px solid var(--question-border);
  border-radius: var(--question-container-radius);
  padding: 1rem 1.25rem;
  margin: 3.5rem 0 1rem 0;
  position: relative;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.question-content {
  color: var(--question-text);
  font-weight: 500;
  font-size: 1.05em;
  line-height: 1.5;
  margin: 0;
  word-wrap: break-word;
}

.question-timestamp {
  color: var(--question-timestamp);
  font-size: 0.8rem;
  font-weight: normal;
  margin-top: 0.75rem;
  margin-bottom: 0;
  text-align: right;
  font-style: italic;
}

.answer-container {
  margin: 0 0 var(--answer-spacing) 0;
  padding: 0;
}

.answer-content {
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 1rem;
}

.answer-content h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
  border-bottom: 2px solid var(--border-secondary);
  padding-bottom: 0.5rem;
}

.answer-content h2 {
  font-size: 1.35rem;
  font-weight: 600;
  margin-top: 1.25rem;
  margin-bottom: 0.75rem;
  color: var(--text-secondary);
}

.answer-content h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.answer-content h4,
.answer-content h5,
.answer-content h6 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 0.75rem;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
}

.answer-content p {
  margin-bottom: 1rem;
}

.answer-content ul,
.answer-content ol {
  margin-bottom: 1rem;
  padding-left: 2rem;
}

.answer-content li {
  margin-bottom: 0.25rem;
}

.answer-content pre {
  background: var(--code-block-bg);
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  padding: 1rem;
  margin: 1rem 0;
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.4;
}

.answer-content code {
  background: var(--code-block-bg);
  padding: 0.2rem 0.4rem;
  border-radius: 0.25rem;
  font-size: 0.9em;
  color: #d63384;
  border: 1px solid #dee2e6;
}

.answer-content pre code {
  background: transparent;
  padding: 0;
  border: none;
  color: inherit;
  font-size: inherit;
}

.answer-content blockquote {
  border-left: 4px solid #007bff;
  margin: 1rem 0;
  padding: 0.5rem 1rem;
  background: #f8f9fa;
  font-style: italic;
}

.answer-content table {
  width: 100%;
  margin-bottom: 1rem;
  border-collapse: collapse;
}

.answer-content th,
.answer-content td {
  padding: 0.75rem;
  border: 1px solid #dee2e6;
  text-align: left;
}

.answer-content th {
  background: #f8f9fa;
  font-weight: 600;
}

/* Enhanced textarea styling with fixed auto-expansion */
.conversation-textarea {
  min-height: calc(1.5em * 5) !important;
  resize: vertical;
  transition: height 0.1s ease-out;
}

/* ==========================================================================
   ICON BUTTON COMPONENT SYSTEM
   ========================================================================== */

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;              /* 6px gap for icon+text spacing */
  padding: 0.375rem;          /* 6px */
  border: 0;
  border-radius: 0.375rem;    /* 6px */
  background: transparent;
  color: inherit;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 120ms ease-in-out;
}

.icon-btn .lucide-icon {
  width: 1em;    /* No larger than capital letter size */
  height: 1em;
  flex: 0 0 auto;
  vertical-align: -0.125em;
}

/* Icon Button Hover States */
.icon-btn:hover { background: var(--icon-hover-neutral-bg); }
.icon-btn.is-add:hover { background: var(--icon-hover-add-bg); }
.icon-btn.is-edit:hover { background: var(--icon-hover-edit-bg); }
.icon-btn.is-delete:hover { background: var(--icon-hover-delete-bg); }
.icon-btn.is-neutral:hover { background: var(--icon-hover-neutral-bg); }
.icon-btn.is-auth:hover { background: var(--icon-hover-auth-bg); }

/* ==========================================================================
   TEMPLATE SYSTEM COMPONENTS (Chat Page)
   ========================================================================== */

.template-variable {
  background-color: #fffbf0;
  border: 1px solid #ffeaa7;
  border-radius: 4px;
  padding: 2px 6px;
  font-family: monospace;
  font-size: 0.85em;
}

.variable-info-panel {
  background-color: #e8f4fd;
  border: 1px solid #bee5eb;
  border-radius: 4px;
  padding: 8px 12px;
  margin-bottom: 12px;
}

.template-editor {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 13px;
  line-height: 1.4;
}

.preview-content {
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  max-height: 200px;
  overflow-y: auto;
  white-space: pre-wrap;
}

.template-selection-section {
  background-color: #f8f9fa;
  border-radius: 6px;
  padding: 16px;
  margin-bottom: 20px;
}

/* ==========================================================================
   CHAT CONVERSATIONS TABLE STYLING
   ========================================================================== */

.chat-conversations-table {
  display: grid;
  grid-template-columns: 
    1fr                         /* Conversation name */
    1fr                         /* Collections */
    120px                       /* Created date */
    80px;                       /* Actions */
  gap: 0.75rem;
  align-items: stretch;
  width: 100%;
  margin-bottom: 1rem;
}

.chat-conversations-table .table-header {
  font-weight: 600;
  padding: 0.75rem 0.5rem;
  border-bottom: 2px solid #dee2e6;
  background-color: #f8f9fa;
}

.chat-conversations-table .table-cell {
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid #dee2e6;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.conversation-name {
  font-weight: 600;
  color: #212529;
  text-decoration: none;
}

.conversation-name:hover {
  color: #212529;
  text-decoration: underline;
}

a.conversation-name {
  color: #212529;
}

a.conversation-name:visited {
  color: #212529;
}

.conversation-date {
  font-size: 0.85rem;
  color: #6c757d;
}

.conversation-actions {
  display: flex;
  gap: 0.25rem;
  justify-content: flex-end;
}

/* Mobile responsive behavior for chat */
@media (max-width: 768px) {
  .chat-conversations-table {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .chat-conversations-table .table-header {
    display: none; /* Hide headers on mobile */
  }
  
  .chat-conversations-table .table-cell {
    display: block;
    padding: 1rem;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  }
  
  .conversation-mobile-layout {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.75rem;
    align-items: start;
  }
  
  .conversation-mobile-content {
    min-width: 0;
  }
  
  .conversation-mobile-actions {
    flex-shrink: 0;
  }
  
  .conversation-mobile-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #6c757d;
  }
}

/* ==========================================================================
   COLLECTION DOCUMENTS TABLE STYLING
   ========================================================================== */

.collection-documents-table {
  display: grid;
  grid-template-columns: 
    minmax(150px, 1fr)          /* Document name */
    1fr                         /* Description */
    100px                       /* Status */
    120px;                      /* Actions */
  gap: 0.75rem;
  align-items: stretch;
  width: 100%;
  margin-bottom: 1rem;
}

.collection-documents-table .table-header {
  font-weight: 600;
  padding: 0.75rem 0.5rem;
  border-bottom: 2px solid #dee2e6;
  background-color: #f8f9fa;
}

.collection-documents-table .table-cell {
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid #dee2e6;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

/* Mobile responsive behavior for collection documents */
@media (max-width: 768px) {
  .collection-documents-table {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .collection-documents-table .table-header {
    display: none;
  }
  
  .collection-documents-table .table-cell {
    display: block;
    padding: 1rem;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  }
  
  .document-mobile-layout {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.75rem;
    align-items: start;
  }
  
  .document-mobile-content {
    min-width: 0;
  }
  
  .document-mobile-actions {
    flex-shrink: 0;
    display: flex;
    gap: 0.25rem;
    align-items: flex-start;
  }
  
  .document-mobile-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #6c757d;
  }
}

/* ==========================================================================
   COLLECTION CONVERSATIONS TABLE STYLING
   ========================================================================== */

.collection-conversations-table {
  display: grid;
  grid-template-columns: 
    minmax(150px, 1fr)          /* Conversation name - matches Document column */
    1fr                         /* Collections - matches Description column */
    120px;                      /* Last updated */
  gap: 0.75rem;
  align-items: stretch;
  width: 100%;
  margin-bottom: 1rem;
}

.collection-conversations-table .table-header {
  font-weight: 600;
  padding: 0.75rem 0.5rem;
  border-bottom: 2px solid #dee2e6;
  background-color: #f8f9fa;
}

.collection-conversations-table .table-cell {
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid #dee2e6;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

/* Mobile responsive behavior for collection conversations */
@media (max-width: 768px) {
  .collection-conversations-table {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .collection-conversations-table .table-header {
    display: none;
  }
  
  .collection-conversations-table .table-cell {
    display: block;
    padding: 1rem;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  }
  
  .conversation-mobile-layout {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.75rem;
    align-items: start;
  }
  
  .conversation-mobile-content {
    min-width: 0;
  }
  
  .conversation-mobile-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #6c757d;
  }
}

/* ==========================================================================
   LIBRARY COLLECTIONS TABLE STYLING
   ========================================================================== */

.library-collections-table {
  display: grid;
  grid-template-columns: 
    minmax(120px, max-content)  /* Collection name */
    1fr                         /* Description */
    1fr                         /* Tags */
    60px                        /* Documents count */
    120px                       /* Last updated */
    80px;                       /* Actions */
  gap: 0.75rem;
  align-items: stretch;        /* Changed from 'start' to 'stretch' for consistent row heights */
  width: 100%;
  margin-bottom: 1rem;
}

.library-collections-table .table-header {
  font-weight: 600;
  padding: 0.75rem 0.5rem;
  border-bottom: 2px solid #dee2e6;
  background-color: #f8f9fa;
}

.library-collections-table .table-cell {
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid #dee2e6;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;  /* Align content to top of stretched cell */
}

.collection-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.collection-tag {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  background-color: #f8f9fa;
  color: #212529;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: capitalize;
  white-space: nowrap;
  border: 1px solid #e9ecef;
  transition: all 0.15s ease-in-out;
  line-height: 1.2;
}

.collection-tag:hover {
  background-color: #e9ecef;
  border-color: #adb5bd;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Tag variations for different contexts */
.collection-tag.tag-primary {
  background-color: #cfe2ff;
  color: #084298;
  border-color: #b6d4fe;
}

.collection-tag.tag-secondary {
  background-color: #f8f9fa;
  color: #495057;
  border-color: #dee2e6;
}

.collection-tag.tag-success {
  background-color: #d1e7dd;
  color: #0f5132;
  border-color: #badbcc;
}

/* Enhanced spacing for multiple tags */
.collection-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  align-items: center;
}

/* Special styling for conversation context */
.conversation-tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: baseline;
}

.conversation-tags .collection-tag {
  font-size: 0.7rem;
  padding: 0.2rem 0.4rem;
  margin: 0;
}

.collection-description {
  font-size: 0.9rem;
  line-height: 1.4;
  color: #495057;
}

.collection-name {
  font-weight: 600;
  color: #212529;
  text-decoration: none;
}

.collection-name:hover {
  color: #212529;
  text-decoration: underline;
}

a.collection-name {
  color: #212529;
}

a.collection-name:visited {
  color: #212529;
}

/* Mobile responsive behavior */
@media (max-width: 768px) {
  .library-collections-table {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .library-collections-table .table-header {
    display: none; /* Hide headers on mobile */
  }
  
  .library-collections-table .table-cell {
    display: block;
    padding: 1rem;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  }
  
  .collection-mobile-layout {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.75rem;
    align-items: start;
  }
  
  .collection-mobile-content {
    min-width: 0;
  }
  
  .collection-mobile-actions {
    flex-shrink: 0;
  }
  
  .collection-mobile-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #6c757d;
  }
}

/* ==========================================================================
   EMBED MODAL LAYOUT IMPROVEMENTS
   ========================================================================== */

/* Embed Modal Tab Navigation */
.embed-tabs {
  border-bottom: 2px solid var(--border-primary);
  margin-bottom: 1.5rem;
  background: var(--bg-secondary);
  border-radius: 0.5rem 0.5rem 0 0;
  padding: 0.5rem 0.5rem 0 0.5rem;
}

.embed-tabs .nav-link {
  border: none;
  border-radius: 0.375rem;
  padding: 0.75rem 1.5rem;
  margin-right: 0.25rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  transition: all 0.2s ease;
  border-bottom: 3px solid transparent;
}

.embed-tabs .nav-link:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-bottom-color: var(--border-secondary);
}

.embed-tabs .nav-link.active {
  background: var(--bg-primary);
  color: var(--text-primary);
  border-bottom: 3px solid var(--border-primary);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Embed Tab Content */
.embed-tab-content {
  background: var(--bg-primary);
  border-radius: 0 0 0.5rem 0.5rem;
  padding: 1.5rem;
  border: 1px solid var(--border-primary);
  border-top: none;
  min-height: 400px;
}

.embed-tab-pane {
  display: none;
}

.embed-tab-pane.active {
  display: block;
  animation: fadeIn 0.3s ease-in;
}

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

/* Embed Modal Layout Grid */
.embed-modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.embed-modal-section {
  background: var(--bg-secondary);
  border-radius: 0.5rem;
  padding: 1.5rem;
  border: 1px solid var(--border-secondary);
}

.embed-modal-section h6 {
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.embed-modal-section h6 i {
  color: var(--text-muted);
  font-size: 1rem;
}

/* Collapsible Sections */
.embed-collapse {
  margin-bottom: 1rem;
}

.embed-collapse-header {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-secondary);
  border-radius: 0.375rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
}

.embed-collapse-header:hover {
  background: var(--bg-secondary);
  border-color: var(--border-primary);
}

.embed-collapse-header h6 {
  margin: 0;
  font-weight: 500;
  color: var(--text-primary);
}

.embed-collapse-icon {
  transition: transform 0.2s ease;
  color: var(--text-muted);
}

.embed-collapse-header.collapsed .embed-collapse-icon {
  transform: rotate(-90deg);
}

.embed-collapse-content {
  background: var(--bg-primary);
  border: 1px solid var(--border-secondary);
  border-top: none;
  border-radius: 0 0 0.375rem 0.375rem;
  padding: 1rem;
}

/* Form Controls */
.embed-form-control {
  background: var(--bg-primary);
  border: 1px solid var(--border-secondary);
  border-radius: 0.375rem;
  padding: 0.75rem;
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.embed-form-control:focus {
  background: var(--bg-primary);
  border-color: var(--border-primary);
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
  color: var(--text-primary);
}

.embed-form-control::placeholder {
  color: var(--text-muted);
}

/* Code Blocks */
.embed-code-block {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-secondary);
  border-radius: 0.375rem;
  padding: 1rem;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.875rem;
  color: var(--text-primary);
  position: relative;
  overflow-x: auto;
}

.embed-code-block pre {
  margin: 0;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.embed-copy-button {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-secondary);
  border-radius: 0.25rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.embed-copy-button:hover {
  background: var(--bg-primary);
  color: var(--text-primary);
  border-color: var(--border-primary);
}

/* Status Indicators */
.embed-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.embed-status.active {
  background: var(--success-bg);
  color: #198754;
}

.embed-status.inactive {
  background: var(--neutral-bg);
  color: var(--text-muted);
}

.embed-status.error {
  background: var(--danger-bg);
  color: #dc3545;
}

/* Usage Statistics */
.embed-usage-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.embed-stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-secondary);
  border-radius: 0.375rem;
  padding: 1rem;
  text-align: center;
}

.embed-stat-value {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.embed-stat-label {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Responsive Design */
@media (max-width: 992px) {
  .embed-modal-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .embed-tabs .nav-link {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }
}

@media (max-width: 768px) {
  .embed-tab-content {
    padding: 1rem;
  }
  
  .embed-modal-section {
    padding: 1rem;
  }
  
  .embed-tabs .nav-link {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    margin-right: 0.125rem;
  }
  
  .embed-usage-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 576px) {
  .embed-tabs {
    padding: 0.25rem 0.25rem 0 0.25rem;
  }
  
  .embed-tabs .nav-link {
    padding: 0.375rem 0.5rem;
    font-size: 0.75rem;
    margin-right: 0.0625rem;
  }
  
  .embed-tab-content {
    padding: 0.75rem;
    min-height: 300px;
  }
  
  .embed-modal-section {
    padding: 0.75rem;
  }
  
  .embed-usage-stats {
    grid-template-columns: 1fr;
  }
  
  .embed-code-block {
    font-size: 0.75rem;
    padding: 0.75rem;
  }
}

/* Dark Theme Support */
:root.theme-original-dark .embed-tabs {
  background: var(--bg-secondary);
  border-bottom-color: var(--border-primary);
}

:root.theme-original-dark .embed-code-block {
  background: #2d3748;
  border-color: var(--border-primary);
}

:root.theme-original-dark .embed-copy-button {
  background: #4a5568;
  border-color: var(--border-primary);
  color: var(--text-secondary);
}

:root.theme-original-dark .embed-copy-button:hover {
  background: #718096;
  color: var(--text-primary);
}

/* Animation Classes */
.embed-fade-in {
  animation: fadeIn 0.3s ease-in;
}

.embed-slide-up {
  animation: slideUp 0.3s ease-out;
}

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

/* Loading States */
.embed-loading {
  position: relative;
  overflow: hidden;
}

.embed-loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Tab content alias for compatibility */
.tab-content { }

/* Additional Embed Modal Styles */
.embed-modal-card {
  background: var(--bg-primary, #fff);
  border: 1px solid var(--border-secondary, #dee2e6);
  border-radius: 0.375rem;
}

.embed-modal-card .card-header {
  background: var(--bg-secondary, #f8f9fa);
  border-bottom: 1px solid var(--border-secondary, #dee2e6);
  padding: 0.75rem 1rem;
  border-radius: 0.375rem 0.375rem 0 0;
}

.embed-modal-card .card-body {
  padding: 1rem;
}

.embed-action-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.embed-code-container {
  margin-bottom: 0;
}

.embed-code-label {
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--text-secondary, #6c757d);
  margin-bottom: 0.5rem;
  display: block;
}

.embed-domain-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  background: var(--bg-secondary, #f8f9fa);
  border: 1px solid var(--border-secondary, #dee2e6);
  border-radius: 0.375rem;
  margin: 0.25rem;
  font-size: 0.875rem;
}

.embed-domain-badge .btn-close {
  opacity: 0.5;
  font-size: 0.75rem;
  width: 0.75em;
  height: 0.75em;
}

.embed-domain-badge .btn-close:hover {
  opacity: 1;
}

.embed-modal-tabs .nav-link {
  color: var(--text-secondary, #6c757d);
  border: none;
  border-bottom: 3px solid transparent;
  padding: 0.75rem 1.5rem;
}

.embed-modal-tabs .nav-link:hover {
  border-bottom-color: var(--border-secondary, #dee2e6);
}

.embed-modal-tabs .nav-link.active {
  color: var(--primary, #0d6efd);
  border-bottom-color: var(--primary, #0d6efd);
  background: transparent;
}

.embed-modal-tab-content {
  padding: 1.5rem 0;
}

.embed-collapse-section {
  margin-bottom: 1rem;
}

/* ==========================================================================
   FEATURE GATING STYLES - Subscription-based Feature Access
   ========================================================================== */

/* Disabled feature links and buttons */
.feature-disabled {
  opacity: 0.5;
  cursor: not-allowed !important;
  pointer-events: none;
}

.feature-locked {
  opacity: 0.6;
  cursor: pointer;
  position: relative;
}

/* Feature badges */
.feature-badge {
  font-size: 0.65rem;
  padding: 0.2rem 0.4rem;
  margin-left: 0.5rem;
  border-radius: 0.25rem;
  font-weight: 600;
  text-transform: uppercase;
}

.feature-badge-pro {
  background-color: var(--bs-warning, #ffc107);
  color: var(--bs-dark, #212529);
}

.feature-badge-team {
  background-color: var(--bs-info, #0dcaf0);
  color: var(--bs-dark, #212529);
}

.feature-badge-enterprise {
  background-color: var(--bs-primary, #0d6efd);
  color: var(--bs-white, #ffffff);
}

/* Lock icon for disabled features */
.feature-locked::after {
  content: '\1F512'; /* Lock emoji */
  margin-left: 0.5rem;
  opacity: 0.7;
  font-size: 0.875em;
}

/* Disabled feature hover state */
.feature-locked:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* Theme-specific disabled state colors for Bootstrap themes */
[data-bs-theme="light"] .feature-disabled {
  color: #6c757d;
}

[data-bs-theme="dark"] .feature-disabled {
  color: #adb5bd;
}

/* Theme-specific disabled state colors for Solarized themes */
[data-theme="solarized-light"] .feature-disabled {
  color: #93a1a1;
}

[data-theme="solarized-dark"] .feature-disabled {
  color: #657b83;
}

/* Upgrade prompt overlay */
.upgrade-prompt {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  max-width: 320px;
  padding: 1rem;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 1050;
  animation: slideInUp 0.3s ease-out;
}

[data-bs-theme="light"] .upgrade-prompt {
  background-color: #fff;
  border: 1px solid #dee2e6;
}

[data-bs-theme="dark"] .upgrade-prompt {
  background-color: #212529;
  border: 1px solid #495057;
}

[data-theme="solarized-light"] .upgrade-prompt {
  background-color: #fdf6e3;
  border: 1px solid #eee8d5;
}

[data-theme="solarized-dark"] .upgrade-prompt {
  background-color: #002b36;
  border: 1px solid #073642;
}

@keyframes slideInUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ==========================================================================
   INVITE CODE INPUT - Subscription Page
   ========================================================================== */

/* Uppercase transformation for invite code input */
.invite-code-input {
  text-transform: uppercase;
}

/* Account name edit input group */
.account-name-input-group {
  max-width: 400px;
}

/* Borderless button - removes border but keeps hover fill effect */
.btn-borderless {
  border-color: transparent !important;
}

/* ==========================================================================
   MEMBERS LIST - Subscription Page
   ========================================================================== */

/* Default light theme */
.list-group-item {
  background-color: var(--bg-primary);
  border-color: var(--border-primary);
  color: var(--text-primary);
}

.list-group-item strong {
  color: var(--text-primary);
}

.list-group-item .text-muted {
  color: var(--text-muted) !important;
}

/* Bootstrap dark theme */
[data-bs-theme="dark"] .list-group-item {
  background-color: #2d2d2d;
  border-color: #404040;
  color: #ffffff;
}

[data-bs-theme="dark"] .list-group-item strong {
  color: #ffffff;
}

[data-bs-theme="dark"] .list-group-item .text-muted {
  color: #b8b8b8 !important;
}

/* Solarized Light theme */
[data-theme="solarized-light"] .list-group-item {
  background-color: #fdf6e3;
  border-color: #eee8d5;
  color: #657b83;
}

[data-theme="solarized-light"] .list-group-item strong {
  color: #586e75;
}

[data-theme="solarized-light"] .list-group-item .text-muted {
  color: #93a1a1 !important;
}

/* Solarized Dark theme */
[data-theme="solarized-dark"] .list-group-item {
  background-color: #002b36;
  border-color: #073642;
  color: #839496;
}

[data-theme="solarized-dark"] .list-group-item strong {
  color: #93a1a1;
}

[data-theme="solarized-dark"] .list-group-item .text-muted {
  color: #657b83 !important;
}
