/* ===== VARIABLES ===== */
:root {
  --panel-bg: #d4d0c8;
  --panel-highlight: #ffffff;
  --panel-shadow: #808080;
  --panel-dark-shadow: #404040;
  --title-active: #0055a5;
  --title-inactive: #808080;
  --bluecurve-blue: #3b6ea5;
  --bluecurve-dark: #1e3a5f;
  --bluecurve-light: #6eaddf;
  --desktop-bg: #3a6b9f;
  --text-dark: #000000;
  --text-light: #ffffff;
  --window-bg: #ece9d8;
  --icon-shadow: rgba(0, 0, 0, 0.6);
  --panel-height: 40px;
}

/* ===== RESET & FONTS ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

@font-face {
  font-family: 'Luxisr';
  src: url('assets/luxisr.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

body {
  font-family: "Luxisr", "Tahoma", "Helvetica Neue", "Arial", sans-serif;
  font-size: 12px;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  user-select: none;
  -webkit-user-select: none;
}

/* ===== DESKTOP ===== */
#desktop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: var(--panel-height);
  background: linear-gradient(160deg, #2a4a6b 0%, #2f5577 25%, #345e85 50%, #3a6590 75%, #3f6d9a 100%);
  overflow: hidden;
}

#desktop::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(ellipse at 15% 30%, rgba(60, 140, 190, 0.25) 0%, transparent 45%),
    radial-gradient(ellipse at 75% 15%, rgba(70, 130, 200, 0.25) 0%, transparent 40%),
    radial-gradient(ellipse at 50% 70%, rgba(80, 120, 180, 0.18) 0%, transparent 45%),
    radial-gradient(ellipse at 85% 80%, rgba(100, 150, 190, 0.15) 0%, transparent 35%);
}

/* ===== DESKTOP ICONS ===== */
.desktop-icon {
  position: absolute;
  width: 96px;
  text-align: center;
  cursor: pointer;
  padding: 6px;
  border-radius: 3px;
  z-index: 1;
}

.desktop-icon:hover { background: rgba(255, 255, 255, 0.12); }
.desktop-icon.selected { background: rgba(0, 85, 165, 0.45); }

.icon-img,
.icon-img-inner {
  width: 64px;
  height: 64px;
  margin: 0 auto 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.icon-img { position: relative; }

.icon-img-inner img {
  width: 64px;
  height: 64px;
}

.icon-label {
  color: var(--text-light);
  font-size: 13px;
  text-shadow: 1px 1px 2px var(--icon-shadow);
  line-height: 1.3;
  word-wrap: break-word;
}

#icon-starthtml { top: 20px; left: 20px; }
#icon-home { top: 130px; left: 20px; }
#icon-trash { top: 240px; left: 20px; }

/* ===== BOTTOM PANEL ===== */
#panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--panel-height);
  background: var(--panel-bg);
  border-top: 2px solid var(--panel-highlight);
  display: flex;
  align-items: stretch;
  z-index: 1000;
  padding: 1px 4px;
}

.panel-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 0 8px;
  flex-shrink: 0;
  margin-right: 4px;
}

.panel-logo img {
  height: 32px;
  width: auto;
}

.panel-app {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 32px 0 12px;
  height: 100%;
  cursor: pointer;
  border: 1px solid;
  border-radius: 2px;
  min-width: 200px;
  gap: 8px;
  background: var(--panel-bg);
  border-top-color: var(--panel-highlight);
  border-left-color: var(--panel-highlight);
  border-bottom-color: #706c66;
  border-right-color: #706c66;
  box-shadow: inset 1px 1px 0 var(--panel-highlight), inset -1px -1px 0 #706c66;
  transition: background 0.08s;
  font-size: 14px;
  color: var(--text-dark);
  white-space: nowrap;
}

.panel-app:hover { filter: brightness(1.03); }

.panel-app.active {
  background: #b8b4ac;
  border-top-color: #706c66;
  border-left-color: #706c66;
  border-bottom-color: var(--panel-highlight);
  border-right-color: var(--panel-highlight);
  box-shadow: inset 1px 1px 0 #706c66, inset -1px -1px 0 var(--panel-highlight);
}

.panel-app-icon {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.panel-app-icon img {
  width: 32px;
  height: 32px;
}

.panel-spacer { flex: 1; }

#panel-clock {
  padding: 0 10px;
  font-size: 14px;
  color: var(--text-dark);
  height: 100%;
  display: flex;
  align-items: center;
  white-space: nowrap;
}

/* ===== WINDOWS ===== */
.app-window {
  display: none;
  position: absolute;
  min-width: 280px;
  min-height: 180px;
  border: 2px solid var(--panel-shadow);
  border-top-color: var(--panel-highlight);
  border-left-color: var(--panel-highlight);
  box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.4);
  z-index: 500;
  background: var(--panel-bg);
}

.app-window.open { display: flex; flex-direction: column; }

.window-resize {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 12px;
  height: 12px;
  cursor: nwse-resize;
  z-index: 501;
  background-image: repeating-linear-gradient(
    135deg,
    var(--panel-shadow),
    var(--panel-shadow) 1px,
    transparent 1px,
    transparent 3px
  );
}

.window-titlebar {
  height: 24px;
  display: flex;
  align-items: center;
  padding: 0 4px;
  cursor: move;
  border-bottom: 1px solid var(--panel-shadow);
}

.window-titlebar.active {
  background: linear-gradient(180deg, #5a9fd4 0%, #0055a5 100%);
}

.window-titlebar.inactive {
  background: linear-gradient(180deg, #b0b0b0 0%, #808080 100%);
}

.window-title {
  flex: 1;
  color: var(--text-light);
  font-size: 11px;
  font-weight: bold;
  padding-left: 4px;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.window-controls {
  display: flex;
  gap: 2px;
  margin-left: auto;
}

.window-btn {
  width: 16px;
  height: 14px;
  border: 1px solid;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: bold;
  cursor: pointer;
  border-radius: 2px;
  line-height: 1;
}

.window-btn-close {
  background: #d4a0a0;
  border-color: #e8c0c0;
  border-bottom-color: #a07070;
  border-right-color: #a07070;
  color: #400000;
}

.window-btn-close:hover { background: #e06060; color: white; }

.window-btn-min,
.window-btn-max {
  background: var(--panel-bg);
  border-color: var(--panel-highlight);
  border-bottom-color: var(--panel-shadow);
  border-right-color: var(--panel-shadow);
  color: var(--text-dark);
}

.window-btn-min:hover,
.window-btn-max:hover { background: #c8c4bc; }

.window-content {
  background: #ffffff;
  overflow: hidden;
  flex: 1;
  margin: 2px 12px 12px 4px;
  border: 1px solid #a0a0a0;
}

/* ===== WINDOW CONTENT: START HERE ===== */
.start-here {
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
}

.start-here h1 {
  font-size: 20px;
  color: var(--bluecurve-dark);
  margin-bottom: 4px;
}

.start-here p {
  font-size: 12px;
  color: #333;
  line-height: 1.6;
  max-width: 380px;
}

.contact-section {
  background: rgba(0, 0, 0, 0.05);
  padding: 12px 20px;
  border-radius: 4px;
  border: 1px solid var(--panel-shadow);
  text-align: left;
  width: 100%;
  max-width: 320px;
}

.contact-section h3 {
  font-size: 12px;
  color: var(--bluecurve-dark);
  margin-bottom: 8px;
}

.contact-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  font-size: 11px;
}

.contact-label { color: #666; }
.contact-value { color: #333; font-weight: bold; }

.contact-link {
  cursor: pointer;
  text-decoration: underline;
}

.contact-link a {
  color: inherit;
  text-decoration: inherit;
}

/* ===== WINDOW CONTENT: RESUME ===== */
.resume-viewer {
  font-family: "Courier New", monospace;
  font-size: 11px;
  padding: 16px;
  background: #ffffff;
  margin: 8px;
  border: 1px solid var(--panel-shadow);
  white-space: pre-wrap;
  line-height: 1.5;
  color: var(--text-dark);
  overflow: auto;
  flex: 1;
}

.resume-viewer .section-title {
  font-weight: bold;
  color: var(--bluecurve-dark);
  font-size: 12px;
  margin-top: 12px;
  text-decoration: underline;
}

/* ===== WINDOW CONTENT: GALLERY ===== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  padding: 16px;
}

.gallery-item { text-align: center; cursor: pointer; }

.gallery-thumb {
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid var(--panel-shadow);
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
  box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.gallery-thumb img {
  width: 32px;
  height: 32px;
}

.gallery-item-name {
  font-size: 10px;
  color: var(--text-dark);
}

.window-toolbar {
  padding: 8px 12px;
  background: var(--panel-bg);
  border-bottom: 1px solid var(--panel-shadow);
  font-size: 11px;
}

/* ===== WINDOW CONTENT: CD PLAYER ===== */
.cd-player {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
}

.cd-display {
  background: #1a1a2e;
  border: 2px inset var(--panel-shadow);
  padding: 12px;
  border-radius: 4px;
  text-align: center;
}

.cd-display .track-name {
  color: #00cc66;
  font-family: "Courier New", monospace;
  font-size: 13px;
}

.cd-display .track-time {
  color: #00cc66;
  font-family: "Courier New", monospace;
  font-size: 10px;
  margin-top: 4px;
}

.cd-tracklist {
  flex: 1;
  overflow: auto;
  border: 1px solid var(--panel-shadow);
  background: white;
}

.cd-track {
  padding: 4px 8px;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #eee;
}

.cd-track:hover { background: #e8e8e8; }
.cd-track.playing { background: var(--bluecurve-blue); color: white; }

.cd-controls {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.cd-btn {
  width: 32px;
  height: 28px;
  background: var(--panel-bg);
  border: 2px outset var(--panel-bg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  border-radius: 2px;
}

.cd-btn:active { border-style: inset; }

/* ===== WINDOW CONTENT: TERMINAL ===== */
.terminal {
  background: #000000;
  color: #00cc00;
  font-family: "Courier New", "Lucida Console", monospace;
  font-size: 12px;
  padding: 12px;
  line-height: 1.4;
  overflow: auto;
  flex: 1;
  white-space: pre;
}

.terminal .prompt { color: #00cc00; }
.terminal .highlight { color: #66ccff; }
.terminal .filename { color: #ffff66; }
.terminal .dir { color: #66ccff; font-weight: bold; }
.terminal .cmd { color: #ffffff; }

/* ===== WINDOW CONTENT: BLOG ===== */
.blog-list { padding: 0; }

.blog-entry {
  padding: 12px 16px;
  border-bottom: 1px solid var(--panel-shadow);
  cursor: pointer;
}

.blog-entry:hover { background: rgba(0, 85, 165, 0.08); }

.blog-date {
  font-size: 10px;
  color: #888;
  margin-bottom: 2px;
}

.blog-title {
  font-size: 12px;
  font-weight: bold;
  color: var(--bluecurve-dark);
  margin-bottom: 4px;
}

.blog-summary {
  font-size: 11px;
  color: #555;
  line-height: 1.4;
}

.blog-tags {
  margin-top: 4px;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.blog-tag {
  font-size: 9px;
  background: rgba(0, 85, 165, 0.1);
  color: var(--bluecurve-blue);
  padding: 1px 6px;
  border-radius: 2px;
  border: 1px solid rgba(0, 85, 165, 0.2);
}

/* ===== WINDOW CONTENT: RESUME PDF ===== */
.window-pdf {
  overflow: hidden;
}

.window-content-pdf {
  position: relative;
  flex: 1;
  overflow: hidden;
}

.window-content-pdf iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ===== WINDOW CONTENT: CAROUSEL ===== */
.carousel-container {
  flex: 1;
  overflow: hidden;
  position: relative;
  background: transparent;
}

.carousel-track {
  display: flex;
  height: 100%;
  transition: transform 0.3s ease;
}

.carousel-track img {
  min-width: 100%;
  height: 100%;
  object-fit: contain;
  background: transparent;
}

.carousel-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 8px;
  background: var(--panel-bg);
  border-top: 1px solid var(--panel-shadow);
}

.carousel-counter {
  font-size: 11px;
  color: var(--text-dark);
}

.carousel-desc {
  padding: 8px 12px;
  font-size: 11px;
  color: #333;
  background: white;
  border-top: 1px solid var(--panel-shadow);
  min-height: 32px;
}

/* ===== WINDOW CONTENT: TRASH ===== */
.trash-files {
  background: white;
  flex: 1;
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, 90px);
  gap: 16px;
  align-content: start;
}

.trash-file {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px;
  cursor: pointer;
  border-radius: 4px;
}

.trash-file:hover {
  background: rgba(0, 85, 165, 0.1);
}

.trash-file-name {
  font-size: 11px;
  color: var(--text-dark);
  text-align: center;
  word-break: break-word;
}

/* ===== WINDOW CONTENT: EMAIL ===== */
.email-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.email-label {
  font-size: 11px;
  font-weight: bold;
  color: var(--text-dark);
  width: 50px;
  flex-shrink: 0;
}

.email-input {
  flex: 1;
  padding: 4px 6px;
  font-size: 11px;
  border: 1px solid var(--panel-shadow);
  font-family: inherit;
}

.email-body {
  flex: 1;
  padding: 6px;
  font-size: 11px;
  border: 1px solid var(--panel-shadow);
  font-family: inherit;
  resize: none;
  outline: none;
}

.email-send-btn {
  padding: 4px 16px;
  font-size: 11px;
  cursor: pointer;
  background: var(--panel-bg);
  border: 2px outset var(--panel-bg);
  font-family: inherit;
}

.email-send-btn:active {
  border-style: inset;
}

/* ===== WINDOW CONTENT: NOTES ===== */
.notes-textarea {
  width: 100%;
  height: 100%;
  border: none;
  padding: 12px;
  font-family: "Courier New", monospace;
  font-size: 12px;
  resize: none;
  outline: none;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  :root { --panel-height: 48px; }
  .desktop-icon { width: 80px; }
  .icon-img,
  .icon-img-inner { width: 56px; height: 56px; }
  .icon-img-inner img { width: 56px; height: 56px; }
  .icon-label { font-size: 12px; }
  .panel-app { padding: 2px 6px; min-width: 44px; }
  .app-window { min-width: 260px; }
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 8px;
    padding: 10px;
  }
}

@media (max-width: 480px) {
  #desktop {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  gap: 8px;
  }

  .desktop-icon {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    display: flex;
    align-items: center;
    width: auto;
    gap: 12px;
    padding: 8px 16px;
  }

  .icon-label { font-size: 13px; text-align: left; }

  .app-window {
    left: 4px !important;
    right: 4px !important;
    width: auto !important;
    top: 8px !important;
    bottom: calc(var(--panel-height) + 8px) !important;
    height: auto !important;
  }

  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}
