/* =========================================================================
   CuratedAI - Unified Application Styles
   ========================================================================= */

/* -------------------------------------------------------------------------
   DARK MODE VARIABLES
   ------------------------------------------------------------------------- */
:root {
  /* Light mode colors */
  --bg-primary: #F8F7F4;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f9fafb;
  --bg-accent: #f3f4f6;
  
  --text-primary: #6B7280;
  --text-secondary: #4b5563;
  --text-tertiary: #9ca3af;
  --text-inverse: #ffffff;
  
  --border-primary: #e5e7eb;
  --border-secondary: #d1d5db;
  --border-accent: #9ca3af;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  
  /* Brand colors remain consistent */
  --brand-primary: #F59E0B;
  --brand-secondary: #6B7280;
  --brand-accent: #9CA3AF;
  
  /* Status colors */
  --success-bg: #d1fae5;
  --success-text: #047857;
  --success-border: #a7f3d0;
  
  --warning-bg: #fef3c7;
  --warning-text: #92400e;
  --warning-border: #fde68a;
  
  --error-bg: #fee2e2;
  --error-text: #dc2626;
  --error-border: #fecaca;
  
  --info-bg: #dbeafe;
  --info-text: #1e40af;
  --info-border: #93c5fd;
}

/* Dark mode colors */
[data-theme="dark"] {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --bg-accent: #475569;

  --text-primary: #e2e8f0;
  --text-secondary: #cbd5e1;
  --text-tertiary: #94a3b8;
  --text-inverse: #0f172a;

  --border-primary: #475569;
  --border-secondary: #64748b;
  --border-accent: #94a3b8;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.4);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.5);

  /* Adjusted status colors for dark mode */
  --success-bg: #064e3b;
  --success-text: #6ee7b7;
  --success-border: #047857;

  --warning-bg: #78350f;
  --warning-text: #fbbf24;
  --warning-border: #d97706;

  --error-bg: #7f1d1d;
  --error-text: #f87171;
  --error-border: #dc2626;

  --info-bg: #1e3a8a;
  --info-text: #60a5fa;
  --info-border: #2563eb;
}

/* -------------------------------------------------------------------------
   SPACE THEME - Landing Page Cosmic Design
   ------------------------------------------------------------------------- */
.space-theme {
  /* Deep space backgrounds */
  --bg-primary: #0a0e17;
  --bg-secondary: #0f1729;
  --bg-tertiary: #151d2e;
  --bg-accent: #1a2540;

  /* Cosmic text colors */
  --text-primary: #e2e8f0;
  --text-secondary: #cbd5e1;
  --text-tertiary: #94a3b8;
  --text-inverse: #0a0e17;

  /* Space borders */
  --border-primary: #1e3a5f;
  --border-secondary: #2d4a6f;
  --border-accent: #3d5a8f;

  /* Cosmic accent colors */
  --cosmic-purple: #4c1d95;
  --cosmic-blue: #1e40af;
  --nebula-pink: #7c3aed;
  --star-white: #f0f9ff;

  /* Brand colors remain */
  --brand-primary: #F59E0B;
  --brand-secondary: #fbbf24;

  /* Enhanced shadows for depth */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 0 20px rgba(245, 158, 11, 0.3);
}

/* Space Background with Gradient */
.space-theme body {
  background: linear-gradient(135deg,
    #0a0e17 0%,
    #0f1729 25%,
    #151d2e 50%,
    #1a1f3a 75%,
    #0a0e17 100%
  );
  background-attachment: fixed;
  min-height: 100vh;
}

/* Animated Star Field Overlay */
.space-theme body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    radial-gradient(2px 2px at 20px 30px, #f0f9ff, transparent),
    radial-gradient(2px 2px at 40px 70px, rgba(240, 249, 255, 0.8), transparent),
    radial-gradient(1px 1px at 90px 40px, #f0f9ff, transparent),
    radial-gradient(2px 2px at 160px 120px, rgba(240, 249, 255, 0.7), transparent),
    radial-gradient(1px 1px at 230px 80px, #f0f9ff, transparent),
    radial-gradient(2px 2px at 300px 200px, rgba(240, 249, 255, 0.6), transparent),
    radial-gradient(1px 1px at 350px 150px, #f0f9ff, transparent),
    radial-gradient(1px 1px at 400px 250px, rgba(240, 249, 255, 0.9), transparent),
    radial-gradient(1px 1px at 450px 50px, #f0f9ff, transparent),
    radial-gradient(2px 2px at 500px 180px, rgba(240, 249, 255, 0.7), transparent),
    radial-gradient(1px 1px at 80px 200px, #f0f9ff, transparent),
    radial-gradient(1px 1px at 180px 280px, rgba(240, 249, 255, 0.6), transparent),
    radial-gradient(2px 2px at 280px 350px, #f0f9ff, transparent),
    radial-gradient(1px 1px at 380px 400px, rgba(240, 249, 255, 0.8), transparent),
    radial-gradient(1px 1px at 480px 320px, #f0f9ff, transparent);
  background-size: 500px 500px;
  pointer-events: none;
  z-index: 0;
  animation: starTwinkle 8s ease-in-out infinite;
}

@keyframes starTwinkle {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* Subtle Nebula Gradient Overlay */
.space-theme body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 20% 30%, rgba(76, 29, 149, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 70%, rgba(30, 64, 175, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 90%, rgba(124, 58, 237, 0.08) 0%, transparent 40%);
  pointer-events: none;
  z-index: 0;
}

/* Ensure content is above star field */
.space-theme main,
.space-theme header,
.space-theme footer,
.space-theme section {
  position: relative;
  z-index: 1;
}

/* Reduced motion accessibility */
@media (prefers-reduced-motion: reduce) {
  .space-theme body::before {
    animation: none;
    opacity: 0.8;
  }
}

/* Header transparency for space theme */
.space-theme header {
  background: rgba(10, 14, 23, 0.85);
  backdrop-filter: blur(10px);
}

/* Glowing amber accents on dark backgrounds */
.space-theme .bg-amber-500 {
  box-shadow: var(--shadow-glow);
  transition: all 0.3s ease;
}

.space-theme .bg-amber-500:hover {
  box-shadow: 0 0 30px rgba(245, 158, 11, 0.5);
}

/* Form inputs on dark background */
.space-theme input[type="email"],
.space-theme input[type="text"],
.space-theme select {
  background-color: var(--bg-tertiary) !important;
  border-color: var(--border-secondary) !important;
  color: var(--text-primary) !important;
}

.space-theme input::placeholder {
  color: var(--text-tertiary) !important;
}

.space-theme input:focus,
.space-theme select:focus {
  border-color: var(--brand-primary) !important;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2) !important;
}

/* Feature cards for dark theme */
.space-theme .feature-card {
  background: linear-gradient(145deg, var(--bg-tertiary), var(--bg-secondary));
  border: 1px solid var(--border-primary);
  border-radius: 1rem;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.space-theme .feature-card:hover {
  border-color: var(--brand-primary);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.15);
  transform: translateY(-4px);
}

/* Section backgrounds with visual separation */
.space-theme .section-dark {
  background: rgba(15, 23, 41, 0.6);
}

.space-theme .section-darker {
  background: rgba(10, 14, 23, 0.8);
}

/* White card backgrounds override for space theme */
.space-theme .bg-white {
  background-color: var(--bg-secondary) !important;
}

.space-theme .bg-gray-50 {
  background-color: var(--bg-tertiary) !important;
}

/* Border color overrides */
.space-theme .border-gray-200,
.space-theme .border-gray-300 {
  border-color: var(--border-primary) !important;
}

/* Text color overrides for space theme */
.space-theme .text-gray-600 {
  color: var(--text-tertiary) !important;
}

.space-theme .text-gray-700 {
  color: var(--text-secondary) !important;
}

.space-theme .text-gray-800 {
  color: var(--text-primary) !important;
}

.space-theme .text-gray-900 {
  color: var(--text-primary) !important;
}

/* Hexagon chart updates for space theme */
.space-theme .hexagon-grid {
  stroke: var(--border-secondary);
}

.space-theme .hexagon-axis {
  stroke: var(--border-primary);
}

.space-theme .hexagon-data {
  fill: rgba(245, 158, 11, 0.25);
  stroke: var(--brand-primary);
  stroke-width: 2.5;
}

.space-theme .hexagon-label {
  fill: var(--text-secondary);
}

.space-theme .hexagon-value {
  fill: var(--brand-primary);
}

/* Comparison section space styling */
.space-theme .cycle-item {
  background: var(--bg-tertiary);
}

/* cycle-path border color is set via Tailwind classes in HTML */

/* Language selector dark theme */
.space-theme #language-selector {
  background-color: var(--bg-tertiary);
  border-color: var(--border-secondary);
  color: var(--text-primary);
}

/* Footer styling for space theme */
.space-theme footer {
  background: rgba(10, 14, 23, 0.9);
}

.space-theme footer .text-gray-500 {
  color: var(--text-tertiary) !important;
}

/* -------------------------------------------------------------------------
   BASE & TYPOGRAPHY
   ------------------------------------------------------------------------- */
body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.font-poppins {
    font-family: 'Poppins', sans-serif;
}

h1, h2 {
    margin-bottom: 2rem;
    color: var(--text-secondary);
}

h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-accent);
    padding-bottom: 0.75rem;
    color: var(--text-secondary);
}

h4 {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.page-title {
    margin-bottom: 2rem;
}

/* -------------------------------------------------------------------------
   ANIMATIONS
   ------------------------------------------------------------------------- */
.fade-in {
    animation: fadeIn 0.6s ease-in-out forwards;
}

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

/* -------------------------------------------------------------------------
   LAYOUT & CONTAINERS
   ------------------------------------------------------------------------- */
.container-grid { 
    display: grid; 
    grid-template-columns: 1fr;
    gap: 2rem; 
}

@media (min-width: 992px) {
    .container-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.card {
    background-color: var(--bg-secondary);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-accent);
}

.section-divider {
    margin: 2rem 0;
    border: 0;
    border-top: 1px solid var(--border-accent);
}

/* -------------------------------------------------------------------------
   NAVIGATION & LANGUAGE DROPDOWN
   ------------------------------------------------------------------------- */
.language-dropdown {
    position: relative;
    display: inline-block;
}

.language-dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: var(--bg-secondary);
    min-width: 160px;
    box-shadow: var(--shadow-lg);
    z-index: 50;
    border-radius: 0.5rem;
    border: 1px solid var(--border-primary);
    margin-top: 0.25rem;
}

.language-dropdown:hover .language-dropdown-content {
    display: block;
}

.language-dropdown-content a {
    color: var(--text-secondary) !important;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 0.875rem;
    transition: background-color 0.15s ease-in-out;
}

.language-dropdown-content a:hover {
    background-color: var(--bg-accent);
}

.language-dropdown-content a:first-child {
    border-radius: 0.5rem 0.5rem 0 0;
}

.language-dropdown-content a:last-child {
    border-radius: 0 0 0.5rem 0.5rem;
}

/* Navigation text colors for dark mode compatibility */
nav .text-gray-700,
nav button.text-gray-700,
nav a.text-gray-700 {
    color: var(--text-secondary) !important;
}

nav .hover\:bg-gray-100:hover {
    background-color: var(--bg-accent) !important;
}

/* -------------------------------------------------------------------------
   BUTTONS & FORM ELEMENTS
   ------------------------------------------------------------------------- */
.btn {
    display: inline-block;
    font-weight: 600;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    border: 1px solid transparent;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border-radius: 5px;
    transition: all .15s ease-in-out;
    text-decoration: none;
}

.btn-primary {
    color: var(--text-inverse);
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
}

.btn-primary:hover {
    background-color: #d97706;
    border-color: #d97706;
    text-decoration: none;
}

.back-link {
    display: inline-block;
    margin-bottom: 1.5rem;
    color: var(--brand-primary);
    text-decoration: none;
    font-weight: 500;
}

.back-link:hover {
    text-decoration: underline;
}

/* -------------------------------------------------------------------------
   FORMS
   ------------------------------------------------------------------------- */
.form-group { 
    margin-bottom: 1.25rem; 
}

.form-group label { 
    display: block; 
    margin-bottom: 0.5rem; 
    font-weight: 500;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    box-sizing: border-box;
    border: 1px solid var(--border-accent);
    border-radius: 4px;
    background-color: var(--bg-accent);
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
    font-size: 1rem;
    color: var(--text-primary);
}

.form-control:focus {
    border-color: var(--brand-primary);
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(245, 158, 11, 0.25);
}

/* -------------------------------------------------------------------------
   RANGE SLIDERS
   ------------------------------------------------------------------------- */
input[type=range] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: var(--border-accent);
    outline: none;
    opacity: 0.7;
    transition: opacity .2s;
    border-radius: 5px;
}

input[type=range]:hover {
    opacity: 1;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--brand-primary);
    cursor: pointer;
    border-radius: 50%;
}

input[type=range]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--brand-primary);
    cursor: pointer;
    border-radius: 50%;
}

/* -------------------------------------------------------------------------
   TOOLTIPS
   ------------------------------------------------------------------------- */
.tooltip-container {
    position: relative;
    display: inline-block;
}

.tooltip-text {
    visibility: hidden;
    width: 220px;
    background-color: var(--text-secondary);
    color: var(--text-inverse);
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -110px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.8rem;
    font-weight: normal;
}

.tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--text-secondary) transparent transparent transparent;
}

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

/* -------------------------------------------------------------------------
   BADGES & STATUS INDICATORS
   ------------------------------------------------------------------------- */
.badge {
    padding: 0.25em 0.6em;
    font-size: 0.8em;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
}

.badge.active {
    color: #065f46;
    background-color: #d1fae5;
}

.badge.config-version {
    color: #1e40af;
    background-color: #dbeafe;
}

/* -------------------------------------------------------------------------
   ALERTS & MESSAGES
   ------------------------------------------------------------------------- */
.alert {
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    position: relative;
}

.alert-success {
    color: var(--success-text);
    background-color: var(--success-bg);
    border-color: var(--success-border);
}

.alert-error,
.alert-danger {
    color: var(--error-text);
    background-color: var(--error-bg);
    border-color: var(--error-border);
}

.alert-warning {
    color: var(--warning-text);
    background-color: var(--warning-bg);
    border-color: var(--warning-border);
}

.alert-info {
    color: var(--info-text);
    background-color: var(--info-bg);
    border-color: var(--info-border);
}

.alert-dismissible {
    padding-right: 3rem;
}

.btn-close {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
    padding: 0.75rem;
    background: transparent;
    border: 0;
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1;
    color: var(--text-secondary);
    cursor: pointer;
}

.btn-close:hover {
    color: var(--text-primary);
}

/* -------------------------------------------------------------------------
   TIMESTAMPS
   ------------------------------------------------------------------------- */
.timestamp {
    color: var(--text-tertiary);
    font-size: 0.85em;
}

.chat-timestamp {
    display: block;
    text-align: right;
    font-size: 0.7rem;
    margin-top: 0.5rem;
    color: #6B7280;
    opacity: 0.8;
}

/* -------------------------------------------------------------------------
   HISTORY & LOG DISPLAYS
   ------------------------------------------------------------------------- */
.history-list, .chat-log-display { 
    max-height: 400px; 
    overflow-y: auto; 
    padding-right: 10px;
}

.history-item, .log-entry { 
    padding: 1rem; 
    border-bottom: 1px solid #9CA3AF; 
}

.history-item:last-child, .log-entry:last-child {
    border-bottom: none;
}

.history-item-header, .log-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.chat-history-section { 
    max-height: 85vh; 
    display: flex; 
    flex-direction: column; 
}

.log-entry p { 
    margin: 0.25rem 0; 
}

.empty-state {
    color: #9CA3AF;
    text-align: center;
    padding: 2rem;
}

/* -------------------------------------------------------------------------
   CODE & DETAILS
   ------------------------------------------------------------------------- */
details > summary {
    cursor: pointer;
    font-weight: 500;
    color: #F59E0B;
    margin-top: 0.5rem;
}

details > summary:hover {
    text-decoration: underline;
}

pre { 
    white-space: pre-wrap; 
    background-color: #f8f9fa; 
    padding: 1rem; 
    border-radius: 4px; 
    font-size: 0.85em; 
    margin-top: 0.75rem;
    border: 1px solid #9CA3AF;
    overflow-x: auto;
}

/* -------------------------------------------------------------------------
   CHAT INTERFACE
   ------------------------------------------------------------------------- */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 70vh;
    border: 1px solid var(--border-accent);
    border-radius: 8px;
    background-color: var(--bg-secondary);
}

.chat-log {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem;
    background: var(--bg-accent);
}

.chat-log-container {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-accent);
    border-radius: 0.5rem;
}

/* Chat Messages */
.message {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 15px;
    max-width: 75%;
    line-height: 1.4;
}

.message p {
    margin: 0;
}

.user-message {
    background-color: var(--brand-primary);
    color: var(--text-inverse);
    margin-left: auto;
    border-bottom-right-radius: 0;
}

.ai-message {
    background-color: var(--bg-accent);
    color: var(--text-secondary);
    margin-right: auto;
    border-bottom-left-radius: 0;
}

/* Formatting within AI messages */
.ai-message code {
    background-color: rgba(0, 0, 0, 0.1);
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.ai-message strong {
    font-weight: 600;
}

.ai-message em {
    font-style: italic;
}

/* Chat Bubbles (Landing Page Style) */
.chat-message {
    display: flex;
    width: 100%;
}

.chat-message.therapist {
    justify-content: flex-start;
}

.chat-message.patient {
    justify-content: flex-end;
}

.chat-bubble {
    max-width: 80%;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    position: relative;
    cursor: pointer;
}

.therapist .chat-bubble {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-accent);
    border-top-left-radius: 0.25rem;
}

.patient .chat-bubble {
    background-color: var(--warning-bg);
    color: var(--warning-text);
    border-top-right-radius: 0.25rem;
}

.chat-bubble p {
    margin: 0;
    padding: 0;
    white-space: pre-wrap;
}

/* Chat Input Area */
.chat-input-area form {
    display: flex;
    padding: 1rem;
    border-top: 1px solid var(--border-accent);
    background-color: var(--bg-secondary);
}

.chat-input-area textarea {
    flex-grow: 1;
    border: 1px solid var(--border-accent);
    border-radius: 5px;
    padding: 0.5rem;
    resize: none;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-accent);
    color: var(--text-primary);
}

.chat-input-area button {
    background: var(--brand-primary);
    color: var(--text-inverse);
    border: none;
    padding: 0 1.5rem;
    margin-left: 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
}

.chat-input-area button:hover {
    background: #d97706;
}

.chat-input-area button:disabled {
    background: var(--border-accent);
    cursor: not-allowed;
}

/* -------------------------------------------------------------------------
   UTILITY CLASSES
   ------------------------------------------------------------------------- */
.line-clamp-5 {
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    line-clamp: 5;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hidden {
    display: none;
}

/* -------------------------------------------------------------------------
   RESPONSIVE DESIGN
   ------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .container-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .card {
        padding: 1rem;
    }
    
    .chat-container {
        height: 60vh;
    }
    
    .history-list, .chat-log-display {
        max-height: 300px;
    }
    
    .chat-history-section {
        max-height: 70vh;
    }
    
    .tab-nav {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .tab-button {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .rich-editor-toolbar {
        flex-wrap: wrap;
    }
    
    .editor-btn {
        min-width: 35px;
        margin: 0.1rem;
    }
}

/* -------------------------------------------------------------------------
   TAB SYSTEM
   ------------------------------------------------------------------------- */
.tab-container {
    width: 100%;
    margin-top: 1rem;
}

.tab-nav {
    display: flex;
    border-bottom: 2px solid #9CA3AF;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.tab-button {
    background: none;
    border: none;
    padding: 1rem 1.5rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: #9CA3AF;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab-button:hover {
    color: #6B7280;
    background-color: #f8f9fa;
}

.tab-button.active {
    color: #F59E0B;
    border-bottom-color: #F59E0B;
    background-color: #fff;
}

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

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

/* -------------------------------------------------------------------------
   RICH TEXT EDITOR
   ------------------------------------------------------------------------- */
.rich-editor-toolbar {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem;
    border: 1px solid #9CA3AF;
    border-bottom: none;
    background-color: #f8f9fa;
    border-radius: 6px 6px 0 0;
    align-items: center;
}

.editor-btn {
    background: #ffffff;
    border: 1px solid #9CA3AF;
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 0.9rem;
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.editor-btn:hover {
    background-color: #9CA3AF;
    border-color: #9CA3AF;
}

.editor-btn:active {
    background-color: #F59E0B;
    color: white;
    border-color: #F59E0B;
}

.rich-text-editor {
    min-height: 200px;
    border: 1px solid #9CA3AF;
    border-radius: 0 0 6px 6px;
    padding: 1rem;
    background-color: white;
    line-height: 1.5;
    font-family: inherit;
    outline: none;
    overflow-y: auto;
}

.rich-text-editor:focus {
    border-color: #F59E0B;
    box-shadow: 0 0 0 0.2rem rgba(245, 158, 11, 0.25);
}

.rich-text-editor:empty::before {
    content: attr(placeholder);
    color: #9CA3AF;
    font-style: italic;
}

.rich-text-editor ul, .rich-text-editor ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.rich-text-editor p {
    margin: 0.5rem 0;
}

.rich-text-editor strong {
    font-weight: 600;
}

.rich-text-editor em {
    font-style: italic;
}

.rich-text-editor u {
    text-decoration: underline;
}

/* -------------------------------------------------------------------------
   SESSION NOTES
   ------------------------------------------------------------------------- */
.session-note-form {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #9CA3AF;
}

.session-notes-list {
    max-height: 500px;
    overflow-y: auto;
}

.session-note-item {
    background: #f8f9fa;
    border: 1px solid #9CA3AF;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
}

.session-note-item:hover {
    border-color: #F59E0B;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.1);
}

.note-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #9CA3AF;
}

.note-header .timestamp {
    font-weight: 600;
    color: #F59E0B;
}

.note-header small {
    color: #9CA3AF;
    font-style: italic;
}

.note-content {
    line-height: 1.6;
    color: #6B7280;
}

.note-content p {
    margin: 0.5rem 0;
}

.note-content ul, .note-content ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.note-content strong {
    font-weight: 600;
    color: #6B7280;
}

.note-content em {
    font-style: italic;
}

.note-content u {
    text-decoration: underline;
}

/* -------------------------------------------------------------------------
   AI ALLY MANAGEMENT
   ------------------------------------------------------------------------- */

/* Practitioner Statements */
.statements-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #9CA3AF;
    border-radius: 8px;
    background: #f8f9fa;
}

.statement-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #9CA3AF;
    transition: all 0.2s ease;
}

.statement-item:hover {
    background: #9CA3AF;
}

.statement-item:last-child {
    border-bottom: none;
}

.statement-text {
    flex: 1;
    margin-right: 1rem;
    line-height: 1.4;
}

.statement-text.inactive {
    color: #9CA3AF;
    text-decoration: line-through;
}

.statement-actions {
    display: flex;
    gap: 0.5rem;
}

/* Therapy Modality Management */
.modalities-section {
    margin-bottom: 3rem;
}

.modalities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.modality-card {
    background: #ffffff;
    border: 1px solid #9CA3AF;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    position: relative;
}

.modality-card:hover {
    border-color: #F59E0B;
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.2);
    transform: translateY(-2px);
}

.modality-card.predefined {
    border-left: 4px solid #54f8bb;
}

.modality-card.custom {
    border-left: 4px solid #F59E0B;
}

.modality-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.modality-title {
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0;
}

/* Modality statements styling */
.modality-statements {
    background-color: var(--bg-accent);
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid var(--border-primary);
}

.modality-statements h6 {
    margin: 0 0 0.5rem 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 600;
}

.modality-statements .statements-list {
    margin: 0;
    padding-left: 1.2rem;
    max-height: none;
    border: none;
    background: transparent;
}

.modality-statements .statements-list li {
    margin-bottom: 0.4rem;
    color: var(--text-primary);
    font-size: 0.8rem;
    line-height: 1.4;
}

.modality-statements .statements-list li:last-child {
    margin-bottom: 0;
}

/* Button groups with gap support */
.d-flex.gap-2 > * {
    margin-right: 0.5rem;
}

.d-flex.gap-2 > *:last-child {
    margin-right: 0;
}

/* Therapeutic Principles Overlay */
.statements-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.statements-overlay.show {
    opacity: 1;
    visibility: visible;
}

.statements-overlay-content {
    background-color: var(--bg-secondary);
    border-radius: 12px;
    max-width: 90vw;
    max-height: 80vh;
    width: 600px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-primary);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
    overflow: hidden;
}

.statements-overlay.show .statements-overlay-content {
    transform: scale(1) translateY(0);
}

.statements-overlay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-primary);
    background-color: var(--bg-accent);
}

.statements-overlay-header h5 {
    margin: 0;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 1.25rem;
}

.btn-close-overlay {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background-color 0.2s ease, color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
}

.btn-close-overlay:hover {
    background-color: var(--border-primary);
    color: var(--text-secondary);
}

.statements-overlay-body {
    padding: 2rem;
    max-height: 60vh;
    overflow-y: auto;
}

.overlay-statements-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.overlay-statement-item {
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    background-color: var(--bg-accent);
    border-radius: 8px;
    border-left: 4px solid var(--brand-primary);
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.6;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.overlay-statement-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.overlay-statement-item:last-child {
    margin-bottom: 0;
}

.overlay-statement-item::before {
    content: counter(list-item);
    counter-increment: list-item;
    position: absolute;
    left: -0.5rem;
    top: 0.5rem;
    background-color: var(--brand-primary);
    color: var(--text-inverse);
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}

.overlay-statements-list {
    counter-reset: list-item;
}

/* Modality statements preview button */
.modality-statements-preview {
    display: flex;
    justify-content: center;
}

.modality-statements-preview .btn {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
    background-color: transparent;
    transition: all 0.2s ease;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

.modality-statements-preview .btn:hover {
    background-color: var(--brand-primary);
    color: var(--text-inverse);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.modality-statements-preview .btn i {
    font-size: 0.7rem;
}

/* Responsive overlay */
@media (max-width: 768px) {
    .statements-overlay-content {
        width: 95vw;
        max-height: 90vh;
        margin: 1rem;
    }
    
    .statements-overlay-header {
        padding: 1rem 1.5rem;
    }
    
    .statements-overlay-header h5 {
        font-size: 1.1rem;
    }
    
    .statements-overlay-body {
        padding: 1.5rem;
    }
    
    .overlay-statement-item {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
}

.modality-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.modality-badge.predefined {
    background: #d1fae5;
    color: #065f46;
}

.modality-badge.custom {
    background: #FEF3C7;
    color: #92400e;
}

/* Hexagon Chart Visualization */
.hexagon-chart-container {
    position: relative;
    width: 350px;
    height: 350px;
    margin: 1.5rem auto;
    max-width: 100%;
    overflow: visible;
}

.hexagon-chart {
    width: 100%;
    height: 100%;
}

.hexagon-grid {
    fill: none;
    stroke: #9CA3AF;
    stroke-width: 1;
}

.hexagon-axis {
    stroke: #9CA3AF;
    stroke-width: 1;
}

.hexagon-data {
    fill: rgba(245, 158, 11, 0.3);
    stroke: #F59E0B;
    stroke-width: 2;
}

.hexagon-label {
    font-size: 14px;
    fill: #6B7280;
    font-weight: 500;
    dominant-baseline: central;
}

.hexagon-value {
    font-size: 16px;
    fill: #F59E0B;
    font-weight: 700;
}

/* Modality Dimension Sliders */
.dimension-slider {
    margin-bottom: 1.5rem;
}

.dimension-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.dimension-name {
    font-weight: 500;
    color: #6B7280;
}

.dimension-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #F59E0B;
    min-width: 30px;
    text-align: center;
}

.slider-input {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #9CA3AF;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.slider-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #F59E0B;
    cursor: pointer;
}

.slider-input::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #F59E0B;
    cursor: pointer;
    border: none;
}

/* AI Ally Forms */
.ally-form-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #9CA3AF;
}

.ally-form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.ally-form-section h4 {
    margin-bottom: 1rem;
    color: #F59E0B;
    font-weight: 600;
}

.proactivity-section {
    background: var(--bg-accent);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.proactivity-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.proactivity-option {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    background: var(--bg-secondary);
    transition: all 0.2s ease;
    cursor: pointer;
    color: var(--text-primary);
}

.proactivity-option:hover {
    border-color: #F59E0B;
    background: rgba(245, 158, 11, 0.05);
}

.proactivity-option input[type="radio"] {
    margin-right: 0.5rem;
}

.custom-proactivity {
    display: none;
    margin-top: 1rem;
}

.custom-proactivity.active {
    display: block;
}

/* AI Ally List */
.allies-list {
    display: grid;
    gap: 1rem;
}

.ally-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.ally-item:hover {
    border-color: #F59E0B;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.1);
}

.ally-item.active {
    background: var(--success-bg);
    border-color: var(--success-border);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
}

.ally-item.active:hover {
    border-color: var(--success-text);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.ally-info {
    flex: 1;
}

.ally-name {
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.ally-details {
    font-size: 0.9rem;
    color: var(--text-tertiary);
}

.ally-notes {
    color: var(--text-tertiary);
}

.ally-actions {
    display: flex;
    gap: 0.5rem;
}

/* System Prompt Display */
.system-prompt-display {
    background: var(--bg-accent);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    padding: 1.5rem;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    white-space: pre-wrap;
    max-height: 600px;
    overflow-y: auto;
    color: var(--text-primary);
}

.prompt-section {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-secondary);
}

.prompt-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.prompt-section-title {
    font-weight: 600;
    color: #F59E0B;
    margin-bottom: 0.5rem;
}

/* Responsive Design for AI Ally Management */
@media (max-width: 768px) {
    .modalities-grid {
        grid-template-columns: 1fr;
    }
    
    .hexagon-chart-container {
        width: 280px;
        height: 280px;
    }
    
    .hexagon-label {
        font-size: 10px;
    }
    
    .hexagon-value {
        font-size: 14px;
    }
    
    .proactivity-options {
        grid-template-columns: 1fr;
    }
    
    .ally-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .ally-actions {
        width: 100%;
        justify-content: flex-end;
        margin-top: 1rem;
    }
}

@media (max-width: 480px) {
    .hexagon-chart-container {
        width: 250px;
        height: 250px;
    }
    
    .hexagon-label {
        font-size: 9px;
    }
    
    .hexagon-value {
        font-size: 13px;
    }
}

/* Frontpage specific styles */
.frontpage-hexagon {
    width: 280px !important;
    height: 280px !important;
    max-width: 100%;
}

@media (max-width: 768px) {
    .frontpage-hexagon {
        width: 250px !important;
        height: 250px !important;
    }
}

@media (max-width: 480px) {
    .frontpage-hexagon {
        width: 220px !important;
        height: 220px !important;
    }
}

/* Version History */
.version-history-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.version-item {
    border: 1px solid #9CA3AF;
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.2s ease;
}

.version-item:hover {
    border-color: #F59E0B;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.1);
}

.version-item.active-version {
    border-color: #54f8bb;
    background: rgba(84, 248, 187, 0.05);
}

.version-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.version-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.version-actions {
    display: flex;
    gap: 0.5rem;
}

.version-notes {
    padding-top: 0.5rem;
    border-top: 1px solid #9CA3AF;
    color: #9CA3AF;
}

@media (max-width: 768px) {
    .version-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .version-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

/* -------------------------------------------------------------------------
   COMPARISON BLOCKS (Traditional vs CuratedAI)
   ------------------------------------------------------------------------- */

/* Circular flow animation container */
.cycle-container {
    position: relative;
    width: 320px;
    height: 320px;
    margin: 0 auto;
}

.cycle-path {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px dashed;
    border-radius: 50%;
    opacity: 0.2;
}

.cycle-item {
    position: absolute;
    width: 80px;
    height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 50%;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.cycle-item:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

/* Position cycle items */
.cycle-item:nth-child(2) { 
    top: -40px; 
    left: 50%; 
    transform: translateX(-50%); 
}

.cycle-item:nth-child(3) { 
    top: 50%; 
    right: -40px; 
    transform: translateY(-50%); 
}

.cycle-item:nth-child(4) { 
    bottom: -40px; 
    left: 50%; 
    transform: translateX(-50%); 
}

.cycle-item:nth-child(5) { 
    top: 50%; 
    left: -40px; 
    transform: translateY(-50%); 
}

/* Arrow indicators */
.arrow {
    position: absolute;
    font-size: 24px;
    opacity: 0.4;
}

.arrow-top { top: 20px; left: 75%; }
.arrow-right { top: 75%; right: 20px; }
.arrow-bottom { bottom: 20px; right: 75%; }
.arrow-left { top: 25%; left: 20px; }

/* Responsive adjustments for comparison blocks */
@media (max-width: 768px) {
    .cycle-container {
        width: 260px;
        height: 260px;
    }
    
    .cycle-item {
        width: 65px;
        height: 65px;
        font-size: 0.8rem;
    }
    
    .cycle-item:nth-child(2) { top: -32px; }
    .cycle-item:nth-child(3) { right: -32px; }
    .cycle-item:nth-child(4) { bottom: -32px; }
    .cycle-item:nth-child(5) { left: -32px; }
    
    .arrow {
        font-size: 18px;
    }
}

/* =========================================================================
   SETTINGS & ROLE MANAGEMENT STYLES
   ========================================================================= */

/* Settings Cards */
.settings-card {
    @apply rounded-lg shadow-sm border;
    background-color: var(--bg-secondary);
    border-color: var(--border-primary);
}

.settings-card-header {
    @apply px-6 py-4 border-b;
    border-color: var(--border-primary);
}

.settings-card-title {
    @apply text-lg font-semibold m-0;
    color: var(--text-secondary);
}

.settings-card-content {
    @apply p-6;
}

/* Settings page text color overrides for dark mode */
.settings-card .text-gray-900,
.text-gray-900 {
    color: var(--text-secondary) !important;
}

.settings-card .text-gray-600,
.text-gray-600 {
    color: var(--text-primary) !important;
}

.settings-card .text-gray-500,
.text-gray-500 {
    color: var(--text-tertiary) !important;
}

.settings-card .text-xs.text-gray-500 {
    color: var(--text-tertiary) !important;
}

/* Additional text color fixes for dark mode */
.text-gray-700 {
    color: var(--text-secondary) !important;
}

.text-gray-800 {
    color: var(--text-secondary) !important;
}

/* Background color fixes for settings page alerts */
.bg-yellow-50 {
    background-color: var(--warning-bg) !important;
}

.border-yellow-200 {
    border-color: var(--warning-border) !important;
}

.bg-green-50 {
    background-color: var(--success-bg) !important;
}

.border-green-200 {
    border-color: var(--success-border) !important;
}

.text-yellow-800 {
    color: var(--warning-text) !important;
}

.text-green-800 {
    color: var(--success-text) !important;
}

.text-green-700 {
    color: var(--success-text) !important;
}

/* Role Badges */
.role-badge {
    @apply inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium;
}

.role-badge-customer {
    background-color: var(--info-bg);
    color: var(--info-text);
}

.role-badge-practitioner {
    background-color: var(--success-bg);
    color: var(--success-text);
}

/* Status Badges */
.status-badge {
    @apply inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium;
}

.status-badge.status-pending {
    background-color: var(--warning-bg);
    color: var(--warning-text);
}

.status-badge.status-approved {
    background-color: var(--success-bg);
    color: var(--success-text);
}

.status-badge.status-rejected {
    background-color: var(--error-bg);
    color: var(--error-text);
}

.status-badge.status-cancelled {
    background-color: var(--bg-accent);
    color: var(--text-tertiary);
}

/* Filter Tabs */
.filter-tab {
    @apply py-2 px-1 border-b-2 border-transparent font-medium text-sm text-gray-500 hover:text-gray-700 hover:border-gray-300;
}

.filter-tab-active {
    @apply border-blue-500 text-blue-600;
}

/* Button Styles */
.btn {
    @apply inline-flex items-center justify-center px-4 py-2 border border-transparent text-sm font-medium rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2 transition-colors;
}

.btn-primary {
    @apply text-white bg-blue-600 hover:bg-blue-700 focus:ring-blue-500;
}

.btn-secondary {
    @apply text-gray-700 bg-gray-100 hover:bg-gray-200 focus:ring-gray-500;
}

.btn-success {
    @apply text-white bg-green-600 hover:bg-green-700 focus:ring-green-500;
}

.btn-danger {
    @apply text-white bg-red-600 hover:bg-red-700 focus:ring-red-500;
}

.btn-outline-secondary {
    @apply text-gray-700 bg-white border-gray-300 hover:bg-gray-50 focus:ring-gray-500;
}

.btn-sm {
    @apply px-3 py-1.5 text-xs;
}

/* Form Controls */
.form-control {
    @apply block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm placeholder-gray-400 focus:outline-none focus:ring-blue-500 focus:border-blue-500 text-sm;
}

.form-control:focus {
    @apply ring-2 ring-blue-500 border-blue-500;
}

/* Alert Messages */
.alert {
    @apply p-4 rounded-md border;
}

.alert-success {
    background-color: var(--success-bg);
    border-color: var(--success-border);
    color: var(--success-text);
}

.alert-error, .alert-danger {
    background-color: var(--error-bg);
    border-color: var(--error-border);
    color: var(--error-text);
}

.alert-warning {
    background-color: var(--warning-bg);
    border-color: var(--warning-border);
    color: var(--warning-text);
}

.alert-info {
    background-color: var(--info-bg);
    border-color: var(--info-border);
    color: var(--info-text);
}

/* Settings Navigation Icon Styling */
nav a[title="Settings"] {
    @apply flex items-center justify-center;
}

nav a[title="Settings"]:hover svg {
    @apply transform rotate-45 transition-transform duration-200;
}

/* Table Styling for Admin Pages */
.settings-card table {
    @apply border-collapse;
}

.settings-card thead th {
    @apply text-left text-xs font-medium uppercase tracking-wider;
    background-color: var(--bg-accent);
    color: var(--text-tertiary);
}

.settings-card tbody tr:hover {
    background-color: var(--bg-accent);
}

/* Responsive Grid for Settings */
@media (max-width: 768px) {
    .settings-card {
        @apply mx-4;
    }
    
    .grid.md\\:grid-cols-2 {
        @apply grid-cols-1 gap-4;
    }
    
    .grid.lg\\:grid-cols-3 {
        @apply grid-cols-1 gap-4;
    }
    
    .settings-card-content {
        @apply p-4;
    }
    
    .overflow-x-auto table {
        @apply text-sm;
    }
}

/* Loading and Transition States */
.btn:disabled {
    @apply opacity-50 cursor-not-allowed;
}

.fade-in-up {
    @apply transform translate-y-4 opacity-0 transition-all duration-300;
}

.fade-in-up.visible {
    @apply translate-y-0 opacity-100;
}

/* Role Switcher Navigation */
.role-switcher {
    @apply relative inline-block;
}

.role-switcher-dropdown {
    @apply absolute right-0 w-52 rounded-md shadow-lg border z-50;
    background-color: var(--bg-secondary);
    border-color: var(--border-primary);
    margin-top: 0.25rem;
}

.role-switcher-dropdown form button {
    @apply w-full text-left text-sm transition-colors duration-150;
    color: var(--text-secondary);
    padding: 12px 16px;
}

.role-switcher-dropdown form button:hover {
    background-color: var(--bg-accent);
}

.role-switcher-dropdown form:first-child button {
    border-radius: 0.5rem 0.5rem 0 0;
}

.role-switcher-dropdown form:last-child button {
    border-radius: 0 0 0.5rem 0.5rem;
}

/* Navigation Role Badge Styling */
nav .role-badge {
    @apply text-xs px-2 py-1;
}

nav .role-badge-customer {
    @apply bg-blue-100 text-blue-700;
}

nav .role-badge-practitioner {
    @apply bg-green-100 text-green-700;
}

/* Role switcher button styling */
.role-switcher button[onclick] {
    @apply transition-all duration-200;
}

.role-switcher button[onclick]:hover {
    @apply bg-gray-100;
}

.role-switcher button[onclick]:hover svg {
    @apply transform rotate-180 transition-transform duration-200;
}

/* Responsive role switcher */
@media (max-width: 768px) {
    .role-switcher-dropdown {
        @apply w-full right-0 mt-2;
    }
    
    nav .text-sm {
        @apply text-xs;
    }
}