* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #F5F5F5;
  display: flex;
  height: 100vh;
  margin: 0;
  overflow: hidden;
}

/* Sidebar Styles */
.sidebar {
  width: 280px;
  background: #FFFFFF;
  border-right: 1px solid #E5E5E5;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
  z-index: 1000;
  position: relative;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid #E5E5E5;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.back-to-home-btn {
    position: fixed;
    top: 80px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    color: #374151;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1002;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.back-to-home-btn:hover {
    background: #6366f1;
    color: white;
    border-color: #6366f1;
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.back-to-home-btn svg {
    width: 20px;
    height: 20px;
}

@media (max-width: 768px) {
    .back-to-home-btn {
        top: 70px;
        right: 15px;
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .back-to-home-btn svg {
        width: 18px;
        height: 18px;
    }
}

@media (max-width: 480px) {
    .back-to-home-btn {
        top: 60px;
        right: 10px;
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .back-to-home-btn span {
        display: none;
    }
    
    .back-to-home-btn svg {
        width: 20px;
        height: 20px;
    }
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  font-weight: 600;
  color: #1F1F1F;
}

.sidebar-close {
  display: none;
  border: none;
  background: transparent;
  color: #666;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
}

.sidebar-close:hover {
  background: #F5F5F5;
}

.sidebar-content {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: #666;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s ease;
  font-size: 15px;
}

.nav-item:hover {
  background: #F5F5F5;
  color: #1F1F1F;
}

.sidebar-auth {
  margin-top: 30px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-login,
.btn-signup {
  padding: 12px 16px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-login {
  background: #6366F1;
  color: white;
}

.btn-login:hover {
  background: #5558E3;
}

.btn-signup {
  background: transparent;
  color: #666;
  border: 1px solid #E5E5E5;
}

.btn-signup:hover {
  background: #F5F5F5;
}

.sidebar-footer {
  padding: 20px;
  border-top: 1px solid #E5E5E5;
}

.ai-models-card {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #F5F5F5;
}

.ai-text h4 {
  font-size: 14px;
  font-weight: 600;
  color: #1F1F1F;
  margin-bottom: 4px;
}

.ai-link {
  font-size: 13px;
  color: #6366F1;
  text-decoration: none;
}

.ai-link:hover {
  text-decoration: underline;
}

/* Sidebar Overlay for mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
  opacity: 1;
}

/* Chat Container */
.chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #FFFFFF;
  overflow: hidden;
}

.chat-header {
  background: #FFFFFF;
  border-bottom: 1px solid #E5E5E5;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.menu-toggle {
  display: none;
  border: none;
  background: transparent;
  color: #666;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.menu-toggle:hover {
  background: #F5F5F5;
  color: #1F1F1F;
}

.header-title {
  font-size: 18px;
  font-weight: 500;
  color: #1F1F1F;
}

.screenshot-btn {
  border: none;
  background: transparent;
  color: #666666;
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s ease;
  gap: 6px;
}

.screenshot-btn:hover {
  background: #F5F5F5;
  color: #CC9B7A;
}

.screenshot-btn:active {
  transform: scale(0.95);
}

.screenshot-btn.capturing {
  background: #CC9B7A;
  color: #FFFFFF;
  pointer-events: none;
}

.chat-messages {
  flex-grow: 1;
  padding: 24px;
  background: #FFFFFF;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
  width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: #D0D0D0;
  border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: #B0B0B0;
}

.welcome-message {
  text-align: center;
  margin: 100px auto;
  max-width: 500px;
}

.welcome-message h2 {
  font-size: 28px;
  font-weight: 400;
  color: #1F1F1F;
  margin-bottom: 12px;
}

.welcome-message p {
  font-size: 16px;
  color: #666666;
  line-height: 1.5;
}

.message {
  display: flex;
  margin-bottom: 24px;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.user { 
  justify-content: flex-end; 
}

.assistant { 
  justify-content: flex-start; 
}

.bubble {
  padding: 12px 16px;
  border-radius: 18px;
  max-width: 75%;
  line-height: 1.6;
  font-size: 15px;
  word-wrap: break-word;
}

.user .bubble {
  background: #2F2F2F;
  color: #FFFFFF;
  border-bottom-right-radius: 4px;
}

.assistant .bubble {
  background: #F5F5F5;
  color: #1F1F1F;
  border-bottom-left-radius: 4px;
}

.thinking {
  font-style: italic;
  color: #666666;
}

.chat-input-container {
  padding: 16px 24px 24px;
  background: #FFFFFF;
  border-top: 1px solid #E5E5E5;
}

.chat-input {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #F5F5F5;
  border: 1px solid #E5E5E5;
  border-radius: 24px;
  padding: 8px 8px 8px 16px;
  transition: all 0.2s ease;
}

.chat-input:focus-within {
  border-color: #CC9B7A;
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(204, 155, 122, 0.1);
}

.chat-input input[type="text"] {
  flex-grow: 1;
  padding: 8px 0;
  border: none;
  background: transparent;
  outline: none;
  font-size: 15px;
  color: #1F1F1F;
}

.chat-input input[type="text"]::placeholder {
  color: #999999;
}

.icon-btn {
  border: none;
  background: transparent;
  color: #666666;
  padding: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.icon-btn:hover {
  background: #E5E5E5;
  color: #1F1F1F;
}

.send-btn {
  border: none;
  background: #CC9B7A;
  color: #FFFFFF;
  padding: 10px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.send-btn:hover {
  background: #B88A6A;
  transform: scale(1.05);
}

.send-btn:active {
  transform: scale(0.95);
}

.send-btn:disabled {
  background: #D0D0D0;
  cursor: not-allowed;
  transform: none;
}

.error-message {
  background: #FEE !important;
  color: #C00 !important;
  border: 1px solid #FCC;
}

/* Screenshot notification */
.screenshot-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #2F2F2F;
  color: #FFFFFF;
  padding: 16px 20px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  animation: slideInRight 0.3s ease-out;
  display: flex;
  align-items: center;
  gap: 12px;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.screenshot-notification.success {
  background: #4CAF50;
}

.screenshot-notification.error {
  background: #F44336;
}

/* Tablet Styles (768px - 1024px) */
@media (max-width: 1024px) {
  .sidebar {
    width: 260px;
  }

  .chat-messages {
    padding: 20px;
  }

  .bubble {
    max-width: 80%;
  }
}

/* Mobile Styles (max-width: 768px) */
@media (max-width: 768px) {
  body {
    display: block;
  }

  /* Hide sidebar by default on mobile */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    transform: translateX(-100%);
    z-index: 1001;
  }

  .sidebar.active {
    transform: translateX(0);
  }

  .sidebar-close {
    display: block;
  }

  .sidebar-overlay {
    display: block;
  }

  /* Show menu toggle on mobile */
  .menu-toggle {
    display: flex;
  }

  .chat-container {
    width: 100%;
    height: 100vh;
    border-radius: 0;
  }

  .chat-header {
    padding: 12px 16px;
  }

  .header-title {
    font-size: 16px;
  }

  .screenshot-btn {
    padding: 6px 8px;
  }

  .chat-messages {
    padding: 16px;
  }

  .welcome-message {
    margin: 50px auto;
    padding: 0 20px;
  }

  .welcome-message h2 {
    font-size: 24px;
  }

  .welcome-message p {
    font-size: 14px;
  }

  .bubble {
    max-width: 85%;
    font-size: 14px;
  }

  .chat-input-container {
    padding: 12px 16px 16px;
  }

  .chat-input {
    padding: 6px 6px 6px 12px;
    gap: 4px;
  }

  .chat-input input[type="text"] {
    font-size: 14px;
  }

  .icon-btn {
    padding: 6px;
  }

  .send-btn {
    width: 36px;
    height: 36px;
  }

  .screenshot-notification {
    top: 10px;
    right: 10px;
    left: 10px;
    font-size: 14px;
  }
}

/* Small Mobile (max-width: 480px) */
@media (max-width: 480px) {
  .sidebar {
    width: 100%;
    max-width: 280px;
  }

  .chat-messages {
    padding: 12px;
  }

  .message {
    margin-bottom: 16px;
  }

  .bubble {
    max-width: 90%;
    font-size: 13px;
    padding: 10px 14px;
  }

  .chat-input {
    padding: 6px 6px 6px 10px;
  }

  .icon-btn {
    padding: 4px;
  }

  .send-btn {
    width: 32px;
    height: 32px;
    padding: 8px;
  }
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
  body {
    background: #1F1F1F;
  }

  .sidebar {
    background: #2F2F2F;
    border-right-color: #3F3F3F;
  }

  .sidebar-header {
    border-bottom-color: #3F3F3F;
  }

  .sidebar-logo {
    color: #FFFFFF;
  }

  .sidebar-close {
    color: #B0B0B0;
  }

  .sidebar-close:hover {
    background: #3F3F3F;
  }

  .nav-item {
    color: #B0B0B0;
  }

  .nav-item:hover {
    background: #3F3F3F;
    color: #FFFFFF;
  }

  .btn-signup {
    color: #B0B0B0;
    border-color: #4F4F4F;
  }

  .btn-signup:hover {
    background: #3F3F3F;
  }

  .sidebar-footer {
    border-top-color: #3F3F3F;
  }

  .ai-icon {
    background: #3F3F3F;
  }

  .ai-text h4 {
    color: #FFFFFF;
  }

  .chat-container {
    background: #2F2F2F;
  }

  .chat-header {
    background: #2F2F2F;
    border-bottom-color: #3F3F3F;
  }

  .menu-toggle {
    color: #B0B0B0;
  }

  .menu-toggle:hover {
    background: #3F3F3F;
    color: #FFFFFF;
  }

  .header-title {
    color: #FFFFFF;
  }

  .screenshot-btn {
    color: #B0B0B0;
  }

  .screenshot-btn:hover {
    background: #3F3F3F;
    color: #CC9B7A;
  }

  .chat-messages {
    background: #2F2F2F;
  }

  .welcome-message h2 {
    color: #FFFFFF;
  }

  .welcome-message p {
    color: #B0B0B0;
  }

  .assistant .bubble {
    background: #3F3F3F;
    color: #FFFFFF;
  }

  .chat-input-container {
    background: #2F2F2F;
    border-top-color: #3F3F3F;
  }

  .chat-input {
    background: #3F3F3F;
    border-color: #4F4F4F;
  }

  .chat-input:focus-within {
    background: #3F3F3F;
    border-color: #CC9B7A;
  }

  .chat-input input[type="text"] {
    color: #FFFFFF;
  }

  .chat-input input[type="text"]::placeholder {
    color: #808080;
  }

  .icon-btn {
    color: #B0B0B0;
  }

  .icon-btn:hover {
    background: #4F4F4F;
    color: #FFFFFF;
  }
}