/* Dark GitHub Pages Theme for Java Companion */

:root {
  /* Color Palette */
  --background: #1e1e2f;
  --background-lighter: #252539;
  --surface: #2c2c3c;
  --surface-lighter: #323246;
  --primary-text: #e0e0e0;
  --secondary-text: #a0a0b0;
  --accent-primary: #82aaff;
  --accent-secondary: #ffb454;
  --accent-tertiary: #c3e88d;
  --code-green: #c3e88d;
  --code-salmon: #f78c6c;
  --code-aqua: #89ddff;
  --code-purple: #c792ea;
  --code-yellow: #ffcb6b;
  --code-blue: #82aaff;
  --code-red: #ff5370;
  --hover-color: #3c3c56;
  --border-color: #3f3f5a;
}

/* Base Styles */
body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  color: var(--primary-text);
  background-color: var(--background);
  background-image:
    radial-gradient(
      circle at 25% 25%,
      rgba(45, 45, 70, 0.05) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 75% 75%,
      rgba(65, 65, 90, 0.05) 0%,
      transparent 50%
    );
  line-height: 1.6;
  transition: background-color 0.3s;
  letter-spacing: 0.01em;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--primary-text);
  font-weight: 600;
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}

h1 {
  font-size: 2.2rem;
  color: var(--accent-primary);
  font-weight: 700;
}

h2 {
  font-size: 1.8rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

h3 {
  font-size: 1.5rem;
}

p,
li {
  color: var(--secondary-text);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 1.2rem;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: all 0.25s;
  position: relative;
}

a:hover {
  color: var(--accent-secondary);
  text-decoration: none;
}

a.nav-link:after {
  content: "";
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--accent-primary);
  transition: width 0.25s;
}

a.nav-link:hover:after {
  width: 100%;
}

code {
  font-family: "JetBrains Mono", "Fira Code", "Source Code Pro", monospace;
  background-color: rgba(0, 0, 0, 0.2);
  color: var(--code-green);
  padding: 0.2rem 0.4rem;
  border-radius: 0.25rem;
  font-size: 0.9em;
}

/* Content Container */
.content-container {
  max-width: 900px;
  margin: 0 auto;
}

/* Navigation */
.navbar {
  background-color: var(--background) !important;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1) !important;
  padding: 0.6rem 0;
  transition: all 0.3s;
  border-bottom: 1px solid var(--border-color);
}

.navbar-brand {
  color: var(--primary-text) !important;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.navbar-brand img {
  max-height: 48px;
  width: auto;
}

.navbar-brand .brand-text {
  display: flex;
  flex-direction: column;
}

.navbar-brand .brand-name {
  font-weight: 600;
  font-size: 1.1rem;
  line-height: 1.1;
}

.navbar-brand .brand-institute {
  font-size: 0.75rem;
  opacity: 0.8;
  line-height: 1.1;
}

.navbar-toggler {
  border: none;
  padding: 0.25rem;
  background-color: transparent;
  color: var(--secondary-text);
}

.navbar-toggler-icon {
  filter: invert(0.8);
  opacity: 0.8;
  width: 1.2em;
  height: 1.2em;
}

.navbar-nav {
  margin-left: auto;
}

.nav-link {
  color: var(--secondary-text) !important;
  transition: all 0.25s;
  padding: 0.5rem 1rem !important;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent-primary) !important;
  background-color: transparent !important;
}

.nav-link i {
  opacity: 0.8;
  margin-right: 0.35rem;
}

/* Hero Section */
.hero-section {
  background: linear-gradient(
    135deg,
    var(--surface) 0%,
    var(--background) 100%
  );
  color: var(--primary-text);
  padding: 3.5rem 0;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.hero-section::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100px;
  background: linear-gradient(to top, var(--background), transparent);
  pointer-events: none;
}

.hero-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
}

.java-logo {
  width: 140px;
  height: 140px;
  object-fit: contain;
  margin-right: 0.5rem;
}

.hero-text {
  text-align: left;
}

.hero-section h1 {
  font-weight: 700;
  margin-bottom: 0.8rem;
  color: var(--primary-text);
}

.hero-section p {
  font-weight: 300;
  font-size: 1.15rem;
  max-width: 800px;
  margin: 0 auto;
  color: var(--secondary-text);
}

/* Course Cards */
.course-card {
  border-radius: 0.5rem;
  overflow: hidden;
  transition:
    transform 0.3s,
    box-shadow 0.3s;
  height: 100%;
  border: 1px solid var(--border-color);
  background-color: var(--surface);
}

.course-card:hover {
  transform: translateY(-5px);
  box-shadow:
    0 10px 20px rgba(0, 0, 0, 0.15),
    0 0 0 1px var(--accent-primary);
}

.course-card .card-header {
  background: linear-gradient(
    135deg,
    var(--surface) 0%,
    var(--surface-lighter) 100%
  );
  color: var(--primary-text);
  font-weight: 500;
  border-bottom: 1px solid var(--border-color);
  padding: 1rem;
}

.course-card .card-body {
  background-color: var(--surface);
  padding: 1.25rem;
}

.course-card .btn {
  background-color: var(--accent-primary);
  border: none;
  transition: all 0.3s;
  padding: 0.5rem 1.25rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  border-radius: 0.25rem;
}

.course-card .btn:hover {
  background-color: var(--accent-secondary);
  box-shadow: 0 0 15px rgba(130, 170, 255, 0.3);
  transform: translateY(-2px);
}

.week-badge {
  background-color: var(--accent-secondary);
  color: var(--background);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: bold;
  font-size: 1rem;
  margin-right: 1rem;
}

.content-icon {
  margin-right: 0.5rem;
  color: var(--accent-primary);
  opacity: 0.9;
  font-size: 0.9em;
}

/* Note Box */
.note-box {
  background-color: rgba(0, 0, 0, 0.15);
  border-left: 4px solid var(--accent-primary);
  padding: 1.25rem;
  border-radius: 0.25rem;
  margin: 1.5rem 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.note-box h5 {
  color: var(--accent-primary);
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

/* Sidebar Navigation */
.course-nav {
  position: sticky;
  top: 70px;
  background-color: var(--surface);
  border-radius: 0.5rem;
  border: 1px solid var(--border-color);
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.course-nav h5 {
  color: var(--accent-primary);
  font-size: 1rem;
  padding: 0 0.5rem;
}

.course-nav .nav-link {
  color: var(--secondary-text) !important;
  border-left: 3px solid transparent;
  padding: 0.5rem 1rem;
  margin: 0.2rem 0;
  transition: all 0.2s;
  font-size: 0.92rem;
}

.course-nav .nav-link:hover,
.course-nav .nav-link.active {
  background-color: var(--hover-color);
  border-left-color: var(--accent-primary);
  color: var(--primary-text) !important;
}

/* Accordion Styles */
.accordion-item {
  background-color: var(--surface);
  border: 1px solid var(--border-color);
  margin-bottom: 0.5rem;
  border-radius: 0.25rem;
  overflow: hidden;
}

.accordion-button {
  background-color: var(--surface);
  color: var(--primary-text);
  font-weight: 500;
  padding: 0.75rem 1rem;
  box-shadow: none;
}

.accordion-button:focus {
  box-shadow: none;
  border-color: var(--border-color);
}

.accordion-button:not(.collapsed) {
  background-color: var(--surface-lighter);
  color: var(--accent-primary);
}

.accordion-button::after {
  filter: invert(0.8);
  opacity: 0.8;
}

.accordion-body {
  background-color: var(--surface-lighter);
  padding: 1.25rem;
}

/* Cards */
.card {
  background-color: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition:
    transform 0.3s,
    box-shadow 0.3s;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.card-title {
  color: var(--accent-primary);
  font-weight: 600;
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
}

.btn-outline-primary {
  color: var(--accent-primary);
  border-color: var(--accent-primary);
  font-weight: 500;
  padding: 0.4rem 1.1rem;
}

.btn-outline-primary:hover {
  background-color: var(--accent-primary);
  color: var(--background);
  box-shadow: 0 0 15px rgba(130, 170, 255, 0.3);
}

.btn-outline-secondary {
  color: var(--secondary-text);
  border-color: var(--border-color);
  background-color: transparent;
}

.btn-outline-secondary:hover {
  background-color: var(--hover-color);
  color: var(--primary-text);
  border-color: var(--border-color);
}

.btn {
  border-radius: 0.25rem;
  transition: all 0.25s;
}

/* Footer */
footer {
  background-color: rgba(0, 0, 0, 0.2);
  color: var(--secondary-text);
  padding: 2rem 0;
  margin-top: 3rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.9rem;
}

footer h5 {
  color: var(--accent-primary);
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

footer a {
  color: var(--secondary-text);
  transition: all 0.2s;
}

footer a:hover {
  color: var(--accent-primary);
}

footer ul li {
  margin-bottom: 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .hero-section {
    padding: 2rem 0;
  }

  .course-nav {
    position: static;
    margin-bottom: 1.5rem;
  }

  h1 {
    font-size: 1.8rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .navbar-brand img {
    max-height: 32px;
  }

  .hero-content {
    flex-direction: column;
    gap: 1rem;
  }

  .hero-text {
    text-align: center;
  }
}

/* Code Block Styling - GitHub Inspired */
.code-block-wrapper {
  position: relative;
  margin: 1rem 0;
  background-color: #0d1117;
  border-radius: 6px;
  border: 1px solid #30363d;
  overflow: hidden;
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.35rem 0.75rem;
  background-color: #161b22;
  border-bottom: 1px solid #30363d;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.8rem;
}

.code-language {
  display: flex;
  align-items: center;
  color: #8b949e;
  font-weight: 600;
}

.code-language i {
  margin-right: 0.5rem;
  color: #6e7681;
}

.copy-button {
  background: transparent;
  border: 1px solid #30363d;
  border-radius: 6px;
  color: #8b949e;
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
}

.copy-button i {
  margin-right: 0.25rem;
}

.copy-button:hover {
  background-color: #30363d;
  color: #c9d1d9;
}

/* Code content styling */
.code-block-wrapper pre {
  margin: 0;
  padding: 0;
  background: transparent;
  font-family:
    ui-monospace, SFMono-Regular, "JetBrains Mono", Consolas, monospace;
  overflow: visible;
}

.code-block-wrapper code {
  display: block;
  color: #e6edf3;
  font-size: 0.85rem;
  line-height: 1.5;
  tab-size: 2;
  overflow-x: auto;
  padding: 0;
}

/* Enhanced code container */
.code-block-wrapper .code-container {
  display: flex;
  width: 100%;
  min-height: 100%;
}

/* Line number styling */
.code-block-wrapper .line-numbers {
  padding: 0.75rem 0;
  background-color: #0d1117;
  color: #484f58;
  text-align: right;
  user-select: none;
  min-width: 3rem;
  border-right: 1px solid #30363d;
  flex-shrink: 0;
}

.code-block-wrapper .line-number {
  padding: 0 0.75rem;
  opacity: 0.6;
  height: 1.5em;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

/* Code lines styling */
.code-block-wrapper .code-lines {
  flex-grow: 1;
  padding: 0.75rem 0;
  overflow-x: auto;
}

.code-block-wrapper .line-content {
  padding: 0 1rem;
  height: 1.5em;
  white-space: pre;
  display: block;
}

/* Syntax highlighting */
.keyword {
  color: #ff7b72;
}
.string {
  color: #a5d6ff;
}
.number {
  color: #79c0ff;
}
.comment {
  color: #8b949e;
  font-style: italic;
}
.function {
  color: #d2a8ff;
}
.class-name {
  color: #ffa657;
}

/* Copy button states */
.copy-success {
  background-color: rgba(46, 160, 67, 0.15) !important;
  color: #56d364 !important;
  border-color: rgba(46, 160, 67, 0.5) !important;
}

.copy-error {
  background-color: rgba(248, 81, 73, 0.15) !important;
  color: #f85149 !important;
  border-color: rgba(248, 81, 73, 0.5) !important;
}

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

::-webkit-scrollbar-track {
  background: var(--background);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

/* Inputs */
.form-control {
  background-color: var(--surface-lighter);
  border: 1px solid var(--border-color);
  color: var(--primary-text);
  padding: 0.5rem 0.75rem;
  font-size: 0.95rem;
}

.form-control:focus {
  background-color: var(--surface-lighter);
  border-color: var(--accent-primary);
  color: var(--primary-text);
  box-shadow: 0 0 0 0.2rem rgba(130, 170, 255, 0.25);
}
