/* Reset/Normalize CSS */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
ul,
ol,
li {
  margin: 0;
  padding: 0;
}

button {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  outline: inherit;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

:root {
  --primary-color: #234323;
  --secondary-color: #b9e0a5;
  --dark-color: #1a2e1a;
  --light-color: #e9f5e9;
  --accent-color: #ffcc00;
  --text-color: #333;
  --text-light: #fff;
  --disabled-opacity: 0.25;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f8f8f8;
  color: var(--text-color);
  padding: 20px;
  line-height: 1.4;
}

.app-container {
  max-width: 1400px;
  margin: 0 auto;
  background-color: white;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.app-header {
  background-color: var(--primary-color);
  color: var(--text-light);
  padding: 20px;
  text-align: center;
}

.main-layout {
  display: flex;
  min-height: calc(100vh - 120px);
  transition: all 0.3s ease;
}

.main-content {
  flex: 1;
  transition: all 0.3s ease;
}

.selection-sidebar {
  width: 0;
  overflow: hidden;
  background-color: var(--light-color);
  transition: all 0.3s ease;
  opacity: 0;
}

.selection-sidebar.active {
  width: 280px;
  opacity: 1;
  overflow-y: auto;
}

.selection-sidebar.active {
  transform: translateX(0);
  opacity: 1;
}

.sidebar-header {
  background-color: var(--primary-color);
  color: var(--text-light);
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}

.sidebar-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.sidebar-content {
  padding: 20px;
  min-height: 200px;
}

.selection-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.selection-tag {
  background-color: var(--secondary-color);
  color: var(--text-color);
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
}

.detail-box {
  padding: 15px;
  background-color: rgba(35, 67, 35, 0.1);
  border-radius: 8px;
}

.detail-box ul {
  margin: 0;
  padding-left: 20px;
}

.detail-box li {
  margin-bottom: 12px;
  line-height: 1.4;
  font-size: 14px;
}

.app-title {
  margin: 0;
  font-size: 2.3em;
  font-weight: 600;
}

.app-subtitle {
  margin: 10px auto 0 auto;
  padding: 0;
  font-size: 14px;
  opacity: 0.9;
  font-weight: 400;
  line-height: 1.3;
  max-width: 600px;
}

.reset-button {
  background-color: rgb(190, 238, 208);
  color: black;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.reset-button:hover {
  background-color: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.reset-button span {
  font-size: 14px;
}

@media (max-width: 768px) {
  .main-layout {
    flex-direction: column;
  }

  .selection-sidebar {
    width: 100% !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    max-height: 70vh;
    transform: translateY(100%);
    opacity: 1;
  }

  .selection-sidebar.active {
    transform: translateY(0);
  }

  .sidebar-header {
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
  }

  .reset-button {
    justify-content: center;
    width: 100%;
  }
}

.matrix-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 2px;
}

.matrix-table th {
  background-color: var(--dark-color);
  color: var(--text-light);
  text-align: center;
  padding: 12px;
  font-weight: 600;
  font-size: 14px;
}

.matrix-table td {
  background-color: var(--secondary-color);
  padding: 15px;
  vertical-align: top;
}

.category-title {
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 15px;
  font-size: 16px;
  text-align: center;
}

.item-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  min-height: 100px;
}

.format-item {
  position: relative;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background-color: var(--dark-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  color: white;
  font-weight: 500;
  font-size: 11px;
  text-align: center;
  margin-bottom: 25px;
  padding: 5px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
  line-height: 1.1;
}

.format-item:hover {
  transform: scale(1.05);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  z-index: 10;
}

.format-item.active {
  border: 3px solid var(--accent-color);
  transform: scale(1.05);
  box-shadow: 0 0 10px var(--accent-color);
}

.format-item.disabled {
  opacity: var(--disabled-opacity);
  cursor: not-allowed;
  filter: grayscale(80%);
}

.format-label {
  position: absolute;
  bottom: -25px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 11px;
  color: var(--text-color);
  font-weight: 500;
  line-height: 1.2;
}

.tooltip-box {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(0, 0, 0, 0.95);
  color: white;
  padding: 10px 15px;
  border-radius: 6px;
  font-size: 13px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease;
  pointer-events: none;
  min-width: 120px;
  max-width: 300px;
  white-space: nowrap;
  text-align: center;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 8px;
}

.tooltip-box::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: rgba(0, 0, 0, 0.95) transparent transparent transparent;
}

.format-item:hover .tooltip-box {
  opacity: 1;
  visibility: visible;
}

.format-item::after {
  content: "";
  position: absolute;
  bottom: -25px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  height: 25px;
  pointer-events: auto;
  z-index: 1;
}

.service-section {
  background-color: var(--dark-color);
  padding: 20px;
  min-height: 200px;
}

.service-title {
  color: white;
  margin-bottom: 20px;
  text-align: center;
  font-weight: 600;
  font-size: 18px;
}

.service-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.service-button {
  background-color: var(--secondary-color);
  color: var(--text-color);
  border: none;
  border-radius: 20px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.service-button:hover {
  background-color: var(--light-color);
  transform: translateY(-2px);
}

.service-button.active {
  background-color: var(--accent-color);
  color: var(--text-color);
  font-weight: 600;
}

.service-button.disabled {
  opacity: var(--disabled-opacity);
  cursor: not-allowed;
}

/* Types spécifiques avec couleurs différentes */
.bib-item {
  background-color: #3a6ba5;
}
.aut-item {
  background-color: #993366;
}
.rdf-item {
  background-color: #4caf50;
}
.marc-item {
  background-color: #9c27b0;
}
.dc-item {
  background-color: #ff9800;
}
.iso-item {
  background-color: #e91e63;
}
.source-item {
  background-color: #607d8b;
}
.encoding-item {
  background-color: #795548;
}
.exchange-item {
  background-color: #2196f3;
}
.selection-item {
  background-color: #8bc34a;
}
.recovery-item {
  background-color: #ff5722;
}
