/* Terminal Blog Browser - GitHub Dark Vibrant Theme */

/* Reset and base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  background: #0d1117;
  overflow: hidden;
}

body {
  font-family: 'Fira Mono', 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
  font-size: 14px;
  line-height: 1.4;
  color: #c9d1d9;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
}

/* Subtle vignette effect */
body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    ellipse at center,
    transparent 0%,
    rgba(0, 0, 0, 0.2) 100%
  );
  pointer-events: none;
  z-index: 999;
}

/* Terminal window */
.terminal-window {
  width: 100%;
  height: 100%;
  background: #0d1117;
  border: none;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Title bar */
.terminal-titlebar {
  background: linear-gradient(to bottom, #21262d, #161b22);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #30363d;
  flex-shrink: 0;
}

.terminal-buttons {
  display: flex;
  gap: 8px;
  margin-right: 12px;
}

.terminal-buttons .btn {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.terminal-buttons .close { background: #f85149; }
.terminal-buttons .minimize { background: #d29922; }
.terminal-buttons .maximize { background: #3fb950; }

.terminal-title {
  color: #8b949e;
  font-size: 13px;
  flex: 1;
  text-align: center;
  margin-right: 60px; /* Balance the buttons */
}

/* Terminal body */
.terminal-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

/* Header with breadcrumb */
.terminal-header {
  padding: 12px 16px;
  border-bottom: 1px solid #21262d;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  background: #161b22;
}

.breadcrumb {
  color: #7ee787;
  font-size: 13px;
}

.breadcrumb::before {
  content: "$ ls ";
  color: #8b949e;
}

/* Search box */
.search-box {
  display: flex;
  align-items: center;
  flex: 1;
}

.search-prompt {
  color: #ffa657;
  margin-right: 4px;
}

#search-input {
  background: transparent;
  border: none;
  color: #c9d1d9;
  font-family: inherit;
  font-size: inherit;
  outline: none;
  flex: 1;
  caret-color: #58a6ff;
}

#search-input::placeholder {
  color: #484f58;
}

/* Content area */
.terminal-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0;
  background: #0d1117;
}

/* Custom scrollbar */
.terminal-content::-webkit-scrollbar {
  width: 8px;
}

.terminal-content::-webkit-scrollbar-track {
  background: #0d1117;
}

.terminal-content::-webkit-scrollbar-thumb {
  background: #30363d;
  border-radius: 4px;
}

.terminal-content::-webkit-scrollbar-thumb:hover {
  background: #484f58;
}

/* File table */
.file-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.file-table th {
  text-align: left;
  padding: 8px 16px;
  color: #8b949e;
  font-weight: normal;
  border-bottom: 1px solid #21262d;
  position: sticky;
  top: 0;
  background: #0d1117;
  z-index: 10;
}

.file-table td {
  padding: 6px 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Column widths - 3 columns when showing files */
.col-name { width: 55%; }
.col-date { width: 15%; }
.col-tags { width: 30%; }

/* Date column styling */
.file-date {
  color: #8b949e;
  font-size: 12px;
  white-space: nowrap;
}

/* File rows */
.file-row {
  cursor: pointer;
  transition: background 0.15s;
}

.file-row:hover {
  background: #161b22;
}

.file-row.selected {
  background: #1f6feb33;
}

.file-row.selected td {
  color: #c9d1d9;
}

/* File icons and names */
.file-icon {
  margin-right: 8px;
  color: #8b949e;
}

.file-name {
  color: #c9d1d9;
}

.folder .file-name {
  color: #58a6ff;
}

.folder .file-icon {
  color: #58a6ff;
}

/* Parent directory */
.parent-dir .file-name {
  color: #8b949e;
}

.parent-dir .file-icon {
  color: #8b949e;
}

/* Tags */
.file-tags {
  color: #8b949e;
  font-size: 12px;
}

.tag {
  display: inline-block;
  margin-right: 6px;
  font-size: 12px;
}

.tag::before {
  content: "#";
  opacity: 0.6;
}

.tag.clickable {
  cursor: pointer;
  transition: filter 0.15s, background 0.15s;
  padding: 1px 6px;
  border-radius: 3px;
}

.tag.clickable:hover {
  filter: brightness(1.2);
  background: rgba(88, 166, 255, 0.15);
}

.tag.more {
  color: #484f58;
}

/* Footer */
.terminal-footer {
  padding: 8px 16px;
  border-top: 1px solid #21262d;
  flex-shrink: 0;
  background: #161b22;
}

.help-text {
  color: #8b949e;
  font-size: 12px;
}

/* No JavaScript message */
.no-js-message {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #161b22;
  border: 1px solid #30363d;
  padding: 24px 32px;
  border-radius: 6px;
  text-align: center;
  color: #ffa657;
}

.no-js-message a {
  color: #58a6ff;
  text-decoration: underline;
}

/* Blinking cursor effect for search */
#search-input:focus + .cursor,
.search-box.active .cursor {
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* Selection highlight for search matches */
.highlight {
  background: #1f6feb44;
  color: #58a6ff;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  body {
    padding: 0;
    font-size: 12px;
  }

  .terminal-window {
    height: 100%;
    border-radius: 0;
  }

  .file-table th,
  .file-table td {
    padding: 6px 10px;
  }

  .col-name { width: 50%; }
  .col-date { width: 20%; }
  .col-tags { width: 30%; }

  .help-text {
    font-size: 10px;
  }

  .terminal-titlebar {
    padding: 6px 10px;
  }

  .terminal-title {
    font-size: 11px;
  }
}

/* Touch-friendly adjustments */
@media (hover: none) {
  .file-row {
    padding: 4px 0;
  }

  .file-table td {
    padding: 10px 16px;
  }
}
