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

body {
  font-family: Arial, sans-serif;
  background-color: #f0f0f0;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

#search-container {
  background-color: #fff;
  padding: 12px 20px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.search-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

.search-bar {
  display: flex;
  align-items: center;
  background-color: #f5f5f5;
  border-radius: 20px;
  padding: 8px 15px;
  width: 75%;
  margin-right: 10px;
}

.search-bar i {
  color: #666;
  margin-right: 10px;
}

#search-input {
  border: none;
  background: none;
  outline: none;
  flex: 1;
  font-size: 16px;
}

.top-buttons {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex: 1;
}

.top-btn {
  background-color: #f5f5f5;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #333;
  font-size: 1.1em;
}

.top-btn:hover {
  background-color: #e0e0e0;
  transform: scale(1.05);
}

.top-btn.active {
  background-color: #0066cc;
  color: white;
}

/* Custom icons for buttons */
.top-btn .custom-icon {
  font-weight: bold;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

/* Uniforme button - U in white on black background */
.top-btn.uniforme-btn {
  background-color: #000;
  color: #fff;
}

/* Prima button - P on orange-yellow gradient */
.top-btn.prima-btn {
  background: linear-gradient(135deg, #ff8800 0%, #ffcc00 100%);
  color: #fff;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

#desktop {
  flex: 1;
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 20px;
  overflow-y: auto;
}

.section-title {
  grid-column: 1 / -1;
  font-size: 1.2em;
  color: #333;
  margin-top: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #ddd;
}

/* Windows-style folder style */
.folder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  padding: 15px 10px;
  background-color: transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.2s;
  animation: fadeIn 0.3s ease-out;
  position: relative;
  height: 120px;
}

.folder:hover {
  background-color: rgba(255, 255, 255, 0.7);
}

.folder:active {
  background-color: rgba(200, 220, 255, 0.7);
}

.folder i, .folder .unicode-icon {
  font-size: 3.5em;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 60px;
  width: 100%;
}

.unicode-icon {
  font-size: 3.5em;
}

.folder span {
  font-size: 0.9em;
  word-wrap: break-word;
  max-width: 100%;
  line-height: 1.2;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);
}

.back-button {
  background-color: rgba(224, 224, 224, 0.7);
}

.folder .options {
  position: absolute;
  top: 5px;
  right: 5px;
  background: rgba(248, 248, 248, 0.8);
  border-radius: 50%;
  padding: 5px;
  font-size: 0.8em;
  opacity: 0;
  transition: opacity 0.2s;
}

.folder:hover .options {
  opacity: 1;
}

#taskbar {
  background-color: #333;
  padding: 10px;
  display: flex;
  justify-content: space-around;
  position: sticky;
  bottom: 0;
}

.taskbar-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 8px;
  transition: background-color 0.2s;
  border-radius: 8px;
}

.taskbar-btn i {
  font-size: 1.5em;
  margin-bottom: 4px;
}

.taskbar-btn span {
  font-size: 0.8em;
}

.taskbar-btn:hover {
  background-color: #444;
}

.taskbar-btn.active {
  background-color: #555;
}

.installed-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #4CAF50;
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

/* Installed app styling */
.installed-app {
  background-color: rgba(230, 247, 255, 0.3);
  position: relative;
}

.installed-app::after {
  content: '✓';
  position: absolute;
  bottom: 5px;
  right: 5px;
  background: #4CAF50;
  color: white;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Modal styles */
.modal {
  display: none;
  position: fixed;
  z-index: 999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.6);
  overflow-y: auto;
}

.modal-content {
  background-color: #fff;
  margin: 15% auto;
  padding: 20px;
  border-radius: 15px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
  animation: slideIn 0.3s ease-out;
  position: relative;
}

.close-modal {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close-modal:hover {
  color: #333;
}

#modal-app-info {
  display: flex;
  align-items: center;
  margin: 20px 0;
}

.app-icon {
  font-size: 3.5em;
  margin-right: 20px;
  background: #f5f5f5;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 15px;
}

.app-details h3 {
  margin-bottom: 5px;
}

.app-details p {
  color: #666;
  margin-bottom: 5px;
}

.modal-buttons {
  display: flex;
  justify-content: space-around;
  margin-top: 20px;
}

.action-btn {
  background-color: #4285F4;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: background-color 0.2s;
}

.action-btn i {
  margin-right: 8px;
}

.action-btn:hover {
  background-color: #2d6eda;
}

#install-btn {
  background-color: #4CAF50;
}

#install-btn:hover {
  background-color: #3d8b40;
}

#share-btn {
  background-color: #FF5722;
}

#share-btn:hover {
  background-color: #e64a19;
}

@keyframes slideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Shadow effect for icons to improve visibility */
.folder i, .folder .unicode-icon {
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
  color: #0066cc;
}

.folder .unicode-icon {
  filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.3));
}

/* Styles pour la fonctionnalité d'ajout d'applications */
.tabs {
  display: flex;
  margin-bottom: 20px;
  border-bottom: 1px solid #ddd;
}

.tab-btn {
  background: none;
  border: none;
  padding: 10px 20px;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: bold;
  color: #666;
}

.tab-btn.active {
  color: #4285F4;
  border-bottom: 3px solid #4285F4;
}

.tab-content {
  display: none;
  padding: 10px 0;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s;
}

.file-upload-container {
  margin: 20px 0;
  text-align: center;
}

.file-upload-label {
  display: inline-block;
  background-color: #f5f5f5;
  color: #333;
  padding: 12px 20px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.file-upload-label:hover {
  background-color: #e0e0e0;
}

.file-upload-label i {
  margin-right: 8px;
}

#html-file {
  display: none;
}

.file-name {
  margin-top: 10px;
  color: #666;
  font-style: italic;
}

.app-details-form {
  margin: 20px 0;
}

.app-details-form label {
  display: block;
  margin-bottom: 15px;
  font-weight: bold;
  color: #555;
}

.app-details-form input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
  margin-top: 5px;
}

.icon-selector {
  display: flex;
  align-items: center;
  margin-top: 10px;
}

.selected-icon {
  width: 60px;
  height: 60px;
  background-color: #f5f5f5;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 15px;
  border: 1px solid #ddd;
}

.icon-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 15px;
  max-height: 300px;
  overflow-y: auto;
  padding: 10px;
}

.icon-option {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f5f5f5;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.icon-option:hover {
  background-color: #e0e0e0;
  transform: scale(1.1);
}

.custom-app-folder {
  background-color: rgba(255, 241, 184, 0.3);
}

.custom-app-folder::after {
  content: '⚙️';
  position: absolute;
  bottom: 5px;
  right: 5px;
  background: #FF9800;
  color: white;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Bouton flottant pour ajouter une app */
.floating-add-btn {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 60px;
  height: 60px;
  background-color: #4CAF50;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  cursor: pointer;
  transition: all 0.3s;
  z-index: 90;
}

.floating-add-btn i {
  font-size: 24px;
}

.floating-add-btn:hover {
  transform: scale(1.1);
  background-color: #3d8b40;
}

/* Styles pour la fenêtre modale plein écran des applications */
.app-fullscreen-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  background: var(--app-bg-color, rgba(255, 255, 255, 0.95));
  backdrop-filter: var(--app-blur, blur(0px));
}

.app-window-content {
  width: 100%;
  height: 100%;
  position: relative;
}

.app-window-content iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
}

.app-controls {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 10px;
  padding: 5px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 20px;
  backdrop-filter: blur(5px);
}

.app-control-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: #333;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.app-control-btn:hover {
  background: white;
  transform: scale(1.1);
}

/* Panel de configuration */
.app-settings-panel {
  position: absolute;
  top: 60px;
  right: 10px;
  background: rgba(255, 255, 255, 0.95);
  padding: 20px;
  border-radius: 15px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
  display: none;
  min-width: 250px;
}

.settings-group {
  margin-bottom: 15px;
}

.settings-group h3 {
  margin-bottom: 10px;
  color: #333;
  font-size: 1em;
}

.settings-control {
  margin: 10px 0;
}

.settings-control label {
  display: block;
  margin-bottom: 5px;
  color: #666;
}

.settings-control input[type="range"] {
  width: 100%;
}

.settings-control input[type="color"] {
  width: 100%;
  height: 40px;
  padding: 2px;
}

/* Styles responsifs */
@media (max-width: 768px) {
  #desktop {
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 15px;
    padding: 15px;
  }

  .folder {
    height: 110px;
    padding: 10px 5px;
  }

  .folder i, .folder .unicode-icon {
    font-size: 3em;
    height: 50px;
  }

  .folder span {
    font-size: 0.8em;
  }

  .section-title {
    font-size: 1em;
  }
  
  .modal-content {
    width: 90%;
    margin: 25% auto;
    padding: 15px;
  }
  
  .app-icon {
    width: 60px;
    height: 60px;
    font-size: 2.5em;
  }
  
  .modal-buttons {
    flex-direction: column;
    gap: 10px;
  }
  
  .action-btn {
    width: 100%;
    justify-content: center;
    margin-bottom: 5px;
  }
  
  .tabs {
    flex-wrap: wrap;
  }
  
  .tab-btn {
    flex: 1;
    min-width: 120px;
    text-align: center;
    padding: 8px 10px;
  }
  
  .icon-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  /* Amélioration pour "Mes applications" */
  .installed-app-section {
    grid-column: 1 / -1;
    width: 100%;
    margin-bottom: 15px;
  }

  .search-wrapper {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 5px;
  }

  .search-bar {
    width: 70%;
    min-width: 150px;
  }

  .top-buttons {
    gap: 5px;
    flex-wrap: nowrap;
    justify-content: flex-end;
    flex: 0 0 auto;
  }
  
  .top-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
  }
  
  .app-controls {
    top: auto;
    bottom: 10px;
  }
  
  .app-settings-panel {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 320px;
  }
}

/* Pour les très petits écrans */
@media (max-width: 400px) {
  .search-bar {
    width: 65%;
  }
  
  .top-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    font-size: 0.9em;
  }
  
  #search-container {
    padding: 10px;
  }
}

/* Section pour applications installées */
.installed-app-section {
  padding: 10px;
  background-color: rgba(240, 248, 255, 0.5);
  border-radius: 10px;
  margin-bottom: 20px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.installed-app-section h3 {
  margin-bottom: 10px;
  color: #0066cc;
  font-weight: 500;
}

.no-apps-message {
  grid-column: 1 / -1;
  text-align: center;
  padding: 20px;
  color: #666;
  background-color: rgba(240, 240, 240, 0.5);
  border-radius: 10px;
  margin: 10px 0;
}

/* Styles pour le sélecteur de thème */
.theme-container {
  padding: 20px;
  background-color: white;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  margin-bottom: 20px;
}

.theme-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 15px;
  margin-top: 15px;
}

.theme-option {
  border-radius: 10px;
  height: 80px;
  cursor: pointer;
  transition: all 0.3s;
  border: 2px solid transparent;
  overflow: hidden;
}

.theme-option:hover {
  transform: scale(1.05);
}

.theme-option.active {
  border-color: #4285F4;
  box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.5);
}

.theme-option.light {
  background: linear-gradient(to right, #f0f0f0, #ffffff);
}

.theme-option.dark {
  background: linear-gradient(to right, #333333, #555555);
}

.theme-option.blue {
  background: linear-gradient(to right, #e6f0ff, #cce0ff);
}

.theme-option.green {
  background: linear-gradient(to right, #e6ffee, #ccffdd);
}

.theme-name {
  text-align: center;
  margin-top: 5px;
  font-size: 0.9em;
  color: #666;
}