:root {
  --primary-color: #fff;
  --secondary-color: #000;
  --accent-color: #fff;
}

/* Green Terminal Theme */
body.theme-green {
  --primary-color: #00ff00;
  --secondary-color: #000;
  --accent-color: #00ff00;
}

/* Amber/Yellow Retro Theme */
body.theme-amber {
  --primary-color: #ffb000;
  --secondary-color: #000;
  --accent-color: #ffb000;
}

body {
  background-color: var(--secondary-color);
  color: var(--primary-color);
  font-family: "Roboto Mono", "MS DOS", "Perfect DOS VGA 437", "Fixedsys", "Terminal", "Lucida Console", "Courier New", monospace;
  font-size: 14px;
  line-height: 1.4;
  overflow: hidden;
}

.os-container {
  border: 2px solid var(--primary-color);
  margin: 10px;
  height: calc(100vh - 20px);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Webkit Scrollbar */
.content-area::-webkit-scrollbar {
  width: 16px;
  background-color: #000;
}

.content-area::-webkit-scrollbar-track {
  background-color: var(--secondary-color);
  border: 1px solid var(--primary-color);
}

.content-area::-webkit-scrollbar-thumb {
  background-color: var(--primary-color);
  border: 1px solid var(--secondary-color);
  min-height: 20px;
}

.content-area::-webkit-scrollbar-thumb:hover {
  background-color: var(--accent-color);
  opacity: 0.8;
}

.content-area::-webkit-scrollbar-button {
  width: 16px;
  height: 16px;
  background-color: var(--primary-color);
  border: 1px solid var(--secondary-color);
  display: block;
}

.content-area::-webkit-scrollbar-button:vertical:start:decrement {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><polygon points="8,4 12,12 4,12" fill="%23000"/></svg>');
  background-repeat: no-repeat;
  background-position: center;
}

.content-area::-webkit-scrollbar-button:vertical:end:increment {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><polygon points="8,12 4,4 12,4" fill="%23000"/></svg>');
  background-repeat: no-repeat;
  background-position: center;
}

.content-area::-webkit-scrollbar-button:hover {
  background-color: var(--accent-color);
  opacity: 0.8;
}

.content-area {
  scrollbar-width: auto;
  scrollbar-color: var(--primary-color) var(--secondary-color);
}

@supports not selector(::-webkit-scrollbar) {
  .content-area {
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--secondary-color);
  }
}

.title-bar {
  background-color: var(--primary-color);
  color: var(--secondary-color);
  padding: 8px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--primary-color);
  font-size: 12px;
}

.window-controls {
  display: flex;
  gap: 10px;
}

.control-btn {
  width: 16px;
  height: 16px;
  border: 1px solid var(--secondary-color);
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
}

.control-btn:hover {
  opacity: 0.8;
}

.control-btn.theme-white {
  background-color: #fff;
}

.control-btn.theme-green {
  background-color: #00ff00;
}

.control-btn.theme-amber {
  background-color: #ffb000;
}

.control-btn.active {
  box-shadow: inset 2px 2px 2px rgba(0, 0, 0, 0.3);
}

.menu-bar {
  background-color: var(--secondary-color);
  border-bottom: 1px solid var(--primary-color);
  padding: 8px 0;
  overflow: visible;
  position: sticky;
  top: 0;
  z-index: 100;
}

.menu-items {
  display: flex;
  gap: 20px;
  padding: 0 16px;
  min-width: max-content;
  position: relative;
  z-index: 100;
}

.menu-item {
  cursor: pointer;
  padding: 4px 8px;
  transition: background-color 0.1s;
  white-space: nowrap;
  position: relative;
}

.menu-item:hover {
  background-color: var(--primary-color);
  color: var(--secondary-color);
}

.dropdown {
  position: relative;
}

.dropdown-content {
  display: none;
  position: fixed;
  background-color: var(--secondary-color);
  border: 2px solid var(--primary-color);
  min-width: 200px;
  z-index: 10001;
  color: var(--primary-color);
}

@media (max-width: 768px) {
  .dropdown-content {
    position: absolute;
    left: 0 !important;
    top: 100% !important;
    min-width: 150px;
  }
  
  .dropdown-item.dropdown > .dropdown-content {
    position: absolute;
    left: 0 !important;
    top: 100% !important;
  }
}

.dropdown-item {
  padding: 8px 12px;
  cursor: pointer;
  transition: background-color 0.1s;
  color: var(--primary-color);
}

.dropdown-item:hover {
  background-color: var(--primary-color);
  color: var(--secondary-color);
}

.dropdown-item.dropdown {
  padding: 8px 12px;
  position: relative;
  cursor: pointer;
}

.dropdown-item.dropdown > .dropdown-content {
  display: none;
  position: absolute;
  left: 100%;
  top: 0;
  background-color: var(--secondary-color);
  border: 2px solid var(--primary-color);
  min-width: 200px;
  z-index: 10002;
}

.dropdown-item.dropdown:hover > .dropdown-content {
  display: block;
}

.dropdown-item.dropdown:hover {
  background-color: var(--primary-color);
  color: var(--secondary-color);
}

.content-area {
  padding: 10px;
  padding-bottom: 10px;
  padding-right: 20px;
  flex: 1;
  overflow: visible;
  position: relative;
}

.terminal-section {
  margin-bottom: 20px;
}

.terminal-line {
  margin-bottom: 8px;
  word-wrap: break-word;
}

.prompt {
  color: var(--primary-color);
}

.command {
  color: var(--primary-color);
  margin-left: 20px;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: none;
  z-index: 1000;
}

.modal-content {
  position: relative;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: var(--secondary-color);
  border: 2px solid var(--primary-color);
  width: 80%;
  max-width: 600px;
  height: 60%;
  max-height: 400px;
  display: flex;
  flex-direction: column;
}

.modal-header {
  background-color: var(--primary-color);
  color: var(--secondary-color);
  padding: 8px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.modal-header button {
  background: none;
  border: none;
  color: var(--secondary-color);
  font-size: 16px;
  cursor: pointer;
}

.modal-body {
  flex: 1;
  padding: 10px;
  overflow-y: auto;
}

.file-listing {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 10px;
}

.status-bar {
  background-color: var(--primary-color);
  color: var(--secondary-color);
  padding: 4px 16px;
  font-size: 11px;
  display: flex;
  justify-content: space-between;
  flex-shrink: 0;
  border-top: 1px solid var(--primary-color);
}

@media (max-width: 768px) {
  .status-bar {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
}

.blinking-cursor::after {
  content: "█";
  animation: blink 1s infinite;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* Slider Styles */
.image-slider {
  margin: 20px 0;
  position: relative;
  background-color: #000;
  width: 100%;
}

.slider-container {
  position: relative;
  width: 100%;
  min-height: 200px;
  max-height: 70vh;
  overflow: hidden;
}

.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  padding: 20px;
  box-sizing: border-box;
  gap: 10px;
}

.slide.active {
  opacity: 1;
}

.slide img {
  max-width: 100%;
  max-height: 60%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.slider-controls {
  position: static;
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
  z-index: 10;
}

.slider-dot {
  width: 10px;
  height: 10px;
  border: 1px solid var(--primary-color);
  background-color: var(--secondary-color);
  cursor: pointer;
  transition: background-color 0.2s;
}

.slider-dot.active {
  background-color: var(--primary-color);
}

.slider-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(0, 0, 0, 0.8);
  color: #fff;
  border: 1px solid #fff;
  padding: 8px 12px;
  cursor: pointer;
  font-family: "MS DOS", "Perfect DOS VGA 437", "Fixedsys", "Terminal", "Lucida Console", "Courier New", monospace;
  transition: all 0.2s;
  z-index: 10;
  font-size: 16px;
}

.slider-nav:hover {
  background-color: #fff;
  color: #000;
}

.slider-prev {
  left: 10px;
}

.slider-next {
  right: 10px;
}

.section {
  margin-bottom: 20px;
  display: none;
  min-height: auto;
}

.section.active {
  display: block;
  min-height: auto;
}

a {
  color: var(--primary-color);
  text-decoration: underline;
  cursor: pointer;
  transition: all 0.1s;
}

a:hover {
  background-color: var(--primary-color);
  color: var(--secondary-color);
}

.social-links {
  display: flex;
  gap: 15px;
  justify-content: flex-start;
  align-items: center;
  margin: 10px 0;
}

.social-link {
  font-size: 20px;
  text-decoration: none;
  color: var(--primary-color);
  transition: transform 0.2s;
  padding: 5px;
  border: 2px solid var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.social-link:hover {
  transform: scale(1.1);
  background-color: var(--primary-color);
  color: var(--secondary-color);
}

.social-icon {
  width: 20px;
  height: 20px;
  filter: brightness(1);
}

#artwork-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  display: none;
  z-index: 1001;
  justify-content: center;
  align-items: center;
  padding: 20px;
  box-sizing: border-box;
}

#artwork-modal .modal-content {
  position: relative;
  width: auto;
  height: auto;
  background-color: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0;
  pointer-events: none;
  max-width: 95vw;
  max-height: 95vh;
}

#artwork-modal .modal-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  padding: 20px;
  overflow: visible;
  gap: 15px;
  pointer-events: auto;
  max-height: 95vh;
}

/* Remove scrollbar on desktop */
#artwork-modal .modal-body::-webkit-scrollbar {
  display: none;
}

@media (max-width: 768px) {
  #artwork-modal .modal-body {
    max-height: 90vh;
    overflow-y: auto;
    padding: 15px;
  }
  
  #artwork-modal .modal-body::-webkit-scrollbar {
    width: 8px;
  }
}

/* Responsive Styles */
@media (max-width: 768px) {
  body { overflow: hidden; }
  .os-container { margin: 5px; height: calc(100vh - 10px); }
  .title-bar { padding: 6px 12px; font-size: 11px; }
  .control-btn { width: 14px; height: 14px; }
  .menu-items { gap: 15px; padding: 0 12px; }
  .content-area { 
    padding: 8px;
    padding-bottom: 10px;
    overflow-y: hidden;
    overflow-x: hidden;
  }
  .content-area::-webkit-scrollbar { width: 12px; }
  .slider-container { min-height: 150px; max-height: 50vh; }
  .slider-dot { width: 8px; height: 8px; }
  .modal-content { width: 90%; height: 70%; }
  .terminal-line { font-size: 12px; }
  .status-bar { 
    font-size: 10px; 
    padding: 3px 12px;
  }
  
  .section.active#home .slider-container {
    max-height: calc(100vh - 150px) !important;
    overflow: hidden;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  body { overflow: hidden; }
  .os-container { margin: 8px; height: calc(100vh - 16px); }
  .content-area { padding: 12px; padding-bottom: 55px; }
  .slider-container { min-height: 250px; max-height: 60vh; }
  .modal-content { width: 80%; height: 60%; }
}

@media (min-width: 1025px) {
  body { overflow: hidden; }
  .os-container { margin: 20px; height: calc(100vh - 40px); }
  .content-area { padding: 20px; padding-bottom: 60px; }
  .slider-container { min-height: 300px; max-height: 70vh; }
  .modal-content { width: 70%; height: 50%; }
}

@media (min-width: 1440px) {
  .os-container { margin: 30px; height: calc(100vh - 60px); }
  .content-area { padding: 30px; padding-bottom: 60px; }
  .slider-container { min-height: 350px; max-height: 75vh; }
  .terminal-line { font-size: 15px; }
  body { font-size: 15px; }
}

@media (min-width: 1920px) {
  .os-container { margin: 40px; height: calc(100vh - 80px); }
  .content-area { padding: 40px; padding-bottom: 60px; }
  .slider-container { min-height: 400px; max-height: 80vh; }
  .terminal-line { font-size: 16px; }
  body { font-size: 16px; }
}

.section.active#home {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.section.active#home .terminal-section {
  flex-shrink: 0;
  margin-bottom: 0;
}

.section.active#home .image-slider {
  flex: 1;
  overflow: hidden;
}

.section.active#home .slider-container {
  height: 100% !important;
  overflow: hidden;
}

#portfolio, #about, #void, #theroom {
  overflow-y: auto;
  overflow-x: hidden;
  max-height: calc(100vh - 200px);
  height: auto;
}

.theroom-container {
  margin: 20px 0;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.theroom-header-image {
  max-width: 100%;
  height: auto;
  border: 2px solid currentColor;
  image-rendering: pixelated;
}

.theroom-description .terminal-line {
  line-height: 1.6;
  margin: 10px 0;
}

.theroom-link {
  align-self: center;
  padding: 8px 16px;
  border: 2px solid #00FF00;
  text-decoration: none;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
  color: #00FF00;
}

.theroom-link:hover {
  background-color: #00FF00;
  color: #000000;
}

.theroom-gallery {
  margin-top: 30px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 15px;
  width: 100%;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  grid-auto-rows: 120px;
  grid-auto-flow: dense;
}

.theroom-gallery-item {
  cursor: pointer;
  border: 2px solid #00FF00;
  padding: 5px;
  transition: all 0.2s;
  background-color: rgba(0, 255, 0, 0.05);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.theroom-gallery-item:nth-child(3n) {
  grid-column: span 2;
  grid-row: span 2;
}

.theroom-gallery-item:nth-child(5n) {
  grid-column: span 1;
  grid-row: span 2;
}

.theroom-gallery-item:hover {
  background-color: #00FF00;
  color: #000000;
  transform: scale(1.02);
}

.theroom-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  margin-bottom: 0;
}

.theroom-gallery-item-name {
  font-size: 10px;
  text-align: center;
  word-wrap: break-word;
  padding: 2px;
  background-color: rgba(0, 0, 0, 0.7);
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: none;
}

.theroom-gallery-item:hover .theroom-gallery-item-name {
  display: block;
}

#theroom {
  color: #00FF00;
}

#theroom .terminal-line {
  color: #00FF00;
}

#theroom .theroom-description {
  color: #00FF00;
}

#theroom::-webkit-scrollbar {
  width: 16px;
  background-color: #000;
}

#theroom::-webkit-scrollbar-track {
  background-color: #000;
  border: 1px solid #00FF00;
}

#theroom::-webkit-scrollbar-thumb {
  background-color: #00FF00;
  border: 1px solid #000;
  min-height: 20px;
}

#theroom::-webkit-scrollbar-thumb:hover {
  background-color: #00FF00;
  opacity: 0.8;
}

#theroom {
  scrollbar-color: #00FF00 #000;
}