/* ==========================================
   1. THEME CONFIGURATION (VARIÁVEIS GLOBAIS)
   ========================================== */

:root {
  --lavender: #e6d5ff;
  --periwinkle: #c8b6ff;
  --misty-purple: #d4c1ec;
  --soft-blue: #a7c7e7;
  --dream-blue: #89b4d6;
  --glow-purple: #b19cd9;
  --chaos-pink: #f0c1e8;
  --void-dark: #1a1329;
  --glitch-red: #ff6b9d;
  --glitch-cyan: #7df9ff;
}

/* Reset global */
* {
  box-sizing: border-box;
  user-select: none;
}


/* ==========================================
   2. BODY & BACKGROUND (FUNDO DO DESKTOP)
   ========================================== */

body {
  margin: 0;
  padding: 0;
  font-family: 'Tahoma', 'Segoe UI', sans-serif;
  background: 
    radial-gradient(ellipse at top, var(--lavender), var(--void-dark) 70%),
    radial-gradient(ellipse at bottom, var(--soft-blue), var(--void-dark) 60%),
    repeating-linear-gradient(0deg, rgba(137, 180, 214, 0.03) 0px, rgba(137, 180, 214, 0.03) 1px, transparent 1px, transparent 4px),
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23b19cd9' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  background-attachment: fixed;
  height: 100vh;
  overflow: hidden;
  color: var(--void-dark);
  cursor: default;
}

/* Efeito de scanline (linhas CRT) sobre o corpo */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    linear-gradient(rgba(181, 156, 217, 0.02) 50%, transparent 50%),
    linear-gradient(90deg, rgba(137, 180, 214, 0.02) 50%, transparent 50%);
  background-size: 4px 4px;
  pointer-events: none;
  z-index: 9999;
  animation: scanline 8s linear infinite;
}


/* ==========================================
   3. ANIMAÇÕES GLOBAIS
   ========================================== */

/* Efeito de texto com glitch */
.glitch-text {
  position: relative;
  animation: glitch 3s infinite;
}

@keyframes glitch {
  0%, 90%, 100% {
    text-shadow: none;
  }
  92% {
    text-shadow: 2px 0 var(--glitch-red), -2px 0 var(--glitch-cyan);
  }
  94% {
    text-shadow: -2px 0 var(--glitch-red), 2px 0 var(--glitch-cyan);
  }
  96% {
    text-shadow: 2px 2px var(--glitch-red), -2px -2px var(--glitch-cyan);
  }
}

/* Partículas de brilho */
.sparkle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: white;
  border-radius: 50%;
  animation: sparkle 2s ease-in-out infinite;
  opacity: 0.8;
  pointer-events: none;
}

@keyframes sparkle {
  0%, 100% {
    opacity: 0;
    transform: scale(0);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Scanline animação */
@keyframes scanline {
  0% {
    transform: translateY(-100%);
  }
  100% {
    transform: translateY(100vh);
  }
}


/* ==========================================
   4. DESKTOP & ÍCONES
   ========================================== */

/* Área principal do desktop */
#desktop {
  position: relative;
  width: 100%;
  height: calc(100vh - 40px);
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, 80px);
  grid-auto-rows: 100px;
  gap: 15px;
  align-content: start;
}

/* Ícone individual do desktop */
.desktop-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 90px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.desktop-icon:hover {
  transform: scale(1.05);
  filter: drop-shadow(0 0 8px var(--glow-purple));
}

.desktop-icon:active {
  transform: scale(0.95);
}

/* Imagem/emoji do ícone */
.icon-img {
  width: 48px;
  height: 48px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  background: linear-gradient(135deg, var(--periwinkle), var(--soft-blue));
  border-radius: 12px;
  border: 2px solid var(--glow-purple);
  box-shadow: 
    0 4px 8px rgba(0, 0, 0, 0.2),
    inset 0 2px 4px rgba(255, 255, 255, 0.3);
  transition: all 0.2s;
}

.desktop-icon:hover .icon-img {
  box-shadow: 
    0 6px 12px rgba(177, 156, 217, 0.4),
    inset 0 2px 4px rgba(255, 255, 255, 0.4),
    0 0 15px var(--glow-purple);
}

/* Label (texto) do ícone */
.icon-label {
  font-size: 11px;
  text-align: center;
  color: white;
  text-shadow: 
    1px 1px 2px var(--void-dark),
    -1px -1px 2px var(--void-dark);
  font-weight: 500;
  max-width: 100%;
  word-wrap: break-word;
  line-height: 1.2;
}


/* ==========================================
   5. WINDOW STYLES (ESTILOS DE JANELAS)
   ========================================== */

/* Janela base */
.window {
  position: absolute;
  min-width: 300px;
  min-height: 200px;
  background: linear-gradient(180deg, var(--lavender) 0%, var(--misty-purple) 100%);
  border: 3px solid var(--glow-purple);
  border-radius: 8px 8px 4px 4px;
  box-shadow: 
    0 10px 30px rgba(137, 180, 214, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.2) inset,
    0 0 20px var(--glow-purple);
  z-index: 100;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

/* Janela ativa (em foco) */
.window.active {
  z-index: 200;
  box-shadow: 
    0 15px 40px rgba(177, 156, 217, 0.5),
    0 0 0 2px rgba(255, 255, 255, 0.3) inset,
    0 0 30px var(--glow-purple),
    0 0 60px var(--soft-blue);
}

/* Barra de título */
.title-bar {
  background: linear-gradient(90deg, var(--dream-blue), var(--glow-purple), var(--chaos-pink));
  border-bottom: 2px solid var(--void-dark);
  padding: 4px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: move;
  user-select: none;
}

.title-bar-text {
  font-weight: bold;
  font-size: 13px;
  color: white;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Controles da janela (min/max/close) */
.title-bar-controls {
  display: flex;
  gap: 4px;
}

.title-bar-controls button {
  width: 20px;
  height: 20px;
  padding: 0;
  font-size: 14px;
  line-height: 1;
  border-radius: 3px;
  background: linear-gradient(180deg, #ffd1dc, #ffb3d1);
  border: 2px solid #ff6b9d;
  color: var(--void-dark);
  font-weight: bold;
  cursor: pointer;
  transition: all 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.title-bar-controls button:hover {
  background: linear-gradient(180deg, #ff6b9d, #ff4785);
  color: white;
  transform: scale(1.1);
}

/* Corpo da janela */
.window-body {
  padding: 12px;
  flex: 1;
  overflow: auto;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 0 0 4px 4px;
  font-size: 13px;
  line-height: 1.4;
}

.window-body a {
  color: var(--dream-blue);
  text-decoration: none;
  font-weight: 500;
}

.window-body a:hover {
  color: var(--glow-purple);
  text-decoration: underline;
}


/* ==========================================
   6. TASKBAR & START MENU (BARRA DE TAREFAS)
   ========================================== */

/* Barra de tarefas inferior */
#taskbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: linear-gradient(180deg, var(--dream-blue), var(--glow-purple));
  border-top: 3px solid var(--void-dark);
  display: flex;
  align-items: center;
  padding: 0 15px;
  gap: 10px;
  z-index: 1000;
  box-shadow: 0 -3px 15px rgba(0, 0, 0, 0.3);
}

/* Botão Iniciar */
#start-button {
  background: linear-gradient(135deg, var(--chaos-pink), var(--glow-purple));
  border: 2px solid var(--void-dark);
  border-radius: 6px;
  padding: 6px 16px;
  font-weight: bold;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#start-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(177, 156, 217, 0.4);
  filter: drop-shadow(0 0 8px var(--glow-purple));
}

#start-button:active {
  transform: translateY(1px);
}

/* Relógio do sistema */
#clock {
  margin-left: auto;
  color: white;
  font-weight: 500;
  font-size: 13px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
  padding: 4px 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

/* Menu Iniciar */
#start-menu {
  position: fixed;
  bottom: 40px;
  left: 10px;
  width: 280px;
  background: linear-gradient(180deg, var(--lavender), var(--misty-purple));
  border: 3px solid var(--glow-purple);
  border-radius: 8px 8px 4px 4px;
  box-shadow: 
    0 10px 30px rgba(137, 180, 214, 0.4),
    0 0 20px var(--glow-purple);
  z-index: 1500;
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: windowOpen 0.2s ease-out;
}

#start-menu.active {
  display: flex;
}

/* Cabeçalho do menu iniciar (avatar + nome) */
.start-menu-header {
  background: linear-gradient(90deg, var(--dream-blue), var(--glow-purple));
  padding: 12px 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 2px solid var(--void-dark);
}

.start-menu-avatar {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--chaos-pink), var(--glow-purple));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  border: 2px solid white;
}

.start-menu-username {
  color: white;
  font-weight: bold;
  font-size: 14px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* Itens do menu iniciar */
.start-menu-items {
  padding: 8px 0;
}

.start-menu-item {
  padding: 10px 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--void-dark);
  font-size: 13px;
}

.start-menu-item:hover {
  background: linear-gradient(90deg, var(--periwinkle), var(--soft-blue));
  padding-left: 20px;
}

.start-menu-item .icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

.start-menu-divider {
  height: 1px;
  background: var(--glow-purple);
  margin: 5px 15px;
  opacity: 0.5;
}

.start-menu-footer {
  padding: 10px 15px;
  border-top: 2px solid var(--void-dark);
  background: rgba(137, 180, 214, 0.1);
  font-size: 11px;
  color: var(--void-dark);
  opacity: 0.8;
}

/* Animação de abertura de janela */
@keyframes windowOpen {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.window.opening {
  animation: windowOpen 0.25s ease-out forwards;
}


/* ==========================================
   7. TERMINAL (LINHA DE COMANDO)
   ========================================== */

.terminal-body {
  background: #000000 !important;
  color: #cccccc !important;
  font-family: 'Consolas', 'Courier New', monospace !important;
  font-size: 14px !important;
  padding: 15px !important;
  overflow-y: auto !important;
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.4;
}

/* Cursor piscante */
.cursor {
  animation: blink 1s step-end infinite;
  color: #cccccc;
}

@keyframes blink {
  0%, 50% {
    opacity: 1;
  }
  51%, 100% {
    opacity: 0;
  }
}


/* ==========================================
   8. BSOD (TELA AZUL DA MORTE)
   ========================================== */

#bsod-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #0078D7;
  color: white;
  font-family: 'Segoe UI', 'Tahoma', sans-serif;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  z-index: 99999;
  padding: 10% 15%;
  text-align: left;
}

#bsod-overlay.active {
  display: flex;
}

.bsod-content h1 {
  font-size: 120px;
  margin: 0 0 30px 0;
  font-weight: 300;
  line-height: 1;
}

.bsod-content p {
  font-size: 26px;
  max-width: 900px;
  line-height: 1.4;
  margin-bottom: 50px;
  font-weight: 300;
}

.bsod-footer {
  position: absolute;
  bottom: 60px;
  left: 15%;
  font-size: 18px;
  cursor: pointer;
  text-decoration: underline;
  transition: color 0.2s;
  font-weight: 400;
}

.bsod-footer:hover {
  color: #ffeb3b;
}


/* ==========================================
   9. NOTEPAD (BLOCO DE NOTAS)
   ========================================== */

.notepad-body {
  background: white !important;
  font-family: 'Consolas', 'Courier New', monospace !important;
  font-size: 13px !important;
  padding: 20px !important;
  line-height: 1.6 !important;
  color: #333 !important;
}

.notepad-body h1 {
  font-size: 24px;
  color: var(--void-dark);
  margin-bottom: 10px;
}

.notepad-body h2 {
  font-size: 18px;
  color: var(--glow-purple);
  margin-top: 20px;
  margin-bottom: 10px;
}

.notepad-body p {
  margin: 10px 0;
}

.notepad-body ul {
  margin: 10px 0;
  padding-left: 25px;
}

.notepad-body li {
  margin: 5px 0;
}

.notepad-body em {
  color: var(--chaos-pink);
  font-style: italic;
}

.notepad-body strong {
  color: var(--void-dark);
}


/* ==========================================
   10. BLOG (PORTFÓLIO)
   ========================================== */

.blog-body {
  background: linear-gradient(135deg, #f5f5f5 0%, #ffffff 100%) !important;
  padding: 20px !important;
  font-family: 'Segoe UI', 'Tahoma', sans-serif !important;
}

.blog-header {
  text-align: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--glow-purple);
}

.blog-header h1 {
  font-size: 28px;
  color: var(--void-dark);
  margin: 0;
}

.blog-header p {
  color: var(--dream-blue);
  font-size: 14px;
  margin: 10px 0 0 0;
}

/* Grid de projetos */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.project-card {
  background: white;
  border: 2px solid var(--periwinkle);
  border-radius: 12px;
  padding: 20px;
  transition: all 0.3s;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(177, 156, 217, 0.3);
  border-color: var(--glow-purple);
}

.project-card h3 {
  margin: 0 0 10px 0;
  color: var(--void-dark);
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.project-card p {
  margin: 10px 0;
  color: #555;
  font-size: 14px;
  line-height: 1.5;
}

/* Tags de tecnologia */
.project-tag {
  display: inline-block;
  background: linear-gradient(135deg, var(--dream-blue), var(--glow-purple));
  color: white;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  margin: 5px 5px 0 0;
}

.project-link {
  display: inline-block;
  margin-top: 10px;
  color: var(--dream-blue);
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
}

.project-link:hover {
  color: var(--glow-purple);
  text-decoration: underline;
}


/* ==========================================
   11. WALTER (PÁGINA ESPECIAL)
   ========================================== */

.walter-body {
  padding: 0 !important;
  background: linear-gradient(135deg, #1a1a2e, #16213e) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.walter-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 15px;
  position: relative;
}

.walter-img {
  max-width: 100%;
  max-height: calc(100% - 50px);
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transition: transform 0.2s, filter 0.2s;
}

.walter-img:hover {
  transform: scale(1.02);
  filter: brightness(1.1);
}

.walter-img:active {
  transform: scale(0.98);
}

/* Texto pulsante de dica */
.walter-hint {
  margin-top: 12px;
  color: #f0c1e8;
  font-size: 12px;
  text-align: center;
  opacity: 0.8;
  animation: pulse 2s ease-in-out infinite;
  text-shadow: 0 0 10px rgba(240, 193, 232, 0.5);
}

@keyframes pulse {
  0%, 100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}


/* ==========================================
   12. FILE MANAGER (GERENCIADOR DE ARQUIVOS)
   ========================================== */

/* Container principal */
.filemanager-body {
  display: flex;
  flex-direction: column;
  padding: 0 !important;
  background: #f4f4f9 !important;
  border-radius: 0 0 4px 4px;
}

/* Barra de caminho/navegação */
.fm-pathbar {
  background: linear-gradient(180deg, #e8e8e8, #d0d0d0);
  padding: 8px 12px;
  border-bottom: 2px solid var(--glow-purple);
  font-family: 'Tahoma', sans-serif;
  font-size: 13px;
  color: var(--void-dark);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  user-select: none;
}

.fm-pathbar span {
  cursor: pointer;
  color: var(--dream-blue);
  text-decoration: underline;
  transition: color 0.2s;
  font-weight: 500;
}

.fm-pathbar span:hover {
  color: var(--glow-purple);
}

.fm-pathbar .fm-sep {
  color: #888;
  text-decoration: none;
  cursor: default;
  font-weight: normal;
}

/* Grid de arquivos/pastas */
.fm-grid {
  flex: 1;
  padding: 15px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(95px, 1fr));
  gap: 15px;
  overflow-y: auto;
  align-content: start;
}

/* Item individual (arquivo/pasta) */
.fm-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  padding: 10px 6px;
  border-radius: 6px;
  transition: all 0.2s ease;
  user-select: none;
}

.fm-item:hover {
  background: rgba(177, 156, 217, 0.25);
  transform: scale(1.03);
}

/* Ícone do item */
.fm-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.fm-icon img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.2s;
}

.fm-item:hover .fm-icon img {
  transform: scale(1.1);
}

/* Nome do arquivo/pasta */
.fm-name {
  font-size: 11px;
  text-align: center;
  word-break: break-word;
  color: var(--void-dark);
  line-height: 1.2;
  font-weight: 500;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);
}

/* Área de preview (visualização de arquivo) */
.fm-preview {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 10px;
  overflow: auto;
}

.fm-preview-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 15px;
  border-bottom: 2px solid var(--glow-purple);
  padding-bottom: 8px;
}

/* Botão "Voltar" */
.fm-back-btn {
  background: var(--dream-blue);
  color: white;
  border: none;
  padding: 6px 12px;
  cursor: pointer;
  border-radius: 4px;
  font-weight: bold;
  transition: all 0.2s;
}

.fm-back-btn:hover {
  background: var(--glow-purple);
  transform: scale(1.05);
}

/* Título do preview */
.fm-preview-title {
  font-weight: bold;
  color: var(--void-dark);
  font-size: 14px;
}

/* Conteúdo do preview */
.fm-preview-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.fm-preview-content img {
  max-width: 95%;
  max-height: 65vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.fm-preview-content p {
  margin-top: 10px;
  color: #666;
  font-style: italic;
  text-align: center;
}

/* Conteúdo de arquivo de texto */
.fm-text-content {
  background: white;
  padding: 20px;
  border-radius: 8px;
  font-family: 'Courier New', monospace;
  white-space: pre-wrap;
  color: #333;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  max-width: 100%;
  max-height: 60vh;
  overflow-y: auto;
  line-height: 1.5;
}


/* ==========================================
   13. RESPONSIVE (AJUSTES PARA MOBILE)
   ========================================== */

@media (max-width: 768px) {
  
  /* Desktop menor em mobile */
  #desktop {
    grid-template-columns: repeat(auto-fill, 70px);
    grid-auto-rows: 90px;
    padding: 10px;
  }

  .desktop-icon {
    width: 70px;
    height: 85px;
  }

  .icon-img {
    width: 40px;
    height: 40px;
    font-size: 26px;
  }

  .icon-label {
    font-size: 10px;
  }

  /* Janelas menores */
  .window {
    min-width: 280px;
    min-height: 180px;
  }

  /* Menu iniciar mais estreito */
  #start-menu {
    width: 240px;
    left: 5px;
  }
}
