/* static/css/base.css */

/* ========================================
   CSS CUSTOM PROPERTIES FOR CONSISTENT THEMING
   ======================================== */
:root {
  /* Color Palette */
  --primary-color: #007bff;
  --primary-dark: #0056b3;
  --primary-light: #00bfff;
  --secondary-color: #6c757d;
  --success-color: #28a745;
  --warning-color: #ffc107;
  --danger-color: #dc3545;
  --light-color: #f8f9fa;
  --dark-color: #343a40;
  --white-color: #ffffff;

  /* Gradient Colors */
  --primary-gradient: linear-gradient(135deg, #007bff 0%, #00bfff 100%);
  --warning-gradient: linear-gradient(135deg, #ff6b6b 0%, #feca57 100%);
  --dark-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);

  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-xxl: 3rem;
  --spacing-xxxl: 5rem;

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 15px;
  --radius-xxl: 20px;
  --radius-full: 50px;

  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);

  /* Font Sizes */
  --font-size-xs: 0.8rem;
  --font-size-sm: 0.9rem;
  --font-size-md: 1rem;
  --font-size-lg: 1.1rem;
  --font-size-xl: 1.25rem;
  --font-size-xxl: 1.5rem;
  --font-size-xxxl: 2rem;

  /* Z-Index */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
}

/* ========================================
   LAYOUT COMPONENTS
   ======================================== */

div.inner-content {
    min-height: 45rem;
    margin-top: 2rem;
    margin-left: 2rem;
    margin-right: 2rem;
    margin-bottom: 2rem;
}

/* ========================================
   EVALUATION COMPONENTS
   ======================================== */

.evaluation-detail-container {
    padding: 1rem 0;
}

.band-score-display {
    font-size: 2.5rem !important;
    font-weight: 700;
}

.evaluation-header .band-score-display {
    font-size: 2rem !important;
}

.band-placeholder {
    font-size: 1.2rem;
    font-style: italic;
}

/* ========================================
   BAND REVEAL BUTTON STYLES
   ======================================== */

.enhanced-band-reveal-button {
  background: linear-gradient(135deg, #ff6b6b 0%, #feca57 100%);
  border: none;
  border-radius: 50px;
  padding: 12px 30px;
  font-size: 1.1rem;
  font-weight: 600;
  color: white;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.enhanced-band-reveal-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.enhanced-band-reveal-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 35px rgba(255, 107, 107, 0.5);
  background: linear-gradient(135deg, #feca57 0%, #ff6b6b 100%);
}

.enhanced-band-reveal-button:hover::before {
  left: 100%;
}

.enhanced-band-reveal-button:active {
  transform: translateY(0);
  box-shadow: 0 5px 15px rgba(255, 107, 107, 0.3);
}

/* Pulse animation for attention */
@keyframes pulse {
  0% {
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
  }
  50% {
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.7);
  }
  100% {
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
  }
}

.enhanced-band-reveal-button.pulse {
  animation: pulse 2s infinite;
}

/* Target emoji styling */
.enhanced-band-reveal-button .target-emoji {
  font-size: 1.3rem;
  animation: bounce 1s infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-3px);
  }
  60% {
    transform: translateY(-2px);
  }
}

/* ========================================
   BAND STATE STYLING
   ======================================== */

.enhanced-band-pending {
  background: linear-gradient(135deg, #ff6b6b 0%, #feca57 100%);
  border: none;
  border-radius: 50px;
  padding: 12px 30px;
  color: white;
  box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  min-width: 200px;
  justify-content: center;
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

.enhanced-band-pending .custom-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.enhanced-band-display {
  background: linear-gradient(135deg, #ff6b6b 0%, #feca57 100%);
  border: none;
  border-radius: 50px;
  padding: 12px 30px;
  color: white;
  box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.3rem;
  min-width: 200px;
  justify-content: center;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.enhanced-band-display::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: shimmer 0.6s ease-out;
}

.enhanced-band-display.show::before {
  animation: celebration-pulse 0.8s ease-out;
}

@keyframes celebration-pulse {
  0% {
    left: -100%;
    transform: scaleX(0);
  }
  50% {
    transform: scaleX(1);
  }
  100% {
    left: 100%;
    transform: scaleX(1);
  }
}

.enhanced-band-display .band-icon {
  font-size: 1.5rem;
  animation: bounce-in 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes bounce-in {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  60% {
    transform: scale(1.2);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.enhanced-band-display .band-score {
  font-weight: 700;
  font-size: 1.4rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Subtle floating animation when not hovered */
.enhanced-band-display.active {
  animation: gentle-float 3s ease-in-out infinite;
}

@keyframes gentle-float {
  0%, 100% {
    transform: translateY(0px) scale(1);
  }
  50% {
    transform: translateY(-3px) scale(1.02);
  }
}

/* Enhanced hover effects */
.enhanced-band-display.active:hover {
  animation: none;
  transform: scale(1.02);
  box-shadow: 0 12px 35px rgba(255, 107, 107, 0.6);
  background: linear-gradient(135deg, #ff5252 0%, #ffb347 100%);
}

.enhanced-band-display.active:hover .band-score {
  transform: scale(1.1);
  transition: transform 0.3s ease;
}

.enhanced-band-display.active:hover::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  border-radius: 50px;
  animation: light-sweep 0.8s ease-out;
}

@keyframes light-sweep {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

/* Confetti celebration effect */
.confetti-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
}

.confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  background: #ff6b6b;
  animation: confetti-fall 3s linear forwards;
}

.confetti:nth-child(2n) {
  background: #feca57;
  animation-delay: 0.1s;
}

.confetti:nth-child(3n) {
  background: #48cae4;
  animation-delay: 0.2s;
}

.confetti:nth-child(4n) {
  background: #06ffa5;
  animation-delay: 0.3s;
}

@keyframes confetti-fall {
  0% {
    transform: translateY(-100vh) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

/* Active states for smooth transitions */
.enhanced-band-reveal-button.active {
  opacity: 1;
  transform: scale(1);
}

.enhanced-band-pending.active {
  opacity: 1;
  transform: scale(1);
}

.enhanced-band-display.active {
  opacity: 1;
  transform: scale(1);
}

/* Exit animations */
.enhanced-band-reveal-button.exiting {
  opacity: 0;
  transform: scale(0.8);
}

.enhanced-band-pending.exiting {
  opacity: 0;
  transform: scale(0.8);
}

.enhanced-band-display.exiting {
  opacity: 0;
  transform: scale(0.8);
}

/* ========================================
   TOOLBAR STYLES
   ======================================== */

#toolbar {
    border: 1px solid #ccc;
    background-color: white;
    border-radius: 15px;
    padding: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    position: absolute;
    top: 0;
    left: 0;
    display: none;
    cursor: pointer;
    z-index: 1000;
}


.toolbar-content {
    display: flex;
    align-items: center;
    font-weight: 500;
    color: #007bff;
}

/* ========================================
   LEXICAL EDITOR STYLES
   ======================================== */

.lexical-container-wrapper {
    margin-top: 1rem;
}

.lexical-header {
    font-weight: 600;
    color: #495057;
}

.lexical-container {
    height: 500px;
    gap: 1rem;
}

.lexical-container .column:first-child {
    flex: 1;
}

.lexical-container .column:last-child {
    flex: 0 0 300px;
    overflow-y: auto;
}

.lexical-container .column > div {
    height: 100%;
    overflow-y: auto;
}

.lexical-container ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.lexical-container ul li {
    cursor: pointer;
    padding: 12px 15px;
    margin-bottom: 8px;
    border: 1px solid #e7e7e7;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.lexical-container ul li:hover {
    background-color: #f8f9fa;
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
}

.lexical-container ul li.selected {
    background-color: #e6f2ff !important;
    border-color: #007bff !important;
    font-weight: 500;
}

.lexical-container .highlight {
    background-color: #fff3cd;
    padding: 2px 4px;
    border-radius: 3px;
}

.evaluation-content,
.major-issues-content {
    line-height: 1.6;
}

/* ========================================
   ACCORDION & NAVIGATION STYLES
   ======================================== */

.accordion-button:not(.collapsed) {
    background-color: #f8f9fa;
    color: #007bff;
    font-weight: 500;
}

/* Hide preview text when accordion is expanded */
.accordion-button:not(.collapsed) .preview-text {
    display: none;
}

/* Style preview text to be grey */
.preview-text {
    color: #6c757d;
    font-size: 0.9em;
}

.accordion-button:focus {
    box-shadow: none;
}

.nav-tabs .nav-link {
    border: none;
    color: #6c757d;
    font-weight: 500;
    padding: 12px 20px;
    transition: all 0.2s ease;
}

.nav-tabs .nav-link:hover {
    color: #007bff;
    border-color: transparent;
}

.nav-tabs .nav-link.active {
    color: #007bff;
    border-bottom: 3px solid #007bff;
    background-color: transparent;
}

/* ========================================
   CARD STYLES
   ======================================== */

.card {
    border: none;
    border-radius: 12px;
    overflow: hidden;
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid #e9ecef;
    padding: 1rem 1.5rem;
}

.card-body {
    padding: 1.5rem;
}

.placeholder-glow .placeholder {
    background-color: #e9ecef;
    opacity: 0.8;
}

/* ========================================
   DASHBOARD STYLES
   ======================================== */

.dashboard-container {
    padding: 1rem 0;
}

.dashboard-header {
    padding: 1.5rem 0;
    border-bottom: 1px solid #e9ecef;
}

.compact-quota {
    margin-left: 2rem;
}

.dashboard-icon {
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.dashboard-icon:hover {
    opacity: 1;
}

/* Quota Cards */
.quota-card {
    border-radius: 12px;
    padding: 1.5rem;
    color: white;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Compact Quota Cards */
.quota-card.compact {
    padding: 1rem;
}

.quota-card.compact .quota-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.quota-card.compact .quota-title {
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.quota-card.compact .quota-value {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.quota-card.compact .quota-description {
    font-size: 0.8rem;
}

/* Mini Quota Cards */
.quota-card.mini {
    padding: 0.75rem;
}

.quota-card.mini .quota-icon {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.quota-card.mini .quota-title {
    font-size: 0.8rem;
    margin-bottom: 0.125rem;
}

.quota-card.mini .quota-value {
    font-size: 1.25rem;
    margin-bottom: 0;
}

.quota-card.mini .quota-description {
    display: none;
}

/* Micro Quota Cards */
.quota-card.micro {
    padding: 0.5rem;
}

.quota-card.micro .quota-icon {
    font-size: 1.2rem;
    margin-bottom: 0.125rem;
}

.quota-card.micro .quota-title {
    font-size: 0.7rem;
    margin-bottom: 0;
    display: none;
}

.quota-card.micro .quota-value {
    font-size: 1rem;
    margin-bottom: 0;
    font-weight: 700;
}

.quota-card.micro .quota-description {
    display: none;
}

/* Inline Quota Cards */
.quota-card.inline {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.quota-card.inline .quota-icon {
    margin-right: 0.5rem;
    margin-bottom: 0;
}

.quota-card.inline .quota-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.quota-card.inline .quota-title {
    font-size: 1.1rem;
    margin-bottom: 0;
    margin-right: 0.5rem;
}

.quota-card.inline .quota-value {
    font-size: 1.5rem;
    margin-bottom: 0;
    font-weight: 700;
}

.quota-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.quota-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.quota-card:hover::before {
    left: 100%;
}

.quota-card.bg-gradient-primary {
    background: linear-gradient(135deg, #007bff 0%, #00bfff 100%);
}

.quota-card.bg-gradient-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.quota-icon {
    font-size: 2.5rem;
    opacity: 0.9;
    margin-bottom: 1rem;
}

.quota-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.quota-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.quota-description {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 0;
}

/* Evaluation Cards */
.evaluation-card {
    border: 1px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
}

.evaluation-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: #007bff;
}

.evaluation-header {
    padding: 1rem 1.5rem;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    z-index: 100;
    transition: box-shadow 0.3s ease;
}

.evaluation-header.sticky-top {
    position: sticky;
    top: 60px;
}

.evaluation-header.stick {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.evaluation-body {
    padding: 0;
}

.evaluation-footer {
    padding: 1rem 1.5rem;
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
    font-size: 0.9rem;
}

.evaluation-status .badge {
    font-size: 0.8rem;
    padding: 0.5rem 0.75rem;
    font-weight: 600;
}

/* Empty State */
.empty-state-icon {
    opacity: 0.5;
}

.empty-state-icon:hover {
    opacity: 0.7;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .dashboard-header {
        text-align: center;
        padding: 1rem 0;
    }

    .dashboard-header .d-flex.align-items-center.justify-content-between {
        flex-direction: column;
        gap: 1rem;
    }

    .compact-quota {
        margin-left: 0;
        margin-top: 1rem;
    }

    .dashboard-icon {
        margin-bottom: 1rem;
    }

    .quota-card {
        margin-bottom: 1rem;
    }

    .evaluation-header {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 1rem;
    }

    .evaluation-footer {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
}

/* Animation for dashboard elements */
.dashboard-container > * {
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.dashboard-container > *:nth-child(2) {
    animation-delay: 0.1s;
}

.dashboard-container > *:nth-child(3) {
    animation-delay: 0.2s;
}

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

/* ========================================
   ENHANCED CHAT INTERFACE STYLES
   ======================================== */

/* CSS Variables for Chat Theme */
:root {
  /* Chat-specific color palette */
  --chat-primary: #3b82f6;
  --chat-primary-dark: #2563eb;
  --chat-primary-light: #60a5fa;
  --chat-secondary: #60a5fa;
  --chat-accent: #f472b6;
  --chat-success: #34d399;
  --chat-warning: #fbbf24;
  --chat-danger: #f87171;

  /* Glassmorphism values */
  --chat-glass-bg: rgba(255, 255, 255, 0.25);
  --chat-glass-border: rgba(255, 255, 255, 0.18);
  --chat-glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
  --chat-blur-strong: blur(20px);
  --chat-blur-medium: blur(10px);
  --chat-blur-light: blur(5px);

  /* Animation timing */
  --chat-transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --chat-transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --chat-transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);

  /* Spacing scale */
  --chat-space-1: 0.25rem;  /* 4px */
  --chat-space-2: 0.5rem;   /* 8px */
  --chat-space-3: 0.75rem;  /* 12px */
  --chat-space-4: 1rem;     /* 16px */
  --chat-space-5: 1.25rem;  /* 20px */
  --chat-space-6: 1.5rem;   /* 24px */
  --chat-space-8: 2rem;     /* 32px */
}

/* Main Chat Container - Mobile First */
#chat-container {
  position: fixed;
  bottom: var(--chat-space-3);
  right: var(--chat-space-3);
  z-index: var(--z-fixed);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Floating Chat Launch Button */
.chat-launch-button {
  position: relative;
  background: linear-gradient(135deg, var(--chat-primary) 0%, var(--chat-secondary) 100%);
  border: 1px solid rgba(255, 255, 255, 0.3); /* Fallback border */
  border-radius: 60px;
  padding: var(--chat-space-4) var(--chat-space-6);
  cursor: pointer;
  box-shadow: var(--chat-glass-shadow);
  transition: all var(--chat-transition-normal);
  overflow: hidden;
  outline: none;
  appearance: none;
  will-change: transform, box-shadow; /* Performance optimization */
}

/* Modern backdrop-filter support for launch button */
@supports (backdrop-filter: blur(20px)) or (-webkit-backdrop-filter: blur(20px)) {
  .chat-launch-button {
    border: 1px solid var(--chat-glass-border);
    backdrop-filter: var(--chat-blur-strong);
    -webkit-backdrop-filter: var(--chat-blur-strong);
  }
}

.chat-launch-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.6s ease;
}

.chat-launch-button:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 40px 0 rgba(59, 130, 246, 0.4);
  background: linear-gradient(135deg, var(--chat-primary-dark) 0%, var(--chat-primary) 100%);
}

.chat-launch-button:hover::before {
  left: 100%;
}

.chat-launch-button:active {
  transform: translateY(-1px) scale(0.98);
}

.chat-button-content {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--chat-space-3);
  color: white;
  font-weight: 600;
  font-size: 0.95rem;
}

.chat-icon {
  font-size: 1.25rem;
  animation: chatIconPulse 2s ease-in-out infinite;
}

@keyframes chatIconPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.chat-button-text {
  letter-spacing: 0.025em;
}

.chat-indicator {
  position: absolute;
  top: 0;
  right: 0;
  width: 12px;
  height: 12px;
  background: var(--chat-success);
  border: 2px solid white;
  border-radius: 50%;
  animation: indicatorPulse 2s ease-in-out infinite;
}

@keyframes indicatorPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.8;
  }
}

/* Chat Window - Mobile First Base Styles */
.chat-window {
  position: fixed;
  bottom: var(--chat-space-3);
  left: var(--chat-space-3);
  right: var(--chat-space-3);
  max-width: calc(100vw - 2 * var(--chat-space-3)); /* Prevent overflow beyond viewport */
  background: rgba(255, 255, 255, 0.9); /* Fallback for backdrop-filter */
  border: 1px solid rgba(255, 255, 255, 0.3); /* Fallback border */
  border-radius: 16px;
  box-shadow: var(--chat-glass-shadow);
  transition: all var(--chat-transition-slow) cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: bottom center; /* Changed for mobile-first */
  overflow: hidden;
  will-change: transform, opacity; /* Performance optimization */
}

/* Modern backdrop-filter support with @supports */
@supports (backdrop-filter: blur(20px)) or (-webkit-backdrop-filter: blur(20px)) {
  .chat-window {
    background: var(--chat-glass-bg);
    border: 1px solid var(--chat-glass-border);
    backdrop-filter: var(--chat-blur-strong);
    -webkit-backdrop-filter: var(--chat-blur-strong);
  }
}

.chat-window.folded {
  transform: scale(0.7) translateY(50px) rotateX(5deg);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  filter: blur(2px);
}

.chat-window.unfolded {
  transform: scale(1) translateY(0) rotateX(0deg);
  opacity: 1;
  visibility: visible;
  pointer-events: all;
  display: flex;
  flex-direction: column;
  max-height: 85vh;
  filter: blur(0);
}

.chat-window.unfolded .chat-header {
  animation: headerSlideIn 0.5s ease-out 0.1s both;
}

.chat-window.unfolded .chat-content-area {
  animation: contentSlideIn 0.6s ease-out 0.2s both;
}

.chat-window.unfolded .chat-input-section {
  animation: inputSlideIn 0.4s ease-out 0.3s both;
}

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

@keyframes contentSlideIn {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

/* Enhanced chat button hide/show animation */
.chat-launch-button.chat-hidden {
  transform: scale(0) rotate(180deg);
  opacity: 0;
  visibility: hidden;
}

.chat-launch-button.chat-visible {
  transform: scale(1) rotate(0deg);
  opacity: 1;
  visibility: visible;
  animation: buttonBounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes buttonBounceIn {
  0% {
    transform: scale(0) rotate(-180deg);
    opacity: 0;
  }
  50% {
    transform: scale(1.1) rotate(10deg);
    opacity: 1;
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

/* Chat Header - Mobile First */
.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--chat-space-3) var(--chat-space-4); /* Reduced padding for mobile */
  background: linear-gradient(135deg,
    rgba(102, 126, 234, 0.1) 0%,
    rgba(167, 139, 250, 0.05) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.3); /* Fallback border */
}

/* Modern backdrop-filter support for header */
@supports (backdrop-filter: blur(10px)) or (-webkit-backdrop-filter: blur(10px)) {
  .chat-header {
    border-bottom: 1px solid var(--chat-glass-border);
    backdrop-filter: var(--chat-blur-medium);
    -webkit-backdrop-filter: var(--chat-blur-medium);
  }
}

.chat-header-left {
  display: flex;
  align-items: center;
  gap: var(--chat-space-3);
}

.chat-toggle-icon {
  font-size: 1.5rem;
  color: var(--chat-warning);
  cursor: pointer;
  transition: all var(--chat-transition-fast);
  padding: var(--chat-space-3); /* Increased from var(--chat-space-1) to ~12px */
  border-radius: 50%;
  min-width: 44px; /* WCAG minimum touch target */
  min-height: 44px; /* WCAG minimum touch target */
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-toggle-icon:hover {
  color: var(--chat-warning);
  background: rgba(251, 191, 36, 0.1);
  transform: scale(1.1);
}

.chat-title {
  display: flex;
  align-items: center;
  gap: var(--chat-space-2);
  color: var(--chat-primary-dark);
  font-weight: 600;
  font-size: 1rem;
}

.chat-title-icon {
  font-size: 1.25rem;
  color: var(--chat-primary);
}

.chat-history-button {
  display: flex;
  align-items: center;
  gap: var(--chat-space-2);
  padding: var(--chat-space-2) var(--chat-space-3);
  min-height: 44px; /* WCAG minimum touch target */
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid var(--chat-glass-border);
  border-radius: 20px;
  color: var(--chat-primary-dark);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--chat-transition-fast);
  backdrop-filter: var(--chat-blur-light);
  -webkit-backdrop-filter: var(--chat-blur-light);
}

.chat-history-button:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.chat-history-button i {
  font-size: 0.9rem;
}

/* Chat Content Area - Mobile First */
.chat-content-area {
  flex: 1;
  padding: var(--chat-space-4); /* Reduced padding for mobile */
  overflow-y: auto;
  overflow-x: hidden;
  background: rgba(255, 255, 255, 0.1);
  min-height: 200px;
  max-height: 65vh; /* Increased for mobile-first */
}

/* Mobile-specific customizations - Apply only on mobile devices */
@media (max-width: 767px) {
  .chat-button-text {
    display: none; /* Hide text on mobile */
  }

  .chat-launch-button {
    padding: var(--chat-space-3) var(--chat-space-4); /* Adjusted padding for mobile */
  }

  .chat-message-right,
  .chat-message-left {
    max-width: 90%; /* Wider messages on mobile */
  }

  .chat-title span {
    display: none; /* Hide title text on mobile */
  }

  .chat-history-button .history-text {
    display: none; /* Hide history text on mobile */
  }

  .chat-input-group {
    gap: var(--chat-space-2); /* Tighter gap on mobile */
  }
}

/* Modern backdrop-filter support for content area */
@supports (backdrop-filter: blur(5px)) or (-webkit-backdrop-filter: blur(5px)) {
  .chat-content-area {
    backdrop-filter: var(--chat-blur-light);
    -webkit-backdrop-filter: var(--chat-blur-light);
  }
}

.chat-content-area::-webkit-scrollbar {
  width: 6px;
}

.chat-content-area::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.chat-content-area::-webkit-scrollbar-thumb {
  background: rgba(102, 126, 234, 0.3);
  border-radius: 3px;
  transition: background var(--chat-transition-fast);
}

.chat-content-area::-webkit-scrollbar-thumb:hover {
  background: rgba(102, 126, 234, 0.5);
}

/* Initial Welcome Message */
.initial-message {
  display: flex;
  gap: var(--chat-space-4);
  padding: var(--chat-space-4);
  background: linear-gradient(135deg,
    rgba(102, 126, 234, 0.05) 0%,
    rgba(167, 139, 250, 0.02) 100%);
  border-radius: 16px;
  border: 1px solid var(--chat-glass-border);
  backdrop-filter: var(--chat-blur-light);
  -webkit-backdrop-filter: var(--chat-blur-light);
  animation: welcomeSlideIn 0.6s ease-out;
}

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

.welcome-avatar {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--chat-primary) 0%, var(--chat-secondary) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.25rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.welcome-content p {
  margin: 0;
  color: #374151;
  line-height: 1.6;
  font-size: 0.95rem;
}

/* Chat Input Section */
.chat-input-section {
  padding: var(--chat-space-4) var(--chat-space-5);
  background: rgba(255, 255, 255, 0.15);
  border-top: 1px solid var(--chat-glass-border);
  backdrop-filter: var(--chat-blur-medium);
  -webkit-backdrop-filter: var(--chat-blur-medium);
}

/* Character Counter */
.char-counter {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--chat-space-3);
  font-size: 0.75rem;
  color: #6b7280;
}

.char-progress {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  margin-left: var(--chat-space-3);
  overflow: hidden;
}

.char-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--chat-success) 0%, var(--chat-primary) 100%);
  border-radius: 2px;
  transition: width var(--chat-transition-normal);
  width: 100%;
}

/* Chat Form */
.chat-form {
  margin: 0;
}

.chat-input-group {
  display: flex;
  gap: var(--chat-space-3);
  align-items: flex-end;
}

.input-wrapper {
  flex: 1;
  position: relative;
}

.chat-input {
  width: 100%;
  padding: var(--chat-space-3) var(--chat-space-4);
  border: 1px solid rgba(255, 255, 255, 0.3); /* Fallback border */
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.8);
  color: #374151;
  font-size: 0.9rem;
  line-height: 1.5;
  resize: none;
  outline: none;
  transition: all var(--chat-transition-fast);
  font-family: inherit;
}

/* Modern backdrop-filter support for chat input */
@supports (backdrop-filter: blur(5px)) or (-webkit-backdrop-filter: blur(5px)) {
  .chat-input {
    border: 1px solid var(--chat-glass-border);
    backdrop-filter: var(--chat-blur-light);
    -webkit-backdrop-filter: var(--chat-blur-light);
  }
}

.chat-input::placeholder {
  color: #9ca3af;
}

.chat-input:focus {
  border-color: var(--chat-primary);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--chat-primary), var(--chat-secondary));
  opacity: 0;
  transition: opacity var(--chat-transition-normal);
  z-index: -1;
  filter: blur(8px);
}

.chat-input:focus + .input-glow {
  opacity: 0.2;
}

/* Send Button */
.chat-send-button {
  position: relative;
  padding: var(--chat-space-3);
  background: linear-gradient(135deg, var(--chat-primary) 0%, var(--chat-secondary) 100%);
  border: 1px solid rgba(255, 255, 255, 0.3); /* Fallback border */
  border-radius: 50%;
  width: 48px;
  height: 48px;
  cursor: pointer;
  color: white;
  font-size: 1.1rem;
  transition: all var(--chat-transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  will-change: transform, box-shadow; /* Performance optimization */
}

/* Modern backdrop-filter support for send button */
@supports (backdrop-filter: blur(10px)) or (-webkit-backdrop-filter: blur(10px)) {
  .chat-send-button {
    border: 1px solid var(--chat-glass-border);
    backdrop-filter: var(--chat-blur-medium);
    -webkit-backdrop-filter: var(--chat-blur-medium);
  }
}

.chat-send-button:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.chat-send-button:active {
  transform: scale(0.95);
}

.send-button-content {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
}

.send-icon {
  transition: transform var(--chat-transition-fast);
}

.chat-send-button:hover .send-icon {
  transform: translateX(2px);
}

.send-text {
  display: none;
  font-weight: 600;
  font-size: 0.85rem;
}

.send-ripple {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.chat-send-button:active .send-ripple {
  width: 100px;
  height: 100px;
}

/* Message Bubbles - Enhanced Styling */
.chat-message-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin: var(--chat-space-4) 0 var(--chat-space-4) auto;
  max-width: 80%;
  animation: messageSlideInRight 0.3s ease-out;
}

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

.chat-message-right .message-content {
  background: linear-gradient(135deg, var(--chat-primary) 0%, var(--chat-secondary) 100%);
  color: white;
  padding: var(--chat-space-3) var(--chat-space-4);
  border-radius: 18px 18px 4px 18px;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
  backdrop-filter: var(--chat-blur-light);
  -webkit-backdrop-filter: var(--chat-blur-light);
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-all;
  white-space: normal;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-message-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin: var(--chat-space-4) auto var(--chat-space-4) 0;
  max-width: 80%;
  animation: messageSlideInLeft 0.3s ease-out;
}

@keyframes messageSlideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.chat-message-left .message-content {
  background: rgba(255, 255, 255, 0.9);
  color: #374151;
  padding: var(--chat-space-3) var(--chat-space-4);
  border-radius: 18px 18px 18px 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  backdrop-filter: var(--chat-blur-light);
  -webkit-backdrop-filter: var(--chat-blur-light);
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-all;
  white-space: normal;
  border: 1px solid var(--chat-glass-border);
}

/* Message Timestamps */
.chat-message-time-right {
  font-size: 0.75rem;
  color: #9ca3af;
  margin: var(--chat-space-1) 0;
  opacity: 0.8;
  transition: opacity var(--chat-transition-fast);
  text-align: right;
}

.chat-message-time-left {
  font-size: 0.75rem;
  color: #9ca3af;
  margin: var(--chat-space-1) 0;
  opacity: 0.8;
  transition: opacity var(--chat-transition-fast);
  text-align: left;
}

.chat-message-time-right:hover,
.chat-message-time-left:hover {
  opacity: 1;
}

/* Message content styling */
.chat-message-left .message-content p,
.chat-message-right .message-content p {
  margin: 0;
  line-height: 1.5;
}

/* ========================================
   CHAT PENDING STATUS STYLES
   ======================================== */

/* Pending message container */
.chat-message-pending {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin: var(--chat-space-4) auto var(--chat-space-4) 0;
  max-width: 80%;
  animation: messageSlideInLeft 0.3s ease-out;
}

.chat-message-pending .message-content {
  background: rgba(255, 255, 255, 0.9);
  color: #374151;
  padding: var(--chat-space-3) var(--chat-space-4);
  border-radius: 18px 18px 18px 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  backdrop-filter: var(--chat-blur-light);
  -webkit-backdrop-filter: var(--chat-blur-light);
  border: 1px solid var(--chat-glass-border);
  display: flex;
  align-items: center;
  gap: var(--chat-space-3);
}

/* Typing indicator dots */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
}

.typing-dot {
  width: 8px;
  height: 8px;
  background: #6b7280;
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) {
  animation-delay: -0.32s;
}

.typing-dot:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes typingBounce {
  0%, 80%, 100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Pending text */
.typing-text {
  color: #6b7280;
  font-style: italic;
  font-size: 0.9rem;
}

/* Disabled state for chat inputs */
.chat-input:disabled {
  background: rgba(243, 244, 246, 0.8);
  cursor: not-allowed;
  opacity: 0.7;
}

.chat-send-button:disabled {
  background: #d1d5db;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.chat-send-button:disabled:hover {
  transform: none;
  box-shadow: none;
}

.chat-send-button:disabled .send-icon {
  animation: none;
  transform: none;
}

/* Pending status animation */
@keyframes messageSlideInPending {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.chat-message-pending {
  animation: messageSlideInPending 0.3s ease-out;
}

.chat-message-left .message-content h1,
.chat-message-right .message-content h1,
.chat-message-left .message-content h2,
.chat-message-right .message-content h2,
.chat-message-left .message-content h3,
.chat-message-right .message-content h3,
.chat-message-left .message-content h4,
.chat-message-right .message-content h4,
.chat-message-left .message-content h5,
.chat-message-right .message-content h5,
.chat-message-left .message-content h6,
.chat-message-right .message-content h6 {
  margin: 0.5rem 0 0.25rem 0;
  line-height: 1.3;
}

.chat-message-left .message-content ul,
.chat-message-right .message-content ul,
.chat-message-left .message-content ol,
.chat-message-right .message-content ol {
  margin: 0.25rem 0;
  padding-left: 1.25rem;
}

.chat-message-left .message-content li,
.chat-message-right .message-content li {
  margin: 0.125rem 0;
}

/* Special message styling for auto-questions */
.chat-message-right.auto-question .message-content {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%) !important;
  color: #78350f !important;
  border: 1px solid rgba(251, 191, 36, 0.3) !important;
  box-shadow: 0 4px 12px rgba(251, 191, 36, 0.2) !important;
}

/* Fallback for old inline style method */
.chat-message-right[style*="background-color:#f7f7f7"] .message-content {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%) !important;
  color: #78350f !important;
  border: 1px solid rgba(251, 191, 36, 0.3) !important;
  box-shadow: 0 4px 12px rgba(251, 191, 36, 0.2) !important;
}

/* Responsive Design - Mobile First Approach */

/* Note: Base styles (above) handle mobile (0-575px) - no need for separate mobile media query */

/* Large Mobile (sm): 576-767px */
@media (min-width: 576px) and (max-width: 767px) {
  #chat-container {
    bottom: var(--chat-space-4);
    right: var(--chat-space-4);
  }

  .chat-window {
    width: auto;
    max-width: calc(100vw - 2 * var(--chat-space-4));
    bottom: var(--chat-space-4);
    right: var(--chat-space-4);
    left: var(--chat-space-4);
    border-radius: 16px;
    max-height: 90vh;
  }

  .chat-window.unfolded {
    max-height: 90vh;
  }

  .chat-content-area {
    max-height: 60vh;
  }
}

/* Tablet (md): 768-991px */
@media (min-width: 768px) and (max-width: 991px) {
  #chat-container {
    bottom: var(--chat-space-5);
    right: var(--chat-space-5);
  }

  .chat-window {
    width: 480px;
    max-width: min(480px, calc(100vw - 2 * var(--chat-space-5)));
    bottom: var(--chat-space-5);
    right: var(--chat-space-5);
    left: auto; /* Keep window on right side */
    border-radius: 18px;
    max-height: 90vh;
    transform-origin: bottom right; /* Reset for tablet positioning */
  }

  .chat-window.unfolded {
    max-height: 90vh;
  }

  .chat-content-area {
    padding: var(--chat-space-4) var(--chat-space-5);
    max-height: 60vh;
  }

  .chat-header {
    padding: var(--chat-space-3) var(--chat-space-4);
  }

  .chat-title span {
    display: none;
  }

  .chat-history-button .history-text {
    display: none;
  }

  .chat-input-group {
    gap: var(--chat-space-2);
  }

  .chat-send-button {
    width: 48px;
    height: 48px;
  }

  /* Show chat button text on medium devices and up */
  .chat-button-text {
    display: inline; /* Show text on tablets and larger */
  }

  .chat-launch-button {
    padding: var(--chat-space-4) var(--chat-space-6); /* Restore full padding for text */
  }
}

/* Desktop (lg and xl): 992px+ - Combined to eliminate gaps */
@media (min-width: 992px) {
  #chat-container {
    bottom: var(--chat-space-5);
    right: var(--chat-space-5);
  }

  .chat-window {
    width: 480px;
    max-width: min(480px, calc(100vw - 2 * var(--chat-space-5)));
    bottom: var(--chat-space-5);
    right: var(--chat-space-5);
    left: auto; /* Reset left positioning for desktop */
    border-radius: 18px;
    transform-origin: bottom right; /* Reset for desktop positioning */
  }

  .chat-window.unfolded {
    max-height: 85vh;
  }

  .chat-content-area {
    padding: var(--chat-space-4) var(--chat-space-5);
    max-height: 55vh;
  }

  .chat-header {
    padding: var(--chat-space-4) var(--chat-space-5);
  }

  .chat-send-button {
    width: 48px;
    height: 48px;
  }

  /* Show chat button text on desktop */
  .chat-button-text {
    display: inline; /* Show text on desktop and larger */
  }

  .chat-launch-button {
    padding: var(--chat-space-4) var(--chat-space-6); /* Full padding for text */
  }

  .chat-title span {
    display: inline; /* Show title text on desktop */
  }

  .chat-history-button .history-text {
    display: inline; /* Show history text on desktop */
  }
}

/* Large Desktop (xl): 1200px+ - Additional enhancements only */
@media (min-width: 1200px) {
  #chat-container {
    bottom: var(--chat-space-6);
    right: var(--chat-space-6);
  }

  .chat-window {
    width: 520px;
    max-width: min(520px, calc(100vw - 2 * var(--chat-space-6)));
    bottom: var(--chat-space-6);
    right: var(--chat-space-6);
    left: auto; /* Reset left positioning for desktop */
    border-radius: 20px;
    transform-origin: bottom right; /* Reset for desktop positioning */
  }

  .chat-window.unfolded {
    max-height: 85vh;
  }

  .chat-content-area {
    padding: var(--chat-space-5); /* Increase padding for desktop */
    max-height: 50vh;
  }

  .chat-header {
    padding: var(--chat-space-4) var(--chat-space-5); /* Increase padding for desktop */
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .chat-window {
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #000;
  }

  .chat-input {
    background: #fff;
    border: 2px solid #000;
  }

  .chat-send-button {
    background: #000;
    color: #fff;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .chat-launch-button,
  .chat-window,
  .chat-window.unfolded .chat-header,
  .chat-window.unfolded .chat-content-area,
  .chat-window.unfolded .chat-input-section,
  .chat-send-button,
  .chat-input,
  .initial-message,
  .chat-message-right,
  .chat-message-left,
  .enhanced-band-reveal-button,
  .enhanced-band-pending,
  .enhanced-band-display,
  .enhanced-band-display.active,
  .confetti {
    transition: none !important;
    animation: none !important;
    transform: none !important;
  }

  .chat-icon,
  .chat-indicator,
  .target-emoji,
  .band-icon,
  .welcome-avatar,
  .send-icon {
    animation: none !important;
  }

  .chat-launch-button.chat-visible,
  .chat-window.unfolded,
  .initial-message {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    visibility: visible !important;
  }

  .quota-card,
  .dashboard-container > * {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ========================================
   REVISION & TEXT STYLES
   ======================================== */

del {
    color: red;
    text-decoration: line-through;
}

ins {
    color: green;
    text-decoration: none;
    background-color: #e6ffe6;
    padding: 2px 4px;
    border-radius: 3px;
}

a {
    text-decoration: none;
    color: #007bff;
    transition: color 0.2s ease;
}

a:hover {
    color: #0056b3;
}

._revision {
    position: relative;
}



/* ========================================
   FORM & UTILITY STYLES
   ======================================== */

/* style filter in the task list page */
form > p {
    display: inline;
}

form > input {
    display: inline;
}

p.person_mgs {
    border:1px solid #f7f7f7;
    background-color:#f0f0f0;
    border-radius: 15px;
    padding: 15px;
}



/* Standardized Responsive Breakpoints */
/* xs: 0-575px | sm: 576-767px | md: 768-991px | lg: 992-1199px | xl: 1200px+ */

/* Mobile Devices (xs: 0-575px) */
@media (max-width: 575px) {
    div.inner-content {
        margin: 0.5rem;
        padding: 0.5rem;
    }

    .band-score-display {
        font-size: 1.8rem !important;
    }

    .evaluation-header .band-score-display {
        font-size: 1.3rem !important;
    }

    .band-placeholder {
        font-size: 0.9rem;
    }

    .card-body {
        padding: 0.75rem;
    }
}

/* Small Devices (sm: 576-767px) */
/* Duplicate media query removed - conflicts with chat styles at line 1734 */

/* Medium Devices (md: 768-991px) - General styles (non-chat) */
@media (max-width: 991px) {
    div.inner-content {
        margin: 1rem;
        padding: 1rem;
    }

    .lexical-container {
        flex-direction: column;
        height: auto;
    }

    .lexical-container .column:last-child {
        flex: 0 0 auto;
        margin-top: 1rem;
    }

    .band-score-display {
        font-size: 2rem !important;
    }

    .evaluation-header .band-score-display {
        font-size: 1.5rem !important;
    }

    .band-placeholder {
        font-size: 1rem;
    }

    .nav-tabs .nav-link {
        padding: 8px 12px;
        font-size: 0.9rem;
    }

    .card-body {
        padding: 1rem;
    }

    .evaluation-header .d-flex {
        flex-direction: row;
        align-items: center;
        flex-wrap: nowrap;
    }

    .evaluation-header .text-end {
        text-align: right !important;
        margin-top: 0;
    }

    .evaluation-header .mt-2 {
        margin-top: 0.5rem !important;
    }

    /* Ensure band display elements stay horizontal on mobile */
    .evaluation-header .d-flex.align-items-center.justify-content-end {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        white-space: nowrap !important;
    }

    .evaluation-header .enhanced-band-pending,
    .evaluation-header .enhanced-band-display,
    .evaluation-header .band-placeholder,
    .evaluation-header .enhanced-band-reveal-button {
        flex-shrink: 0 !important;
        min-width: fit-content !important;
    }
}

/* Large Devices (lg: 992-1199px) */
/* Duplicate media query removed - conflicts with chat styles at line 1818 */

/* Extra Large Devices (xl: 1200px+) */
/* Duplicate media query removed - conflicts with chat styles at line 1863 */

/* ========================================
   TASK LIST STYLES
   ======================================== */

/* Task Description Hover Effect */
.task-description {
  position: relative;
  cursor: pointer;
}

.task-description .truncated-text {
  margin: 0;
  line-height: 1.5;
  color: #495057;
}

.task-description .full-description {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  z-index: 1050;
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  line-height: 1.5;
  color: #212529;
  font-size: 0.95rem;
  min-width: 300px;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.task-description:hover .full-description {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.task-description .full-description::before {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 20px;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid #dee2e6;
  white-space: normal;
}

.task-description .full-description::after {
  content: '';
  position: absolute;
  bottom: -7px;
  left: 20px;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid white;
  white-space: normal;
}

/* Ensure cards don't clip the popup */
.task-card {
  overflow: visible !important;
}

/* Prevent body overflow when popup is near viewport edges */
.task-description .full-description.viewport-bottom {
  top: 100%;
  bottom: auto;
  margin-bottom: 0;
  margin-top: 8px;
}

.task-description .full-description.viewport-bottom::before {
  bottom: auto;
  top: -8px;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid #dee2e6;
  border-top: none;
}

.task-description .full-description.viewport-bottom::after {
  bottom: auto;
  top: -7px;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid white;
  border-top: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .task-description .full-description {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    max-width: 90%;
    max-height: 70vh;
    margin-top: 0;
  }

  .task-description:hover .full-description {
    transform: translate(-50%, -50%) scale(1);
  }

  .task-description .full-description::before,
  .task-description .full-description::after {
    display: none;
  }
}

/* Height-based media queries for special cases */
@media (max-height: 600px) {
    .chat-window.unfolded {
        max-height: 95vh;
    }

    #chat-content {
        max-height: calc(95vh - 120px);
    }
}

