/* ==================== INSTA FOOLS DESIGN SYSTEM VARIABLES ==================== */

:root {
  /* Fonts */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-logo: 'Grand Hotel', cursive;

  /* Theme: Light Mode (Default) */
  --bg-primary: #ffffff;
  --bg-secondary: #fafafa;
  --bg-secondary-hover: #f0f0f0;
  --bg-input: #efefef;
  --bg-input-focus: #fafafa;
  --bg-modal: #ffffff;
  --bg-overlay: rgba(0, 0, 0, 0.65);
  
  --border-primary: #dbdbdb;
  --border-secondary: #efefef;
  --border-focus: #a8a8a8;
  
  --text-primary: #262626;
  --text-secondary: #737373;
  --text-tertiary: #a8a8a8;
  --text-link: #0095f6;
  --text-link-hover: #00376b;
  
  --accent-blue: #0095f6;
  --accent-blue-hover: #1877f2;
  --accent-red: #ed4956;
  --accent-red-hover: #c92f3c;
  
  --story-border-gradient: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  --story-border-gray: #dbdbdb;
  
  /* Chat bubbles colors */
  --bubble-received: #efefef;
  --bubble-received-text: #262626;
  --bubble-sent: #3797f0;
  --bubble-sent-text: #ffffff;
  
  /* Box Shadow */
  --shadow-primary: 0 4px 12px rgba(0, 0, 0, 0.05);
  --shadow-modal: 0 8px 30px rgba(0, 0, 0, 0.15);
  --shadow-setup: 0 10px 40px rgba(0, 0, 0, 0.3);

  /* Layout dimensions */
  --sidebar-width: 244px;
  --sidebar-width-narrow: 72px;
  --header-mobile-height: 60px;
  --nav-mobile-height: 50px;
  --content-max-width: 935px;
  --border-radius-sm: 4px;
  --border-radius-md: 8px;
  --border-radius-lg: 12px;
  --border-radius-pill: 9999px;

  /* Transitions */
  --transition-fast: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --transition-normal: all 0.25s ease;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Theme Override: Dark Mode */
body.dark-theme {
  --bg-primary: #121212;
  --bg-secondary: #000000;
  --bg-secondary-hover: #1a1a1a;
  --bg-input: #1c1c1e;
  --bg-input-focus: #2c2c2e;
  --bg-modal: #262626;
  --bg-overlay: rgba(0, 0, 0, 0.85);
  
  --border-primary: #262626;
  --border-secondary: #1c1c1e;
  --border-focus: #48484a;
  
  --text-primary: #f5f5f7;
  --text-secondary: #a1a1a6;
  --text-tertiary: #636366;
  --text-link: #0095f6;
  --text-link-hover: #3a9efd;
  
  --bubble-received: #262626;
  --bubble-received-text: #f5f5f7;
  --bubble-sent: #0095f6;
  --bubble-sent-text: #ffffff;
  
  --shadow-primary: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-modal: 0 8px 30px rgba(0, 0, 0, 0.5);
  --story-border-gray: #262626;
}

/* Global resets and helper selectors */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: hidden;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

a {
  color: var(--text-link);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--text-link-hover);
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  color: inherit;
  transition: var(--transition-fast);
}

button:focus {
  outline: none;
}

input, textarea {
  font-family: inherit;
  color: inherit;
  border: 1px solid var(--border-primary);
  background-color: var(--bg-input);
  border-radius: var(--border-radius-sm);
  transition: var(--transition-fast);
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  background-color: var(--bg-input-focus);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul {
  list-style: none;
}

/* Skeleton Loading Animation */
.skeleton {
  background: linear-gradient(90deg, var(--bg-input) 25%, var(--bg-secondary-hover) 50%, var(--bg-input) 75%);
  background-size: 200% 100%;
  animation: loading-skeleton 1.5s infinite;
}

@keyframes loading-skeleton {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Helper Utilities */
.hidden {
  display: none !important;
}

.avatar-placeholder {
  object-fit: cover;
  border-radius: var(--border-radius-pill);
}

.error-text {
  color: var(--accent-red);
  font-size: 0.85rem;
  margin-top: 4px;
}
