* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background-color: #1e1e1e;
  color: #cccccc;
}

.app-container {
  display: flex;
  height: 100vh;
  width: 100vw;
}

/* SIDEBAR */
.sidebar {
  width: 300px;
  background-color: #252526;
  border-right: 1px solid #3e3e42;
  display: flex;
  flex-direction: column;
}

@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    height: 40vh;
    border-right: none;
    border-bottom: 1px solid #3e3e42;
  }
  .app-container {
    flex-direction: column;
  }
}

.sidebar-header {
  background-color: #0e639c;
  color: white;
  padding: 15px;
}

.sidebar-header h2 {
  font-size: 16px;
  font-weight: 600;
}

.tree-container {
  padding: 10px;
  overflow-y: auto;
  flex: 1;
}

.tree-item {
  padding: 8px 10px;
  cursor: pointer;
  border-radius: 4px;
  margin-bottom: 2px;
  font-size: 14px;
  transition:
    color 0.1s,
    background-color 0.1s;
}

.tree-item:hover {
  background-color: #37373d;
  color: #888888; /* Assombrit le texte en gris au hover comme demandé */
}

.tree-file {
  margin-left: 20px;
  color: #4fc1ff;
  border-left: 2px solid transparent;
}

.tree-directory {
  font-weight: bold;
}

/* MAIN CONTENT */
.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  padding: 10px;
}

.folder-card {
  background-color: #252526;
  border: 1px solid #3e3e42;
  border-radius: 8px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  max-height: 400px;
}

.folder-card h3 {
  font-size: 16px;
  margin-bottom: 10px;
  color: #4fc1ff;
  border-bottom: 1px solid #3e3e42;
  padding-bottom: 8px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.folder-card ul {
  list-style-type: none;
  overflow-y: auto;
  flex: 1;
}

.folder-card li {
  font-size: 13px;
  padding: 8px 4px;
  color: #cccccc;
  border-bottom: 1px solid #333333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.folder-card li:last-child {
  border-bottom: none;
}

.clickable {
  cursor: pointer;
  transition:
    color 0.1s,
    background-color 0.1s;
}

.clickable:hover {
  color: #888888; /* Texte fonce en gris ici aussi */
  background-color: #37373d;
  border-radius: 4px;
  padding-left: 8px;
}

.mail-viewer {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: #1e1e1e;
  overflow: hidden;
}

.mail-header {
  padding: 20px 30px;
  border-bottom: 1px solid #3e3e42;
  background-color: #252526;
}

.mail-header.hidden {
  display: none;
}

.mail-header h1 {
  font-size: 22px;
  margin-bottom: 15px;
  color: #ffffff;
  cursor: pointer;
  transition: color 0.2s ease;
}

.mail-header h1:hover {
  color: #888888;
}

.mail-meta p {
  font-size: 13px;
  color: #a6a6a6;
  margin-bottom: 5px;
}

.mail-body {
  padding: 30px;
  flex: 1;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.6;
}

.welcome-message {
  text-align: center;
  color: #858585;
  margin-top: 50px;
  font-size: 16px;
}

/* Iframe pour isoler le HTML du mail (sécurité et style) */
.mail-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background-color: #1e1e1e; /* Fond sombre pour coller au reste */
  border-radius: 4px;
}
