/* Tailwind CSS Variables - Custom Theme from tweakcn */
:root {
    --background: #f7f9fa;
    --foreground: #333333;
    --card: #ffffff;
    --card-foreground: #333333;
    --popover: #ffffff;
    --popover-foreground: #333333;
    --primary: #ffc0cb;
    --primary-foreground: #000000;
    --secondary: #87ceeb;
    --secondary-foreground: #000000;
    --muted: #ddd9c4;
    --muted-foreground: #6e6e6e;
    --accent: #ffff00;
    --accent-foreground: #000000;
    --destructive: #ef4444;
    --destructive-foreground: #ffffff;
    --border: #d4d4d4;
    --input: #d4d4d4;
    --ring: #ffc0cb;
    --font-sans: Poppins, sans-serif;
    --font-serif: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
    --font-mono: Roboto Mono, monospace;
    --radius: 0.5rem;
  }
  
  .dark {
    --background: #1a1d23;
    --foreground: #e5e5e5;
    --card: #2f3436;
    --card-foreground: #e5e5e5;
    --popover: #2f3436;
    --popover-foreground: #e5e5e5;
    --primary: #ffc21a;
    --primary-foreground: #000000;
    --secondary: #33cc33;
    --secondary-foreground: #000000;
    --muted: #444444;
    --muted-foreground: #a3a3a3;
    --accent: #87ceeb;
    --accent-foreground: #000000;
    --destructive: #ef4444;
    --destructive-foreground: #ffffff;
    --border: #444444;
    --input: #444444;
    --ring: #ff99cc;
    --font-sans: Poppins, sans-serif;
    --font-serif: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
    --font-mono: Roboto Mono, monospace;
    --radius: 0.5rem;
  }
  
  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  
  body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Poppins', Roboto, sans-serif;
    background: var(--background);
    height: 100vh;
    height: -webkit-fill-available;
    color: var(--foreground);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    overflow: hidden;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    transition: background 0.3s ease, color 0.3s ease;
  }
  
  .dark body {
    background: linear-gradient(135deg, #0a0e14 0%, #1a1f2e 100%);
  }
  
  /* Theme Toggle Button */
  .theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  }
  
  .theme-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  }
  
  .container {
    width: 100%;
    max-width: 1200px;
    height: 90vh;
    display: flex;
    flex-direction: column;
    padding: 20px;
    gap: 20px;
  }
  
  .greeting {
    text-align: center;
    padding: 20px 0;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }
  
  .greeting h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
  }
  
  .chat-container {
    width: 100%;
    flex: 1;
    margin: 0 auto 20px auto;
    padding: 24px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  }
  
  .search-container {
    width: 100%;
    flex-shrink: 0;
    margin: 0 auto 20px auto;
    position: relative;
    z-index: 100;
  }
  
  .search-box {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 0.5rem);
    padding: 12px 12px 12px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
  }
  
  .search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 4px 30px rgba(255, 194, 26, 0.3);
  }
  
  #messageInput {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--foreground);
    font-size: 1rem;
    outline: none;
    padding: 12px 0;
  }
  
  #messageInput:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }
  
  #messageInput::placeholder {
    color: var(--muted-foreground);
  }
  
  .search-actions {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  
  .action-btn {
    background: transparent;
    border: none;
    color: var(--foreground);
    padding: 12px 20px;
    border-radius: calc(var(--radius) + 0.25rem);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
  }
  
  .action-btn:hover:not(:disabled) {
    background: var(--muted);
    transform: translateY(-1px);
  }
  
  .action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }
  
  .mode-btn {
    background: var(--muted);
  }
  
  .mode-btn.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: var(--primary-foreground);
    box-shadow: 0 4px 15px rgba(255, 194, 26, 0.4);
  }
  
  .mode-btn .icon {
    font-size: 1.1rem;
  }
  
  .suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    flex-shrink: 0;
    margin: 0 auto;
    padding-bottom: 20px;
  }
  
  .suggestion-btn {
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--foreground);
    padding: 14px 20px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
  }
  
  .suggestion-btn:hover {
    background: var(--muted);
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(255, 194, 26, 0.2);
  }
  
  .suggestion-icon {
    font-size: 1.1rem;
  }
  
  .message {
    margin-bottom: 24px;
    animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  @keyframes fadeIn {
    from {
      opacity: 0;
      transform: translateY(15px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  .message-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    gap: 12px;
  }
  
  .user-name {
    font-weight: 600;
    color: var(--foreground);
    font-size: 0.9rem;
  }
  
  .timestamp {
    font-size: 0.75rem;
    color: var(--muted-foreground);
  }
  
  .message-bubble {
    background: var(--muted);
    padding: 16px 20px;
    border-radius: var(--radius);
    max-width: 80%;
    word-wrap: break-word;
    color: var(--foreground);
    line-height: 1.6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  }
  
  .message.user .message-bubble {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: var(--primary-foreground);
    margin-left: auto;
    font-weight: 500;
  }
  
  .message.ai .message-bubble {
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--foreground);
  }
  
  /* Wskaznik pisania */
  .typing-indicator {
    margin-bottom: 24px;
    animation: fadeIn 0.3s ease-in;
  }
  
  .typing-indicator .message-bubble {
    display: flex;
    gap: 6px;
    padding: 14px 20px;
    background: var(--card);
    border: 1px solid var(--border);
  }
  
  .typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    animation: typingDot 1.4s infinite;
  }
  
  .typing-dot:nth-child(2) {
    animation-delay: 0.2s;
  }
  
  .typing-dot:nth-child(3) {
    animation-delay: 0.4s;
  }
  
  @keyframes typingDot {
    0%, 60%, 100% {
      transform: translateY(0);
      opacity: 0.4;
    }
    30% {
      transform: translateY(-8px);
      opacity: 1;
    }
  }
  
  /* Przyciski sugestii w chacie */
  .suggestion-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
    animation: fadeIn 0.4s ease-in;
  }
  
  .suggestion-btn-inline {
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--foreground);
    padding: 10px 16px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
  }
  
  .suggestion-btn-inline:hover {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: var(--primary-foreground);
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 194, 26, 0.3);
  }
  
  /* Scrollbar styling */
  .chat-container::-webkit-scrollbar {
    width: 10px;
  }
  
  .chat-container::-webkit-scrollbar-track {
    background: var(--card);
    border-radius: var(--radius);
  }
  
  .chat-container::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: var(--radius);
  }
  
  .chat-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
  }
  
  /* Responsive */
  @media (max-width: 768px) {
    body {
      position: fixed;
      width: 100%;
      height: 100vh;
      height: -webkit-fill-available;
      overflow: hidden;
      align-items: flex-start;
      padding-top: 10px;
    }
  
    .container {
      height: calc(100vh - 20px);
      padding: 10px;
      padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 10px);
      gap: 12px;
    }
  
    .greeting {
      padding: 10px 0;
    }
  
    .greeting h1 {
      font-size: 1.8rem;
    }
  
    .chat-container {
      flex: 1;
      margin-bottom: 10px;
      padding: 16px;
    }
  
    .search-container {
      margin-bottom: 10px;
    }
    
    .search-box {
      padding: 10px 10px 10px 16px;
    }
  
    #messageInput {
      font-size: 16px;
      padding: 10px 0;
    }
    
    .mode-btn .label {
      display: none;
    }
  
    .mode-btn {
      padding: 10px 14px;
    }
    
    .suggestions {
      gap: 8px;
      padding-bottom: 10px;
      overflow-y: auto;
      max-height: 140px;
    }
    
    .suggestion-btn {
      font-size: 0.85rem;
      padding: 10px 14px;
    }
  
    .message-bubble {
      max-width: 90%;
      font-size: 0.95rem;
    }
  
    .suggestion-btn-inline {
      font-size: 0.8rem;
      padding: 8px 12px;
    }
  }
  
  /* Bardzo małe ekrany */
  @media (max-width: 400px) {
    .container {
      padding: 8px;
      gap: 10px;
    }
  
    .greeting h1 {
      font-size: 1.5rem;
    }
  
    .search-box {
      padding: 8px 8px 8px 12px;
    }
  
    .chat-container {
      padding: 12px;
    }
  
    .suggestion-btn {
      font-size: 0.8rem;
      padding: 8px 12px;
    }
  
    .suggestions {
      max-height: 120px;
    }
  }