styles.css

12.94 KB
23/10/2025 03:12
CSS
styles.css
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: 'Kanit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: #F9F9F9;
  color: #1f2937;
  line-height: 1.7;
  min-height: 100vh;
  padding: 20px;
  font-weight: 400;
}
.container {
  max-width: 1440px !important;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 20px;
  box-shadow: 0 25px 60px rgba(30, 58, 138, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.1);
  overflow: hidden;
  backdrop-filter: blur(20px);
}
header {
  background: linear-gradient(135deg, #1e3a8a 0%, #3730a3 25%, #1e40af 50%, #1d4ed8 75%, #2563eb 100%);
  color: white;
  padding: 50px 30px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
header h1 {
  font-size: 3rem;
  margin-bottom: 15px;
  font-weight: 700;
  letter-spacing: -0.025em;
  position: relative;
  z-index: 1;
}
header p {
  font-size: 1.25rem;
  opacity: 0.95;
  font-weight: 300;
  position: relative;
  z-index: 1;
}
.content-wrapper {
  display: flex;
  min-height: 600px;
}
.sidebar {
  width: 300px;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border-right: 1px solid rgba(30, 58, 138, 0.1);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 30px 0;
}
.sidebar-item {
  padding: 16px 25px;
  cursor: pointer;
  border-left: 4px solid transparent;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 500;
  color: #64748b;
  font-size: 1rem;
  margin: 2px 0;
  position: relative;
}
.sidebar-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: linear-gradient(135deg, #1e40af, #2563eb);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 0 4px 4px 0;
}
.sidebar-item:hover {
  background: rgba(37, 99, 235, 0.05);
  border-left-color: #2563eb;
  color: #1e40af;
  transform: translateX(2px);
}
.sidebar-item:hover::before {
  width: 4px;
}
.sidebar-item.active {
  background: linear-gradient(135deg, rgba(30, 64, 175, 0.1), rgba(37, 99, 235, 0.08));
  border-left-color: #1e40af;
  color: #1e40af;
  font-weight: 600;
}
.sidebar-item.active::before {
  width: 4px;
}
.main-content {
  flex: 1;
  padding: 50px;
  background: rgba(255, 255, 255, 0.7);
}
.content-loader {
  animation: fadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
h2 {
  color: #1e40af;
  margin-bottom: 30px;
  font-size: 2.25rem;
  font-weight: 700;
  border-bottom: 3px solid transparent;
  background: linear-gradient(90deg, #1e40af, #2563eb) left bottom;
  background-size: 100% 3px;
  background-repeat: no-repeat;
  padding-bottom: 15px;
  letter-spacing: -0.025em;
}
h3 {
  color: #1e40af;
  margin-top: 35px;
  margin-bottom: 20px;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}
p {
  margin-bottom: 18px;
  line-height: 1.8;
  font-size: 1.05rem;
}
ul, ol {
  margin-left: 30px;
  margin-bottom: 15px;
}
li {
  margin-bottom: 10px;
  color: #555;
}
/* Inline code styling */
code:not([class*="language-"]) {
  background: rgba(30, 64, 175, 0.1);
  color: #1e40af;
  padding: 3px 6px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9em;
  font-weight: 500;
}
.highlight {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  padding: 20px;
  border-left: 5px solid #f59e0b;
  margin: 25px 0;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.1);
}
.tip {
  background: linear-gradient(135deg, #dcfce7, #bbf7d0);
  padding: 20px;
  border-left: 5px solid #10b981;
  margin: 25px 0;
  border-radius: 8px;
  color: #065f46;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.1);
}
.warning {
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  padding: 20px;
  border-left: 5px solid #ef4444;
  margin: 25px 0;
  border-radius: 8px;
  color: #7f1d1d;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.1);
}
.info-box {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  padding: 20px;
  border-left: 5px solid #3b82f6;
  margin: 25px 0;
  border-radius: 8px;
  color: #1e3a8a;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  margin: 30px 0;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(30, 64, 175, 0.08);
  border: 1px solid rgba(30, 64, 175, 0.1);
}
.comparison-table th {
  background-color: #F5F5F5;
  padding: 18px 20px;
  text-align: left;
  font-weight: 600;
  font-size: 1rem;
}
.comparison-table td {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(30, 64, 175, 0.08);
  color: #374151;
}
.comparison-table tr:hover {
  background: rgba(30, 64, 175, 0.02);
}
.step-card {
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
  padding: 25px;
  margin: 20px 0;
  border-radius: 12px;
  border-left: 5px solid #1e40af;
  box-shadow: 0 2px 12px rgba(30, 64, 175, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.step-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(30, 64, 175, 0.12);
}
.step-card h4 {
  color: #1e40af;
  margin-bottom: 12px;
  font-weight: 600;
  font-size: 1.1rem;
}
.navigation {
  display: flex;
  justify-content: space-between;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #ddd;
}
.btn {
  padding: 14px 28px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  display: inline-block;
  font-family: 'Kanit', sans-serif;
  letter-spacing: -0.015em;
}
.btn-sm {
  padding: 8px 12px;
  font-size: 0.95rem;
  border-radius: 8px;
}
.code-actions {
  margin-top: 8px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.open-editor-btn {
  background: linear-gradient(90deg, #06b6d4, #2563eb);
  color: white;
  border: none;
}
.group-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}
.run-button {
  margin-left: auto;
  margin-right: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  background: linear-gradient(90deg, #10b981, #06b6d4);
  color: white;
  border: none;
  cursor: pointer;
  font-weight: 600;
}
.quiz-holder {
  flex: 1;
}
/* Quiz UI */
.quiz-header {
  font-size: 0.95rem;
  color: #374151;
  margin-bottom: 10px;
}
.quiz-question-title {
  margin: 12px 0 18px 0;
  color: #1e40af;
  font-weight: 600;
}
.quiz-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 18px;
}
.quiz-option {
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid rgba(30, 64, 175, 0.08);
  background: white;
  cursor: pointer;
  text-align: left;
  font-weight: 500;
}
.quiz-option.correct {
  background: linear-gradient(135deg, #dcfce7, #bbf7d0);
  border-color: #10b981;
}
.quiz-option.incorrect {
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  border-color: #ef4444;
}
.quiz-nav {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.quiz-summary {
  padding: 18px;
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
  border-radius: 10px;
  border: 1px solid rgba(30, 64, 175, 0.06);
}
.quiz-empty, .quiz-error {
  color: #7f1d1d;
  padding: 12px;
}
.btn-primary {
  background: linear-gradient(135deg, #1e40af, #2563eb);
  color: white;
  box-shadow: 0 4px 12px rgba(30, 64, 175, 0.2);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #1e3a8a, #1d4ed8);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(30, 64, 175, 0.3);
}
.btn-primary:active {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(30, 64, 175, 0.25);
}
.btn-primary:disabled {
  background: #9ca3af;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(30, 64, 175, 0.1);
  border-radius: 8px;
  margin-bottom: 30px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #1e40af 0%, #2563eb 50%, #3b82f6 100%);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(30, 64, 175, 0.3);
}
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
  margin: 30px 0;
}
.feature-card {
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
  padding: 25px;
  border-radius: 12px;
  border-top: 5px solid #1e40af;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 12px rgba(30, 64, 175, 0.08);
}
.feature-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 30px rgba(30, 64, 175, 0.15);
  border-top-color: #2563eb;
}
.feature-card h4 {
  color: #1e40af;
  margin-bottom: 12px;
  font-weight: 600;
  font-size: 1.1rem;
}
.feature-card p {
  color: #4b5563;
  font-size: 1rem;
  line-height: 1.6;
}
.breadcrumb {
  color: #6b7280;
  font-size: 0.95rem;
  margin-bottom: 25px;
  font-weight: 400;
}
.breadcrumb a {
  color: #1e40af;
  cursor: pointer;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}
.breadcrumb a:hover {
  color: #2563eb;
  text-decoration: underline;
}
.breadcrumb-link {
  cursor: pointer;
  color: #1e40af;
  text-decoration: none;
  font-weight: 500;
}
.breadcrumb-link:hover {
  color: #2563eb;
  text-decoration: underline;
}
/* Lists styling */
ul, ol {
  margin-left: 30px;
  margin-bottom: 20px;
}
li {
  margin-bottom: 12px;
  color: #374151;
  line-height: 1.7;
}
/* Emoji styling */
.emoji {
  font-size: 1.3em;
  margin-right: 8px;
  display: inline-block;
}
/* Navigation styling */
.navigation {
  display: flex;
  justify-content: space-between;
  margin-top: 50px;
  padding-top: 30px;
  border-top: 2px solid rgba(30, 64, 175, 0.1);
}
@media (max-width: 768px) {
  .content-wrapper {
    flex-direction: column;
    min-height: auto;
  }
  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #ddd;
    display: flex;
    overflow-x: auto;
    padding: 0;
  }
  .sidebar-item {
    padding: 15px 20px;
    border-left: none;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .sidebar-item:hover {
    border-left: none;
    border-bottom-color: #1e40af;
  }
  .sidebar-item.active {
    border-left: none;
    border-bottom-color: #1e40af;
  }
  .main-content {
    padding: 20px;
    max-height: none;
  }
  header h1 {
    font-size: 1.8rem;
  }
  header p {
    font-size: 1rem;
  }
  h2 {
    font-size: 1.5rem;
  }
  .navigation {
    flex-direction: column;
    gap: 10px;
  }
  .btn {
    width: 100%;
    text-align: center;
  }
  .comparison-table {
    font-size: 0.9rem;
  }
  .comparison-table th,
  .comparison-table td {
    padding: 10px;
  }
}
/* New polished quiz card styles */
.quiz-card {
  max-width: 740px;
  margin: 1.25rem auto;
  background: linear-gradient(180deg, #ffffff 0%, #f6fbff 100%);
  border: 1px solid #e6f0fb;
  box-shadow: 0 6px 24px rgba(2, 36, 76, 0.06);
  border-radius: 12px;
  overflow: hidden;
  font-family: 'Kanit', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
}
.quiz-card .quiz-header {
  padding: 1rem 1.25rem;
  background: linear-gradient(90deg, #e9f3ff, #eef8ff);
  border-bottom: 1px solid #e1efff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.quiz-card .quiz-title {
  font-size: 1rem;
  color: #024b8a;
  font-weight: 700;
}
.quiz-card .quiz-progress {
  font-size: 0.9rem;
  color: #0b66b3;
}
.quiz-body {
  padding: 1.25rem;
}
.quiz-question {
  font-size: 1.05rem;
  color: #022c45;
  margin-bottom: 0.75rem;
}
.quiz-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
}
.quiz-option {
  background: white;
  border: 1px solid #e6f0fb;
  padding: 0.9rem 1rem;
  border-radius: 10px;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.quiz-option:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(8, 30, 63, 0.06);
}
.quiz-option input[type="radio"] {
  display: none;
}
.quiz-option .label-text {
  flex: 1;
  color: #053054;
}
.quiz-option.correct {
  border-color: #1e9b4a;
  background: linear-gradient(90deg, #f0fff5, #f7fff8);
}
.quiz-option.wrong {
  border-color: #d9534f;
  background: linear-gradient(90deg, #fff6f6, #fff8f8);
}
.quiz-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  padding: 0.75rem 1.25rem;
  border-top: 1px solid #f0f6fb;
  background: #fbfdff;
}
.quiz-btn {
  background: #0b74d1;
  color: white;
  border: none;
  padding: 0.6rem 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}
.quiz-btn.ghost {
  background: transparent;
  color: #0b74d1;
  border: 1px solid #d7eaff;
}
.quiz-feedback {
  margin-top: 0.75rem;
  font-size: 0.95rem;
}
.quiz-score {
  padding: 1rem;
  text-align: center;
  background: linear-gradient(180deg, #f8fbff, #ffffff);
  border-top: 1px solid #eef6ff;
}
.quiz-score .big {
  font-size: 1.6rem;
  color: #024b8a;
  font-weight: 800;
}
.quiz-small-muted {
  color: #6b879a;
  font-size: 0.9rem;
}