/* ===============================================
   DESIGN TOKENS - Global CSS Variables
   =============================================== */

:root {
  --ref-color-gray-0: #000000;
  --ref-color-gray-5: #0d0d0d;
  --ref-color-gray-10: #1a1a1a;
  --ref-color-gray-20: #333333;
  --ref-color-gray-30: #4d4d4d;
  --ref-color-gray-40: #666666;
  --ref-color-gray-50: #808080;
  --ref-color-gray-60: #999999;
  --ref-color-gray-70: #b3b3b3;
  --ref-color-gray-80: #cccccc;
  --ref-color-gray-90: #e6e6e6;
  --ref-color-gray-95: #f2f2f2;
  --ref-color-gray-98: #f6f7f8;
  --ref-color-gray-99: #f9fafc;
  --ref-color-gray-100: #ffffff;

  --ref-color-primary-30: rgb(154, 88, 12);
  --ref-color-primary-40: rgb(180, 104, 15);
  --ref-color-primary-45: rgb(195, 117, 16);
  --ref-color-primary-50: rgb(211, 131, 18);
  --ref-color-primary-55: rgb(215, 138, 32);
  --ref-color-primary-60: rgb(211, 131, 18);
  --ref-color-primary-65: rgb(220, 146, 56);
  --ref-color-primary-70: rgb(229, 161, 85);
  --ref-color-primary-80: rgb(242, 191, 141);
  --ref-color-primary-85: rgb(248, 216, 183);
  --ref-color-primary-90: rgb(250, 229, 207);
  --ref-color-primary-95: rgb(253, 241, 226);
  --ref-color-primary-98: rgb(255, 249, 242);
  --ref-color-primary-100: rgb(255, 255, 255);

  --ref-color-success-95: #eaf6ec;
  --ref-color-success-90: #d4edda;
  --ref-color-success-80: #a9dcb5;
  --ref-color-success-50: #28a745;
  --ref-color-success-40: #208637;
  --ref-color-success-20: #10431c;

  --ref-color-warning-95: #fff9e6;
  --ref-color-warning-90: #fff3cd;
  --ref-color-warning-80: #ffe69c;
  --ref-color-warning-50: #ffc107;
  --ref-color-warning-40: #cc9a06;
  --ref-color-warning-30: #997404;
  --ref-color-warning-20: #664d03;

  --ref-color-error-90: #f8d7da;
  --ref-color-error-80: #f1aeb5;
  --ref-color-error-50: #dc3545;
  --ref-color-error-20: #58151c;

  --ref-color-info-20: #1e40af;
  --ref-color-info-50: #3b82f6;
  --ref-color-info-60: #60a5fa;
  --ref-color-info-70: #a5b4fc;
  --ref-color-info-95: #eff6ff;

  --color-status-idle-bg: var(--ref-color-gray-98);
  --color-status-idle-border: var(--ref-color-gray-90);
  --color-status-idle-text: var(--ref-color-gray-40);

  --color-status-progress-bg: var(--ref-color-primary-95);
  --color-status-progress-border: var(--ref-color-primary-80);
  --color-status-progress-text: var(--ref-color-primary-30);

  --color-status-success-bg: var(--ref-color-success-95);
  --color-status-success-border: var(--ref-color-success-80);
  --color-status-success-text: var(--ref-color-success-20);

  --color-status-error-bg: var(--ref-color-error-90);
  --color-status-error-border: var(--ref-color-error-80);
  --color-status-error-text: var(--ref-color-error-20);

  /* Typography Scale */
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-md: 0.9375rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: 2.25rem;

  /* Font Weights */
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  /* Spacing Scale */
  --space-xxs: 0.125rem;
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-pill: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px
    rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px
    rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px
    rgba(0, 0, 0, 0.04);
  --shadow-primary-md: 0 4px 6px -1px rgba(154 88 12 / 0.1), 0 2px 4px -1px
    rgba(154 88 12 / 0.07);
  --shadow-primary-lg: 0 10px 15px -3px rgba(154 88 12 / 0.1), 0 4px 6px -2px
    rgba(154 88 12 / 0.05);
  --shadow-primary-xl: 0 20px 25px -5px rgba(154 88 12 / 0.1), 0 10px 10px -5px
    rgba(154 88 12 / 0.05);

  /* Z-Index Scale */
  --z-decorative: 1;
  --z-content: 2;
  --z-nav: 10;
  --z-modal: 100;

  /* Transition Management */
  --transition-fast: 0.2s ease;
  --transition-medium: 0.3s ease;
  --transition-slow: 0.8s ease-out;
  --transition-all-fast: all 0.2s ease;
  --transition-transform-fast: transform 0.2s ease;
  --transition-color-medium: color 0.3s ease;
  --transition-width-slow: width 0.8s ease-out;
  --transition-left-medium: left 0.5s ease;
  --transition-left-slow: left 0.6s ease;
  
  /* Text Shadows */
  --text-shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
  
  /* Common Gradients */
  --gradient-primary: linear-gradient(90deg, var(--ref-color-primary-50), var(--ref-color-primary-60));
  --gradient-primary-diagonal: linear-gradient(135deg, var(--ref-color-primary-60), var(--ref-color-primary-65));
  --gradient-primary-hover: linear-gradient(135deg, var(--ref-color-primary-65), var(--ref-color-primary-70));
  --gradient-shimmer: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  --gradient-shine: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

/* ===============================================
   UTILITY CLASSES
   =============================================== */
.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-start {
  display: flex;
  align-items: center;
}

.flex-column {
  display: flex;
  flex-direction: column;
}

.text-center {
  text-align: center;
}

.spinner-mypecon {
  width: 48px;
  height: 48px;
  border: 3px solid var(--ref-color-gray-10);
  border-top: 3px solid var(--ref-color-primary-60);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Error Message */
.error-message {
  background: var(--ref-color-error-90);
  border: 1px solid var(--ref-color-error-50);
  color: var(--ref-color-error-20);
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  text-align: center;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
}

/* Success Message */
.success-message {
  background: var(--ref-color-success-90);
  border: 1px solid var(--ref-color-success-50);
  color: var(--ref-color-success-20);
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  text-align: center;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
}

/* Progress Bar */
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--ref-color-primary-95);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin: var(--space-sm) 0;
}

.progress-fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: var(--radius-sm);
  transition: var(--transition-width-slow);
  position: relative;
}

.progress-fill::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient-shine);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* Fade in scale animation */
@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.fade-in-scale {
  animation: fadeInScale 0.4s ease-out;
}

/* Accessibility & Motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Print Styles */
@media print {
  .card-mypecon {
    box-shadow: none;
    border: 1px solid var(--ref-color-primary-80);
    break-inside: avoid;
  }
  
  .btn-mypecon {
    display: none;
  }
}

/* ===============================================
   INTERACTIVE CARD COMPONENT
   =============================================== */
.interactive-card {
  display: flex;
  background: var(--ref-color-gray-100);
  border: 1px solid var(--ref-color-gray-90);
  border-radius: var(--radius-lg);
  transition: var(--transition-all-fast);
  position: relative;
  overflow: hidden;
}

.interactive-card {
  cursor: pointer;
}

.interactive-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--ref-color-primary-50);
  transform: scaleY(0);
  transition: transform var(--transition-medium);
  transform-origin: bottom;
}

.interactive-card:hover {
  background-color: var(--ref-color-primary-95);
  border-color: var(--ref-color-primary-50);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.interactive-card:hover::before {
  transform: scaleY(1);
}

.interactive-card.card-large {
  padding: var(--space-lg);
}

.interactive-card.no-transform:hover {
  transform: none;
}

.interactive-card.card-primary {
  background: var(--ref-color-primary-98);
  border-color: var(--ref-color-primary-95);
}

.interactive-card.card-primary:hover {
  border-color: var(--ref-color-primary-80);
  box-shadow: var(--shadow-sm);
}

.ai-btn.btn-mypecon {
  border-radius: var(--radius-xl);
}
.ai-btn.btn-mypecon.btn-sm {
  padding: var(--space-xs) var(--space-md);
}

.ai-btn.btn-outline-mypecon {
  border-radius: var(--radius-xl);
}

.ai-btn.btn-outline-mypecon.btn-sm {
  padding: var(--space-xs) var(--space-md);
}

.badge-info {
  background-color: var(--ref-color-primary-95);
  color: var(--ref-color-primary-40);
  border-radius: var(--radius-xl);
  padding: var(--space-xs) var(--space-sm);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-normal);
}

.icon-sm {
  width: 1rem;
  height: 1rem;
  display: inline-block;
  vertical-align: text-bottom;
  margin-right: 0.25rem;
}

.icon-btn {
  border: none;
  background-color: transparent;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.3s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
}

.icon-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.icon-btn-sm {
  color: #666;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.5rem;
}


.icon-btn-text {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 2rem;
  max-height: 2.25rem;
  vertical-align: middle;
  padding: 0.5rem 0.75rem;
  border: solid 1px rgba(0 10 20 / 0.2);
  font-size: 0.875rem;
  word-break: keep-all;
  text-decoration: none;
}
.icon-btn-text div {
  margin-bottom: var(--space-xxs);
}

.icon-btn,
.icon-btn-text {
  font-family: inherit !important;
}

.icon-btn-mypecon.dropdown-toggle[aria-expanded="true"]::after
{
  margin-left: .255em !important;
  color: var(--ref-color-primary-55);
}


.icon-btn:hover {
  background-color: rgba(0 10 20 / 0.05);
  text-decoration: none;
}

.icon-btn:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(0 10 20 / 0.05);
}

.icon-btn.icon-btn-mypecon {
  background: var(--ref-color-primary-95);
  color: var(--ref-color-primary-45);
  border: solid 1px var(--ref-color-primary-50);
  font-weight: bold;
  padding: 0.75rem 1rem;
}

.icon-btn.icon-btn-text-lg {
  max-height: 2.5rem;
  height: 2.5rem;
  padding: 0.75rem 1rem;
}


.icon-btn.icon-btn-mypecon:hover, .icon-btn.icon-btn-mypecon:focus {
  background-color: var(--ref-color-primary-90);
}

.icon-btn.icon-btn-mypecon:hover {
  box-shadow: 0 0.0625rem 0.125rem 0 var(--ref-color-primary-95);
}

.icon-btn.icon-btn-mypecon:focus {
  box-shadow: 0 0 0 3px var(--ref-color-primary-80);
}

/* ===============================================
   BOT ICON UTILITIES
   =============================================== */
.bot-icon {
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bot-icon-color, var(--ref-color-gray-50));
}

.bot-icon-sm {
  width: 1.5rem;
  height: 1.5rem;
}

.bot-icon-base {
  width: 2rem;
  height: 2rem;
}

.bot-icon-md {
  width: 2.5rem;
  height: 2.5rem;
}

.bot-icon-lg {
  width: 3rem;
  height: 3rem;
}

.bot-icon > div::before {
  content: var(--bot-icon-letter, "");
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--font-weight-semibold);
}

.bot-icon-sm > div::before {
  font-size: 0.875rem;
}

.bot-icon-base > div::before {
  font-size: 1rem;
}

.bot-icon-md > div::before {
  font-size: 1.125rem;
}

.bot-icon-lg > div::before {
  font-size: 1.25rem;
}
