/* ============================================
   IDE Theme - vladgoran.com
   ============================================ */

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

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

:root {
  --bg-editor: #1E1E2E;
  --bg-sidebar: #16161E;
  --bg-tab-bar: #16161E;
  --bg-status-bar: #16161E;
  --bg-active-file: #313244;
  --bg-tab-active: #1E1E2E;
  --bg-tab-hover: #1E1E2E;
  --bg-input: #313244;
  --bg-hover: #1E1E2E;
  --text-main: #CDD6F4;
  --text-muted: #6C7086;
  --text-accent: #FF5370;
  --text-green: #A6E3A1;
  --text-blue: #89B4FA;
  --text-yellow: #F9E2AF;
  --text-purple: #CBA6F7;
  --text-cyan: #94E2D5;
  --border: #313244;
  --line-number: #45475A;
  --scrollbar-thumb: #45475A;
  --scrollbar-track: transparent;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg-editor);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}
::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #585B70;
}

/* ============================================
   Layout
   ============================================ */

.ide-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
}

.ide-main {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ============================================
   Sidebar
   ============================================ */

.sidebar {
  width: 220px;
  min-width: 220px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  user-select: none;
}

.sidebar-header {
  padding: 12px 16px 8px;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
}

.sidebar-folder {
  padding: 6px 16px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.sidebar-folder .folder-icon {
  font-size: 14px;
  color: var(--text-yellow);
}

.sidebar-folder .chevron {
  font-size: 10px;
  color: var(--text-muted);
  margin-right: 2px;
}

.file-tree {
  list-style: none;
  padding: 4px 0;
  flex: 1;
  overflow-y: auto;
}

.file-tree li {
  display: flex;
  align-items: center;
  padding: 4px 16px 4px 32px;
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--text-main);
  gap: 8px;
  transition: background 0.1s;
  position: relative;
}

.file-tree li:hover {
  background: var(--bg-hover);
}

.file-tree li.active {
  background: var(--bg-active-file);
}

.file-tree li.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--text-accent);
}

.file-icon {
  font-size: 15px;
  flex-shrink: 0;
  width: 18px;
  text-align: center;
}

.file-icon.md {
  color: var(--text-blue);
}

.file-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================
   Tab Bar
   ============================================ */

.tab-bar {
  display: flex;
  background: var(--bg-tab-bar);
  border-bottom: 1px solid var(--border);
  min-height: 36px;
  overflow-x: auto;
  overflow-y: hidden;
  user-select: none;
}

.tab-bar::-webkit-scrollbar {
  height: 0;
}

.tab {
  display: flex;
  align-items: center;
  padding: 0 16px;
  height: 36px;
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  border-right: 1px solid var(--border);
  white-space: nowrap;
  gap: 8px;
  transition: background 0.1s, color 0.1s;
  position: relative;
}

.tab:hover {
  color: var(--text-main);
}

.tab.active {
  background: var(--bg-tab-active);
  color: var(--text-main);
}

.tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--bg-editor);
}

.tab .tab-icon {
  font-size: 13px;
}

.tab .tab-close {
  font-size: 14px;
  color: var(--text-muted);
  margin-left: 4px;
  border-radius: 3px;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.1s;
}

.tab:hover .tab-close,
.tab.active .tab-close {
  opacity: 1;
}

.tab .tab-close:hover {
  background: #45475A;
  color: var(--text-main);
}

/* ============================================
   Editor Area
   ============================================ */

.editor-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.editor-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 0;
}

.editor-scroll {
  min-height: 100%;
}

/* Line-numbered content */
.line {
  display: flex;
  min-height: 22.4px;
  line-height: 22.4px;
}

.line-number {
  width: 50px;
  min-width: 50px;
  text-align: right;
  padding-right: 16px;
  color: var(--line-number);
  font-size: 13px;
  user-select: none;
  flex-shrink: 0;
}

.line-content {
  flex: 1;
  padding-right: 32px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Markdown styling */
.md-h1 {
  color: var(--text-accent);
  font-size: 20px;
  font-weight: 700;
}

.md-h1::before {
  content: '# ';
  color: var(--text-muted);
  font-weight: 400;
}

.md-h2 {
  color: var(--text-accent);
  font-size: 16px;
  font-weight: 600;
}

.md-h2::before {
  content: '## ';
  color: var(--text-muted);
  font-weight: 400;
}

.md-h3 {
  color: var(--text-yellow);
  font-size: 14px;
  font-weight: 600;
}

.md-h3::before {
  content: '### ';
  color: var(--text-muted);
  font-weight: 400;
}

.md-comment {
  color: var(--text-muted);
  font-style: italic;
}

.md-bold {
  font-weight: 600;
  color: var(--text-main);
}

.md-italic {
  font-style: italic;
  color: var(--text-purple);
}

.md-code {
  background: #313244;
  color: var(--text-green);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 13px;
}

.md-link {
  color: var(--text-blue);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s;
}

.md-link:hover {
  border-bottom-color: var(--text-blue);
}

.md-bullet::before {
  content: '- ';
  color: var(--text-accent);
}

.md-hr {
  color: var(--text-muted);
  letter-spacing: 2px;
}

.md-blockquote {
  border-left: 3px solid var(--text-accent);
  padding-left: 12px;
  color: var(--text-muted);
  font-style: italic;
}

/* Experience entries */
.xp-entry {
  cursor: pointer;
  transition: background 0.1s;
  border-radius: 3px;
}

.xp-entry:hover .line-content {
  background: rgba(49, 50, 68, 0.3);
}

.xp-details {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.xp-details.open {
  max-height: 2000px;
}

.xp-toggle-icon {
  display: inline-block;
  transition: transform 0.2s;
  color: var(--text-muted);
  font-size: 11px;
  margin-right: 4px;
}

.xp-toggle-icon.open {
  transform: rotate(90deg);
}

/* Contact form */
.ide-form {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ide-form label {
  color: var(--text-muted);
  font-size: 12px;
  margin-bottom: 2px;
}

.ide-form input[type="email"],
.ide-form textarea {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 4px;
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
  max-width: 480px;
}

.ide-form input[type="email"]:focus,
.ide-form textarea:focus {
  border-color: var(--text-accent);
}

.ide-form textarea {
  resize: vertical;
  min-height: 100px;
}

.ide-form button {
  background: var(--text-accent);
  color: #fff;
  border: none;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 24px;
  border-radius: 4px;
  cursor: pointer;
  width: fit-content;
  transition: opacity 0.15s;
}

.ide-form button:hover {
  opacity: 0.85;
}

.social-links {
  display: flex;
  gap: 12px;
  margin-top: 4px;
}

.social-links a {
  color: var(--text-blue);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.15s;
}

.social-links a:hover {
  color: var(--text-main);
}

/* ============================================
   Status Bar
   ============================================ */

.status-bar {
  display: flex;
  align-items: center;
  background: var(--bg-status-bar);
  border-top: 1px solid var(--border);
  height: 24px;
  min-height: 24px;
  padding: 0 12px;
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--text-muted);
  gap: 0;
  user-select: none;
}

.status-bar .status-left,
.status-bar .status-right {
  display: flex;
  align-items: center;
  gap: 0;
}

.status-bar .status-left {
  flex: 1;
}

.status-item {
  padding: 0 10px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}

.status-item.accent {
  background: var(--text-accent);
  color: #fff;
  padding: 0 10px;
  height: 24px;
  display: flex;
  align-items: center;
}

.status-separator {
  color: #45475A;
}

/* ============================================
   Breadcrumb
   ============================================ */

.breadcrumb {
  display: flex;
  align-items: center;
  padding: 4px 16px 4px 66px;
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-editor);
  border-bottom: 1px solid var(--border);
  gap: 4px;
  user-select: none;
}

.breadcrumb span {
  color: var(--text-muted);
}

.breadcrumb .current {
  color: var(--text-main);
}

/* ============================================
   Welcome / Empty State
   ============================================ */

.file-content {
  display: none;
}

.file-content.active {
  display: block;
}

/* ============================================
   Minimap hint (decorative)
   ============================================ */

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
  .sidebar {
    width: 44px;
    min-width: 44px;
  }

  .sidebar-header,
  .sidebar-folder,
  .file-name {
    display: none;
  }

  .file-tree li {
    padding: 8px 0;
    justify-content: center;
  }

  .file-icon {
    font-size: 18px;
  }

  .line-number {
    width: 36px;
    min-width: 36px;
    padding-right: 10px;
    font-size: 11px;
  }

  .breadcrumb {
    padding-left: 46px;
  }

  .tab {
    padding: 0 10px;
    font-size: 11px;
  }

  .status-bar {
    font-size: 10px;
  }
}

@media (max-width: 480px) {
  .sidebar {
    display: none;
  }

  .breadcrumb {
    padding-left: 16px;
  }
}

/* ============================================
   Animations
   ============================================ */

.file-content {
  animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Cursor blink effect on heading */
.cursor-blink::after {
  content: '▎';
  animation: blink 1s step-end infinite;
  color: var(--text-accent);
  font-weight: 300;
}

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