@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --bg: #f9fafb;
  --sidebar-bg: #111827;
  --sidebar-text: #d1d5db;
  --card-bg: #ffffff;
  --text-main: #111827;
}

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

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text-main);
  display: flex;
  min-height: 100vh;
  flex-direction: row;
}

.sidebar {
  width: 240px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  padding: 30px 20px;
}

.sidebar h1 {
  color: #fff;
  font-size: 22px;
  margin-bottom: 40px;
  font-weight: 700;
}

.sidebar a {
  text-decoration: none;
  color: var(--sidebar-text);
  margin: 15px 0;
  font-weight: 500;
  transition: 0.3s;
}

.sidebar a:hover {
  color: #fff;
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: #fff;
  padding: 20px 30px;
  border-bottom: 1px solid #e5e7eb;
  font-weight: 600;
  font-size: 18px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
}

.content {
  padding: 40px;
  flex: 1;
}

.card {
  background: var(--card-bg);
  padding: 30px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  max-width: 1000px;
  margin: 0 auto;
}

label {
  font-weight: 500;
  margin-bottom: 8px;
  display: block;
}

input,
textarea {
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 20px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #f9fafb;
  font-size: 15px;
}

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

button {
  padding: 14px 28px;
  font-weight: 600;
  font-size: 16px;
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: 0.3s;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

button:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.question-block {
  background: var(--card-bg);
  padding: 25px;
  border-radius: 16px;
  margin-bottom: 30px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: #eee;
  border-radius: 5px;
  margin-top: 10px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: #4caf50;
  width: 0%;
  transition: width 0.3s ease;
}

.typewriter {
  white-space: pre-wrap;
  margin-top: 10px;
}

/* Overlay Modal */
.ollama-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  padding: 2rem;
  overflow: hidden;
  transition: background 0.3s ease;
}

.ollama-modal-content {
  background: #56bac7;
  border-radius: 20px;
  width: 92%;
  max-width: 1000px;
  height: 90vh;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2.5rem 2rem 2rem;
  animation: fadeInModal 0.35s ease-out;
  font-family: 'Inter', 'Segoe UI', sans-serif;
  scroll-behavior: smooth;
  position: relative;
}

.ollama-modal-close {
  position: absolute;
  top: 1rem;
  right: 1.2rem;
  font-size: 1.5rem;
  color: #999;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color 0.3s ease;
}

.ollama-modal-close:hover {
  color: #333;
}

.ollama-modal-content::-webkit-scrollbar {
  width: 10px;
}
.ollama-modal-content::-webkit-scrollbar-track {
  background: #f0f0f0;
  border-radius: 10px;
}
.ollama-modal-content::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 10px;
}
.ollama-modal-content::-webkit-scrollbar-thumb:hover {
  background: #a5a5a5;
}

.ollama-modal-content h2 {
  font-size: 2.25rem;
  margin-bottom: 1.5rem;
  color: #222;
  text-align: center;
}

.ollama-modal-content a {
  color: #0d6efd;
  text-decoration: none;
  font-weight: 600;
  word-break: break-word;
}
.ollama-modal-content a:hover {
  text-decoration: underline;
  color: #0a58ca;
}

.ollama-modal-content button {
  background: linear-gradient(135deg, #0d6efd, #2563eb);
  color: #fff;
  border: none;
  padding: 0.85rem 1.6rem;
  font-size: 1rem;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 2rem;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(13, 110, 253, 0.2);
}
.ollama-modal-content button:hover {
  background: #084298;
  box-shadow: 0 6px 20px rgba(13, 110, 253, 0.3);
}

.ollama-modal-content pre {
  background: #f4f4f4;
  padding: 1rem;
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: 'Courier New', monospace;
  overflow-x: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.ollama-steps {
  list-style: none;
  padding-left: 0;
  margin-top: 1.5rem;
}

.ollama-steps li {
  margin-bottom: 1.75rem;
  background: #f8f9fa;
  border-left: 5px solid #0d6efd;
  padding: 1.25rem 1rem;
  border-radius: 12px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s ease;
}
.ollama-steps li:hover {
  transform: translateY(-2px);
}
.ollama-steps li strong {
  display: block;
  margin-bottom: 0.6rem;
  color: #333;
  font-size: 1.05rem;
}

.ollama-steps img {
  width: 100%;
  border-radius: 10px;
  margin-top: 0.75rem;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease;
}
.ollama-steps img:hover {
  transform: scale(1.015);
}

@keyframes fadeInModal {
  0% {
    opacity: 0;
    transform: scale(0.96);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.menu-toggle {
  background: none;
  border: none;
  font-size: 1.8rem;
  color: var(--primary);
  cursor: pointer;
  display: none;
}

@media (max-width: 768px) {
  body {
    flex-direction: column;
  }

  .menu-toggle {
    display: block;
    margin: 1rem;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: -240px;
    height: 100vh;
    z-index: 2000;
    transition: left 0.3s ease;
  }

  .sidebar.show {
    left: 0;
  }

  .overlay-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1999;
  }

  .overlay-backdrop.active {
    display: block;
  }

  .main {
    width: 100%;
    margin-left: 0;
  }

  .topbar {
    padding: 15px;
    font-size: 16px;
  }

  .content {
    padding: 20px;
  }

  .card {
    padding: 20px;
    margin: 10px;
  }

  input,
  textarea {
    font-size: 14px;
    padding: 12px;
  }

  .ollama-modal-content {
    width: 95%;
    height: 94vh;
    padding: 1.5rem 1rem;
  }

  .ollama-modal-content h2 {
    font-size: 1.75rem;
  }

  .ollama-modal-content button {
    width: 100%;
  }

  .ollama-steps li {
    padding: 1rem;
  }

  .topbar,
  .sidebar {
    flex-wrap: wrap;
  }
}
