/* ============================================
   GLOBAL (DARK MODE = DEFAULT)
============================================ */

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Inter", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: #0f172a;
  color: white;
}

/* Desktop background */
#desktop {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* ============================================
   DOCK (macOS style)
============================================ */

#dock {
  background: rgba(30, 41, 59, 0.4);
  backdrop-filter: blur(12px) saturate(150%);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.25s ease;
}

.dock-item {
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dock-item:hover {
  transform: translateY(-8px) scale(1.15);
}

.dock-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 0.75rem;
  border: 2px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dock-item:hover .dock-icon {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.icon {
  width: 28px;
  height: 28px;
  filter: brightness(0) invert(1);
}

/* ============================================
   WINDOWS (Dark default)
============================================ */

.window {
  display: none;
  position: absolute;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 14px;
  width: 640px;
  height: 440px;
  overflow: hidden;
  resize: both;

  /* Opening animation */
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.25s ease-out, transform 0.25s ease-out;
}

.window.open {
  opacity: 1;
  transform: scale(1);
}

.window-header {
  height: 40px;
  background: #334155;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: move;
  user-select: none;
}

.window-content {
  overflow-y: auto;
  max-height: calc(100% - 40px);
  padding: 16px;
}

/* PROJECT overlay */
.project-card .project-overlay {
  opacity: 0;
  transition: opacity 0.25s ease;
}

.project-card:hover .project-overlay {
  opacity: 1;
}

/* ============================================
   LIGHT MODE (activated with html.light)
============================================ */

html.light body {
  background: #e8eaf0;
  color: #111;
}

html.light #desktop {
  background: linear-gradient(135deg, #f0f1f5, #d9dce5);
}

html.light .window {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid rgba(0, 0, 0, 0.09);
  color: #111;
}

html.light .window-header {
  background: rgba(255, 255, 255, 0.5);
  color: #111;
}

html.light .window-header span {
  color: #334155 !important;
}

html.light #dock {
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(14px) saturate(180%);
  border-color: rgba(0, 0, 0, 0.1);
}

html.light .dock-icon {
  border-color: rgba(0, 0, 0, 0.12);
}

html.light .icon {
  filter: brightness(0) invert(0);
}

/* Texte dans les fenêtres */
html.light h1,
html.light h2,
html.light h3,
html.light h4 {
  color: #0f172a !important;
}

html.light .text-white {
  color: #0f172a !important;
}

html.light .text-slate-300 {
  color: #475569 !important;
}

html.light .text-blue-400 {
  color: #2563eb !important;
}

html.light .text-green-400 {
  color: #16a34a !important;
}

html.light .text-yellow-400 {
  color: #ca8a04 !important;
}

html.light .text-purple-400 {
  color: #9333ea !important;
}

/* Backgrounds */
html.light .bg-slate-700 {
  background-color: #e2e8f0 !important;
}

html.light .bg-slate-800 {
  background-color: #cbd5e1 !important;
}

html.light .bg-gray-800 {
  background-color: #cbd5e1 !important;
}

/* Inputs et textarea */
html.light input,
html.light textarea {
  background-color: #f1f5f9 !important;
  color: #0f172a !important;
  border: 1px solid #cbd5e1 !important;
}

html.light input::placeholder,
html.light textarea::placeholder {
  color: #64748b !important;
}

/* Cards de projets */
html.light .project-card {
  background-color: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
}

/* Bouton de thème */
html.light #theme-toggle {
  background-color: #334155 !important;
  color: #ffffff !important;
}

/* ============================================
   MOBILE
============================================ */

@media (max-width: 768px) {
  .window.fullscreen-mobile {
    width: 100vw !important;
    height: 100dvh !important;
    top: 0 !important;
    left: 0 !important;
    border-radius: 0;
    resize: none;
  }
}
