* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter",
    sans-serif;
  background: #0b0b0b;
  color: #ffffff;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Container and Layout */
.container {
  display: flex;
  min-height: 100vh;
  background: radial-gradient(
    ellipse at top,
    #1a1a2e 0%,
    #0b0b0b 50%,
    #000000 100%
  );
}

.sidebar {
  width: 280px;
  background: rgba(17, 17, 28, 0.95);
  backdrop-filter: blur(20px);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1.5rem;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
}

.main-content {
  margin-left: 280px;
  flex: 1;
  padding: 2rem;
  background: transparent;
}

/* Logo Section */
.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-align: left;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.logo-image {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 8px rgba(99, 102, 241, 0.3));
}

.logo-text {
  flex: 1;
}

.logo-text h1 {
  color: #ffffff;
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  letter-spacing: -0.025em;
}

.logo-text p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
  font-weight: 400;
  margin: 0;
}

/* Tool Menu */
.tool-menu {
  list-style: none;
}

.tool-item {
  margin-bottom: 0.25rem;
}

.tool-button {
  width: 100%;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  padding: 0.75rem 1rem;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-align: left;
  font-size: 0.9rem;
  font-weight: 500;
  position: relative;
  overflow: hidden;
}

.tool-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.05) 0%,
    rgba(255, 255, 255, 0.02) 100%
  );
  opacity: 0;
  transition: opacity 0.2s ease;
}

.tool-button:hover::before,
.tool-button.active::before {
  opacity: 1;
}

.tool-button:hover {
  color: #ffffff;
  transform: translateX(2px);
}

.tool-button.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.tool-icon {
  font-size: 1rem;
  width: 20px;
  text-align: center;
  opacity: 0.9;
}

/* Clear Chat Button */
.clear-chat-btn {
  width: 100%;
  background: linear-gradient(135deg, #ff4757 0%, #ff3742 100%);
  color: white;
  border: none;
  padding: 0.75rem;
  border-radius: 10px;
  cursor: pointer;
  margin-top: 2rem;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(255, 71, 87, 0.2);
}

.clear-chat-btn:hover {
  background: linear-gradient(135deg, #ff3742 0%, #ff2635 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255, 71, 87, 0.3);
}

/* Main Header */
.main-header {
  text-align: left;
  margin-bottom: 2rem;
  padding: 0;
  background: transparent;
}

.main-header h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: #ffffff;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.main-header p {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 400;
  line-height: 1.5;
}

/* Chat Container */
.chat-container {
  background: rgba(17, 17, 28, 0.7);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  min-height: 400px;
  max-height: 600px;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Messages */
.message {
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
  border-radius: 14px;
  max-width: 85%;
  word-wrap: break-word;
  position: relative;
  line-height: 1.6;
  animation: messageSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.message.user {
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.2) 0%,
    rgba(139, 92, 246, 0.2) 100%
  );
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #ffffff;
  margin-left: auto;
  text-align: left;
}

.message.assistant {
  background: rgba(30, 30, 46, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.message-content h1,
.message-content h2,
.message-content h3 {
  color: #ffffff;
  margin: 1rem 0 0.5rem 0;
}

.message-content h1 {
  font-size: 1.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 0.5rem;
}

.message-content h2 {
  font-size: 1.2rem;
}

.message-content h3 {
  font-size: 1.1rem;
}

.message-content p {
  margin: 0.5rem 0;
  line-height: 1.6;
}

.message-content ul {
  margin: 0.5rem 0;
  padding-left: 1.5rem;
}

.message-content li {
  margin: 0.3rem 0;
  line-height: 1.5;
}

.message-content strong {
  color: #ffffff;
  font-weight: 600;
}

.message-content .inline-code {
  background: rgba(0, 0, 0, 0.6);
  color: #e2e8f0;
  padding: 3px 6px;
  border-radius: 6px;
  font-family: "SF Mono", "Monaco", "Inconsolata", "Roboto Mono", monospace;
  font-size: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Copy Button */
.copy-button {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  transition: all 0.2s ease;
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  backdrop-filter: blur(10px);
}

.copy-button:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

/* Input Container */
.input-container {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.chat-input {
  flex: 1;
  background: rgba(17, 17, 28, 0.8);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  padding: 1rem;
  border-radius: 14px;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  outline: none;
}

.chat-input:focus {
  border-color: rgba(99, 102, 241, 0.5);
  background: rgba(17, 17, 28, 0.9);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.chat-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

/* Buttons */
.send-button {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  border: none;
  padding: 1rem 1.5rem;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}

.send-button:hover {
  background: linear-gradient(135deg, #5b5fed 0%, #8750f2 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(99, 102, 241, 0.4);
}

.send-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.primary-button {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  border: none;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.2);
}

.primary-button:hover {
  background: linear-gradient(135deg, #5b5fed 0%, #8750f2 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(99, 102, 241, 0.3);
}

.primary-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.download-button {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 500;
  margin-top: 1rem;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
}

.download-button:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

/* Form Elements */
.form-container {
  background: rgba(17, 17, 28, 0.7);
  backdrop-filter: blur(20px);
  padding: 2rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 2rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #ffffff;
  font-size: 0.9rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  padding: 0.75rem;
  border-radius: 10px;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: rgba(99, 102, 241, 0.5);
  background: rgba(0, 0, 0, 0.5);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

/* Output Container */
.output-container {
  background: rgba(17, 17, 28, 0.7);
  backdrop-filter: blur(20px);
  padding: 2rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 2rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

/* Code Block */
.code-block {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 0;
  margin: 1rem 0;
  font-family: "SF Mono", "Monaco", "Inconsolata", "Roboto Mono", monospace;
  overflow-x: auto;
  position: relative;
}

.code-block pre {
  margin: 0;
  padding: 1rem;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.code-block code {
  background: none;
  color: #e2e8f0;
  font-size: 0.9rem;
  line-height: 1.4;
}

/* Loading Animation */
.loading {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  border-top-color: #6366f1;
  animation: spin 1s ease-in-out infinite;
}

/* File Upload */
.file-upload {
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  background: rgba(17, 17, 28, 0.4);
  backdrop-filter: blur(20px);
  transition: all 0.2s ease;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.8);
}

.file-upload:hover {
  border-color: rgba(99, 102, 241, 0.5);
  background: rgba(17, 17, 28, 0.6);
  color: #ffffff;
}

.file-upload.drag-over {
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.1);
  color: #ffffff;
}

/* Alerts */
.alert {
  padding: 1rem;
  border-radius: 12px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  backdrop-filter: blur(20px);
  border: 1px solid transparent;
}

.alert.success {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.2);
  color: #10b981;
}

.alert.error {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.alert.warning {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.alert.info {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

/* Animations */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Range Input Styling */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
  height: 6px;
  border-radius: 3px;
}

input[type="range"]::-webkit-slider-track {
  background: rgba(255, 255, 255, 0.2);
  height: 6px;
  border-radius: 3px;
  border: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  height: 20px;
  width: 20px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

input[type="range"]::-moz-range-track {
  background: rgba(255, 255, 255, 0.2);
  height: 6px;
  border-radius: 3px;
  border: none;
}

input[type="range"]::-moz-range-thumb {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  height: 20px;
  width: 20px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* Word Count Display */
#word-count-display {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  margin-top: 0.5rem;
  display: inline-block;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Table Styling for CSV Preview */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  overflow: hidden;
}

th,
td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

th {
  background: rgba(99, 102, 241, 0.2);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.9rem;
}

td {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.85rem;
}

tr:last-child td {
  border-bottom: none;
}

/* Dashboard Styles */
.dashboard-header {
  text-align: center;
  margin-bottom: 3rem;
  padding: 3rem 2rem;
}

.dashboard-logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  margin-bottom: 1.5rem;
  filter: drop-shadow(0 4px 16px rgba(99, 102, 241, 0.4));
}

.dashboard-header h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: #ffffff;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(
    135deg,
    #ffffff 0%,
    rgba(255, 255, 255, 0.8) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.dashboard-header p {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.7);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.tool-card {
  background: rgba(17, 17, 28, 0.7);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 2rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.tool-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.1) 0%,
    rgba(139, 92, 246, 0.1) 100%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}

.tool-card:hover::before {
  opacity: 1;
}

.tool-card:hover {
  transform: translateY(-4px);
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 12px 40px rgba(99, 102, 241, 0.2);
}

.tool-card-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
}

.tool-card h3 {
  color: #ffffff;
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  position: relative;
  z-index: 1;
}

.tool-card p {
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.6;
  font-size: 0.95rem;
  position: relative;
  z-index: 1;
}

.dashboard-footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.stats-container {
  display: flex;
  justify-content: center;
  gap: 4rem;
}

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

.stat-item h4 {
  font-size: 2.5rem;
  color: #ffffff;
  font-weight: 700;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-item p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Mobile Responsiveness for Dashboard */
@media (max-width: 768px) {
  .dashboard-header {
    padding: 2rem 1rem;
  }

  .dashboard-header h1 {
    font-size: 2rem;
  }

  .dashboard-header p {
    font-size: 1rem;
  }

  .dashboard-logo {
    width: 60px;
    height: 60px;
  }

  .tools-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .tool-card {
    padding: 1.5rem;
  }

  .stats-container {
    gap: 2rem;
  }

  .stat-item h4 {
    font-size: 2rem;
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    position: relative;
    height: auto;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .main-content {
    margin-left: 0;
    padding: 1rem;
  }

  .container {
    flex-direction: column;
  }

  .main-header h1 {
    font-size: 1.5rem;
  }

  .message {
    max-width: 95%;
    padding: 0.75rem 1rem;
  }

  .input-container {
    flex-direction: column;
    gap: 0.75rem;
  }

  .send-button {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .sidebar {
    padding: 1rem;
  }

  .main-content {
    padding: 0.75rem;
  }

  .form-container,
  .output-container {
    padding: 1.25rem;
  }

  .chat-container {
    padding: 1rem;
    min-height: 300px;
  }
}

/* Hidden class */
.hidden {
  display: none;
}

/* Focus styles for accessibility */
button:focus,
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid rgba(99, 102, 241, 0.5);
  outline-offset: 2px;
}

/* Selection styling */
::selection {
  background: rgba(99, 102, 241, 0.3);
  color: #ffffff;
}
