/* ===== Element IDE THEME ===== */
:root {
  --bg-dark: #1e1e1e;
  --bg-panel: #252525;
  --bg-panel-dark: #1f1f1f;
  --bg-element: #2a2a2a;
  --bg-input: #2d2d2d;
  --border-color: #3c3c3c;
  --accent-blue: #007acc;
  --accent-cyan: #00a8cc;
  --accent-purple: #9b59b6;
  --accent-orange: #e67e22;
  --text-main: #cccccc;
  --text-bright: #ffffff;
  --text-dim: #888888;
  --radius: 4px;
}

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

html, body {
  height: 100%;
  background: var(--bg-dark);
  color: var(--text-main);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

/* ===== LAYOUT ===== */
#layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-width: 1400px;
  margin: 0 auto;
}

/* ===== TOP BAR ===== */
#topBar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--bg-panel-dark);
  border-bottom: 1px solid var(--border-color);
  min-height: 44px;
}

#menuToggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-bright);
  font-size: 22px;
  cursor: pointer;
  padding: 4px 8px;
}

#bookmarks {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  flex: 1;
}

.bookmark {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: var(--bg-element);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-main);
  font-size: 12px;
  white-space: nowrap;
  transition: border-color 0.2s;
  cursor: pointer;
}
.bookmark:hover {
  border-color: var(--accent-blue);
  color: var(--text-bright);
}
.bm-icon { font-size: 16px; }

/* ===== MIDDLE ===== */
#middle {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ===== LEFT MENU ===== */
#leftMenu {
  width: 220px;
  min-width: 220px;
  background: var(--bg-panel);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.menu-profile {
  padding: 20px 16px;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
}

.avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  color: var(--text-bright);
  margin: 0 auto 10px;
}

.menu-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-bright);
}
.menu-title {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
}

.menu-list {
  list-style: none;
  flex: 1;
  padding: 8px 0;
}

.menu-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  color: var(--text-main);
  font-size: 13px;
  border-left: 3px solid transparent;
  transition: background 0.15s, color 0.15s;
}
.menu-list li:hover {
  background: var(--bg-element);
  color: var(--text-bright);
}
.menu-list li.active {
  background: var(--bg-element);
  color: var(--text-bright);
  border-left-color: var(--accent-blue);
}
.menu-icon { font-size: 16px; }

.menu-social {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 12px;
  border-top: 1px solid var(--border-color);
}
.menu-social a {
  font-size: 20px;
  opacity: 0.6;
  transition: opacity 0.2s;
}
.menu-social a:hover { opacity: 1; }

/* ===== CENTER ===== */
#center {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px;
  min-width: 0;
}

#center h1 {
  font-size: 26px;
  color: var(--text-bright);
  margin-bottom: 16px;
}

#center h2 {
  font-size: 18px;
  color: var(--text-bright);
  margin: 20px 0 10px;
}

#center p { margin-bottom: 12px; }

.lead {
  font-size: 16px;
  color: var(--text-dim);
  margin-bottom: 24px;
}

/* Pages */
.page { display: none; }
.page.active { display: block; }

/* Stats */
.stats-row {
  display: flex;
  gap: 16px;
  margin: 20px 0;
}
.stat {
  flex: 1;
  text-align: center;
  padding: 16px 12px;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
}
.stat-num {
  display: block;
  font-size: 22px;
  font-weight: 700;
  color: var(--accent-cyan);
}
.stat-label {
  display: block;
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
}

/* Featured project */
.featured-project {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px;
  margin: 20px 0;
}

/* Button */
.btn {
  display: inline-block;
  padding: 8px 18px;
  background: var(--accent-blue);
  color: var(--text-bright);
  border-radius: var(--radius);
  font-size: 13px;
  transition: background 0.2s;
}
.btn:hover { background: #005a9e; color: var(--text-bright); }
.btn.small { padding: 5px 12px; font-size: 11px; }

/* Skills */
.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.skill {
  padding: 5px 12px;
  background: var(--bg-element);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 12px;
  color: var(--accent-cyan);
}

/* Project card */
.project-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}
.project-card h3 {
  font-size: 15px;
  color: var(--text-bright);
  margin-bottom: 6px;
}
.project-card p { font-size: 13px; margin-bottom: 10px; }

/* Blog post */
.post-preview {
  border-bottom: 1px solid var(--border-color);
  padding: 14px 0;
}
.post-preview h3 {
  font-size: 15px;
  color: var(--text-bright);
  margin-bottom: 4px;
}
.post-meta {
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.post-preview p { font-size: 13px; }

/* Contact */
.contact-list {
  list-style: none;
  padding: 0;
}
.contact-list li {
  padding: 8px 0;
  font-size: 14px;
}

/* ===== RIGHT BAR ===== */
#rightBar {
  width: 240px;
  min-width: 240px;
  background: var(--bg-panel);
  border-left: 1px solid var(--border-color);
  overflow-y: auto;
  padding: 12px;
}

.rb-section {
  margin-bottom: 16px;
}

.rb-section h3 {
  font-size: 12px;
  color: var(--text-bright);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 8px;
}

.link-list {
  list-style: none;
}
.link-list li {
  padding: 4px 0;
  font-size: 13px;
}

.news-item {
  padding: 8px 0;
  border-bottom: 1px solid rgba(60,60,60,0.4);
}
.news-item:last-child { border-bottom: none; }
.news-title {
  font-size: 13px;
  color: var(--text-bright);
  margin-bottom: 2px;
}
.news-excerpt {
  font-size: 11px;
  color: var(--text-dim);
}

/* ===== BOTTOM CHAT ===== */
#bottomChat {
  border-top: 1px solid var(--border-color);
  background: var(--bg-panel-dark);
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  font-size: 12px;
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
}
.chat-header:hover { color: var(--text-bright); }
.chat-toggle { font-size: 10px; transition: transform 0.2s; }

.chat-body {
  max-height: 150px;
  overflow-y: auto;
  padding: 0 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chat-msg {
  font-size: 12px;
  padding: 4px 0;
}
.msg-author {
  color: var(--accent-cyan);
  font-weight: 600;
  margin-right: 6px;
}
.msg-text { color: var(--text-main); }

.chat-input-area {
  display: flex;
  border-top: 1px solid var(--border-color);
}

.chat-input-area input {
  flex: 1;
  background: var(--bg-input);
  border: none;
  color: var(--text-main);
  padding: 8px 12px;
  font-size: 12px;
  outline: none;
  font-family: inherit;
}

.chat-input-area button {
  width: 40px;
  background: var(--accent-blue);
  border: none;
  color: var(--text-bright);
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s;
}
.chat-input-area button:hover { background: #005a9e; }

/* ===== OVERLAY ===== */
#overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  z-index: 99;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-panel); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1023px) {
  #rightBar {
    display: none;
  }
}

@media (max-width: 767px) {
  #menuToggle { display: block; }

  #topBar { min-height: 40px; }

  #leftMenu {
    position: fixed;
    top: 0; left: -260px;
    width: 260px;
    min-width: 260px;
    height: 100vh;
    z-index: 100;
    transition: left 0.3s ease;
    box-shadow: 4px 0 20px rgba(0,0,0,0.5);
  }
  #leftMenu.open { left: 0; }
  #overlay.open { display: block; }

  #center {
    padding: 16px;
  }

  #center h1 { font-size: 22px; }

  .stats-row {
    flex-direction: column;
    gap: 8px;
  }

  .bookmark .bm-label {
    display: none;
  }

  #bottomChat .chat-body {
    max-height: 100px;
  }
}

@media (max-width: 480px) {
  #center h1 { font-size: 18px; }

  .menu-name { font-size: 14px; }

  .avatar { width: 48px; height: 48px; font-size: 22px; }
}
