/* ===== VARIABLES CSS POUR THEMES ===== */
:root {
  /* Light Theme Colors */
  --bg-primary: #ffffff;
  --bg-secondary: #f7f7f8;
  --bg-tertiary: #ececf1;
  --bg-sidebar: #f7f7f8;
  --bg-chat-item: #ffffff;
  --bg-chat-item-hover: #f7f7f8;
  --bg-input: #ffffff;
  --bg-modal: #ffffff;
  --bg-suggestion: #ffffff;
  --bg-button: #10a37f;
  --bg-button-hover: #0d8a6b;
  --bg-button-secondary: transparent;
  --bg-button-secondary-hover: #f7f7f8;
  
  /* Text Colors */
  --text-primary: #212121;
  --text-secondary: #6e6e80;
  --text-tertiary: #8e8ea0;
  --text-inverse: #ffffff;
  --text-accent: #10a37f;
  --text-placeholder: #8e8ea0;
  
  /* Border Colors */
  --border-primary: #d9d9e3;
  --border-secondary: #ececf1;
  --border-input: #d9d9e3;
  --border-focus: #10a37f;
  
  /* Shadow Colors */
  --shadow-light: rgba(0, 0, 0, 0.05);
  --shadow-medium: rgba(0, 0, 0, 0.1);
  --shadow-heavy: rgba(0, 0, 0, 0.15);
  
  /* Custom Icon Colors - Light Theme */
  --icon-primary: #119FA1;
  --icon-secondary: #119FA1;
  --icon-accent: #119FA1;
  --icon-inverse: #ffffff;
  
  /* Accent Colors */
  --accent-primary: #119FA1;
  --accent-primary-hover: #0f8a8c;
  --accent-primary-alpha: rgba(17, 159, 161, 0.1);
}

/* Dark Theme Colors */
[data-theme="dark"] {
  --bg-primary: #212121;
  --bg-secondary: #2f2f2f;
  --bg-tertiary: #404040;
  --bg-sidebar: #171717;
  --bg-chat-item: #2f2f2f;
  --bg-chat-item-hover: #404040;
  --bg-input: #2f2f2f;
  --bg-modal: #2f2f2f;
  --bg-suggestion: #2f2f2f;
  --bg-button: #10a37f;
  --bg-button-hover: #0d8a6b;
  --bg-button-secondary: transparent;
  --bg-button-secondary-hover: #404040;
  
  /* Text Colors */
  --text-primary: #ececec;
  --text-secondary: #c5c5d2;
  --text-tertiary: #8e8ea0;
  --text-inverse: #212121;
  --text-accent: #19c37d;
  --text-placeholder: #8e8ea0;
  
  /* Border Colors */
  --border-primary: #4d4d4f;
  --border-secondary: #404040;
  --border-input: #4d4d4f;
  --border-focus: #19c37d;
  
  /* Shadow Colors */
  --shadow-light: rgba(0, 0, 0, 0.2);
  --shadow-medium: rgba(0, 0, 0, 0.3);
  --shadow-heavy: rgba(0, 0, 0, 0.4);
  
  /* Custom Icon Colors - Dark Theme */
  --icon-primary: #FFFFFF;
  --icon-secondary: #FFFFFF;
  --icon-accent: #FFFFFF;
  --icon-inverse: #212121;
  
  /* Accent Colors */
  --accent-primary: #119FA1;
  --accent-primary-hover: #0f8a8c;
  --accent-primary-alpha: rgba(17, 159, 161, 0.1);
}

/* ===== BASE STYLES ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  transition: background-color 0.2s ease, color 0.2s ease;
}

body {
  display: flex;
  overflow: hidden;
}

/* ===== SCROLLBAR STYLES ===== */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-primary);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

/* ===== BUTTON RESET ===== */
button {
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
  text-decoration: none;
}

/* ===== INPUT RESET ===== */
input, textarea {
  border: none;
  background: none;
  font-family: inherit;
  color: var(--text-primary);
}

input:focus, textarea:focus {
  outline: none;
}

/* ===== ICON STYLES ===== */
.icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  filter: var(--icon-filter, none);
  transition: filter 0.2s ease;
}

.icon-small {
  width: 16px;
  height: 16px;
}

.icon-large {
  width: 24px;
  height: 24px;
}

/* ===== CUSTOM ICON CLASSES ===== */
.icon-custom {
  color: var(--icon-primary);
  transition: color 0.2s ease;
}

.icon-custom-primary {
  color: var(--icon-primary);
}

.icon-custom-secondary {
  color: var(--icon-secondary);
}

.icon-custom-accent {
  color: var(--icon-accent);
}

/* Force custom colors for all your icons */
.icon.custom-icon,
.icon[data-custom="true"] {
  color: var(--icon-primary) !important;
}

/* Hover states for custom icons */
.sidebar-btn .icon.custom-icon:hover,
.input-btn .icon.custom-icon:hover,
.chat-options .icon.custom-icon:hover {
  opacity: 0.8;
}

/* ===== UTILITY CLASSES ===== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.fade-in {
  animation: fadeIn 0.3s ease-in-out;
}

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

.slide-in {
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

/* ===== RESPONSIVE BREAKPOINTS ===== */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .main-content {
    margin-left: 0;
  }
}