:root {
  --primary-color: #2c3e50;
  --secondary-color: #34495e;
  --background-color: #ffffff;
  --card-background: #f8f9fa;
  --text-color: #2c3e50;
  --border-color: #e9ecef;
  --success-color: #4CAF50;
  --error-color: #f44336;
  --warning-color: #ff9800;
  --bg-color: #f8f9fa;
  --card-bg: #fff;
  --shadow: 0 2px 4px rgba(0,0,0,0.1);
  --border-radius: 12px;
  --link-color: #007bff;
  --link-hover-color: #0056b3;
  --hover-color: #0056b3;
  --card-padding: 20px;
  --card-margin: 15px;
  --modal-shadow: 0 4px 8px rgba(0,0,0,0.2);
  --modal-overlay: rgba(0, 0, 0, 0.7);
  --modal-padding: 20px;
  --modal-max-width: 1000px;
  --modal-info-max-width: 800px;
}

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

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

.container {
  max-width: 1800px;
  margin: 0 auto;
  padding: 2rem;
  width: 100%;
}

.main-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.card {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 20px;
  transition: transform 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
}

h1 {
  text-align: center;
  color: var(--primary-color);
  margin-bottom: 2rem;
  font-size: 2.5rem;
}

h2 {
  font-size: 1.2em;
  color: var(--primary-color);
  margin-bottom: 1em;
  padding-bottom: 0.5em;
  border-bottom: 2px solid var(--primary-color);
}

pre {
  font-family: 'Consolas', monospace;
  font-size: 0.9em;
  white-space: pre-wrap;
  background: #f8f9fa;
  padding: 10px;
  border-radius: 6px;
  margin: 0;
}

.project-summary {
  background: #f8f9fa;
  border-left: 4px solid var(--primary-color);
  padding: 1em;
  margin: 1em 0;
  font-size: 0.95em;
  line-height: 1.6;
}

.project-summary a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
}

.project-summary a:hover {
  text-decoration: underline;
}

/* Status indicators */
.status-ok {
  color: #28a745;
}

.status-warning {
  color: #ffc107;
}

.status-error {
  color: #dc3545;
}

/* Loading animation */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  .servers-grid {
    grid-template-columns: 1fr;
  }
  
  .server-card {
    max-width: 100%;
    min-height: 500px;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 1rem;
    width: 100%;
  }
  
  h1 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    padding: 0 1rem;
  }
  
  .server-card {
    margin: 0.5rem 0;
    padding: 1rem;
  }
  
  .server-card h2 {
    font-size: 1.4rem;
    margin-bottom: 0.8rem;
  }
  
  .server-card span {
    font-size: 0.9rem;
    display: block;
    margin-bottom: 1rem;
    line-height: 1.4;
  }
  
  .pool-link {
    margin-bottom: 1rem;
  }
  
  .pool-link a {
    font-size: 0.9rem;
    display: block;
    margin: 0.5rem 0;
  }
  
  .status-container {
    gap: 1rem;
  }
  
  .status-item {
    padding: 0.8rem;
  }
  
  .status-item h3 {
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
  }
  
  .status-item pre {
    font-size: 0.9rem;
    padding: 0.8rem;
  }
  
  .total-requests {
    margin: 1rem 0;
    padding: 0.8rem;
  }
  
  .total-requests h2 {
    font-size: 1.2rem;
  }
  
  .total-counter {
    font-size: 2rem;
  }
  
  .ntp-stats-table {
    font-size: 0.8rem;
  }
  
  .ntp-stats-table td {
    padding: 3px 6px;
  }

  /* Modal responsive */
  .modal-content,
  .info-modal-content {
    width: 90%;
    margin: 10% auto;
    padding: 1.5rem;
    max-height: 80vh;
    overflow-y: auto;
  }

  /* Footer responsive */
  .footer {
    padding: 1.5rem 0 1rem 0;
  }

  .footer-buttons {
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    max-width: 320px;
  }

  .footer-buttons .button {
    width: 100%;
    max-width: none;
    min-width: 0;
    height: 48px;
    font-size: 1rem;
  }

  .footer-buttons .button svg {
    width: 1.4em;
    height: 1.4em;
    margin-right: 12px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0.5rem;
  }
  
  h1 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
  }
  
  .server-card {
    margin: 0.3rem 0;
    padding: 0.8rem;
  }
  
  .server-card h2 {
    font-size: 1.2rem;
  }
  
  .server-card span {
    font-size: 0.85rem;
  }
  
  .pool-link a {
    font-size: 0.85rem;
  }
  
  .status-item {
    padding: 0.6rem;
  }
  
  .status-item h3 {
    font-size: 1rem;
  }
  
  .status-item pre {
    font-size: 0.85rem;
    padding: 0.6rem;
  }
  
  .total-requests h2 {
    font-size: 1.1rem;
  }
  
  .total-counter {
    font-size: 1.8rem;
  }
  
  .ntp-stats-table {
    font-size: 0.75rem;
  }

  /* Modal responsive */
  .modal-content,
  .info-modal-content {
    width: 95%;
    margin: 5% auto;
    padding: 1rem;
    max-height: 90vh;
  }

  /* Footer responsive */
  .footer {
    padding: 1rem 0 0.8rem 0;
  }

  .footer-buttons {
    gap: 0.8rem;
  }

  .footer-buttons .button {
    height: 44px;
    font-size: 0.95rem;
  }

  /* Image UML responsive */
  #umlModal .modal-content {
    padding: 0.8rem;
  }

  #umlModal .modal-content img {
    width: 100%;
  }
}

.servers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 750px), 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  padding: 0 1rem;
}

#stratum2 {
  grid-column: 1 / -1;
  max-width: 800px;
  margin: 0 auto;
}

.server-card {
  background: var(--background-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: var(--card-padding);
  margin: var(--card-margin);
  width: 100%;
  min-height: auto;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: visible;
}

.server-card .server-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  max-height: none;
  overflow-y: visible;
}

.server-card h2 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-color);
}

.status-container {
  display: grid;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.status-item {
  background-color: var(--background-color);
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  min-height: fit-content;
}

.status-item h3 {
  color: var(--secondary-color);
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.status-item pre {
  background-color: var(--card-background);
  padding: 1rem;
  border-radius: 4px;
  overflow-x: auto;
  font-family: 'Consolas', monospace;
  font-size: 0.9rem;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.server-card .server-status {
  margin-top: 10px;
  padding: 10px;
  border-radius: 5px;
  background: #f8f9fa;
  height: 750px;
  overflow-y: auto;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.stats-card {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 15px;
  transition: transform 0.2s ease;
}

.stats-card:hover {
  transform: translateY(-2px);
}

.stats-card h2 {
  font-size: 1.1em;
  margin-bottom: 0.5em;
  color: var(--primary-color);
  border-bottom: 1px solid var(--primary-color);
  padding-bottom: 0.3em;
}

.stats-card pre {
  font-size: 0.85em;
  margin: 0;
  padding: 8px;
  background: #f8f9fa;
  border-radius: 6px;
  white-space: pre-line;
  line-height: 1.5;
}

.card pre {
  font-size: 0.85em;
  margin: 0;
  padding: 8px;
  background: #f8f9fa;
  border-radius: 6px;
  white-space: pre-line;
  line-height: 1.5;
}

.pool-link {
  margin-bottom: 1rem;
}

.pool-link a {
  color: var(--link-color);
  text-decoration: none;
  display: inline-block;
  margin: 0.2rem 0;
}

.pool-link a:hover {
  color: var(--link-hover-color);
  text-decoration: underline;
}

.ntp-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ntp-info .gps-info {
  background: var(--card-background);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.ntp-info .gps-info p {
    margin: 0.5rem 0;
}

.ntp-info .ntp-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.buttons-container {
    display: flex;
    justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
}

.buttons-container .button {
    display: flex;
    align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 4px;
  background-color: var(--primary-color);
    color: white;
  cursor: pointer;
  transition: all 0.3s ease;
    text-decoration: none;
}

.buttons-container .button:hover {
  background-color: var(--secondary-color);
  transform: translateY(-2px);
}

.buttons-container .button svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Style pour les modals */
.modal,
.info-modal {
    display: none;
    position: fixed;
  z-index: 1000;
  left: 0;
    top: 0;
    width: 100%;
    height: 100%;
  background-color: var(--modal-overlay);
    overflow: auto;
}

.modal-content,
.info-modal-content {
    position: relative;
  background-color: var(--card-background);
  margin: 5% auto;
    padding: var(--modal-padding);
  width: 85%;
  border-radius: var(--border-radius);
  box-shadow: var(--modal-shadow);
  box-sizing: border-box;
}

.modal-content {
    max-width: var(--modal-max-width);
}

.info-modal-content {
    max-width: var(--modal-info-max-width);
    background: linear-gradient(to bottom, #ffffff, #f8f9fa);
    border: 1px solid var(--border-color);
}

.info-modal-content h2 {
    color: var(--primary-color);
    margin-bottom: 2rem;
    font-size: 2.2rem;
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 1rem;
    text-align: center;
    font-weight: 600;
}

.info-modal-content h3 {
    color: var(--secondary-color);
    margin: 2rem 0 1.2rem;
    font-size: 1.6rem;
    font-weight: 500;
    padding-left: 1rem;
    border-left: 4px solid var(--primary-color);
}

.info-modal-content p {
    margin-bottom: 1.5rem;
    line-height: 1.8;
    font-size: 1.1rem;
    color: #444;
    text-align: justify;
}

.info-modal-content ul {
    list-style: none;
    padding-left: 2rem;
    margin-bottom: 2rem;
}

.info-modal-content li {
    margin-bottom: 1rem;
    position: relative;
    padding-left: 1.5rem;
    line-height: 1.6;
    font-size: 1.1rem;
}

.info-modal-content li:before {
    content: "→";
    color: var(--primary-color);
    font-weight: bold;
    position: absolute;
    left: 0;
    transition: transform 0.3s ease;
}

.info-modal-content li:hover:before {
    transform: translateX(5px);
}

.modal-content img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.close-button,
.info-close-button {
    position: absolute;
  right: 10px;
  top: 10px;
  font-size: 24px;
    font-weight: bold;
  color: var(--text-color);
    cursor: pointer;
    background: none;
    border: none;
    padding: 5px 10px;
  border-radius: 4px;
  transition: background-color 0.3s;
  z-index: 1001;
}

.close-button:hover,
.info-close-button:hover {
  background-color: var(--hover-color);
}

/* Style pour le footer et ses boutons */
.footer {
    width: 100%;
    background: #fff;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
    padding: 32px 0 24px 0;
    margin-top: 48px;
    display: flex;
    justify-content: center;
}

.footer-buttons {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    justify-content: center;
    padding: 0 16px;
    max-width: 100%;
}

.footer-buttons .button {
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    transition: all 0.3s;
    font-size: 1.1em;
    cursor: pointer;
    border: none;
    min-width: 180px;
    max-width: 240px;
    height: 44px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 16px;
    box-sizing: border-box;
}

.footer-buttons .uml-button {
    background-color: var(--success-color);
}

.footer-buttons .uml-button:hover {
    background-color: #45a049;
}

.footer-buttons .info-button {
    background-color: #2196F3;
}

.footer-buttons .info-button:hover {
    background-color: #1976D2;
}

.footer-buttons .hardware-button {
    background-color: var(--warning-color);
}

.footer-buttons .hardware-button:hover {
    background-color: #e65100;
}

.footer-buttons .button svg {
    width: 1.2em;
    height: 1.2em;
    margin-right: 8px;
    flex-shrink: 0;
    display: block;
}

/* Style pour le carrousel */
.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  padding: 1rem;
  cursor: pointer;
  font-size: 1.5rem;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s;
}

.carousel-arrow:hover {
  background: rgba(0, 0, 0, 0.8);
}

.carousel-arrow.left {
  left: 10px;
}

.carousel-arrow.right {
  right: 10px;
}

/* Style spécifique pour le modal hardware */
#hardwareModal .modal-content {
  max-width: 700px;
  padding: 40px 20px;
}

#hardwareModal img {
  max-width: 100%;
  max-height: 60vh;
  display: block;
  margin: 0 auto;
}

.ntp-stats-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-family: 'Consolas', monospace;
    font-size: 0.9em;
    table-layout: fixed;
}

.ntp-stats-table td {
    padding: 4px 8px;
    border-bottom: 1px solid var(--border-color);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.ntp-stats-table td:first-child {
    color: var(--secondary-color);
    font-weight: 500;
    width: 60%;
}

.ntp-stats-table td:last-child {
    text-align: right;
    font-family: 'Consolas', monospace;
    width: 40%;
}

.total-requests {
    text-align: center;
    margin: 1rem 0 2rem 0;
    padding: 1rem;
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.total-requests h2 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    border: none;
}

.total-counter {
    font-family: 'Consolas', monospace;
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--primary-color);
    font-variant-numeric: tabular-nums;
}

/* Style pour l'image du schéma */
.info-modal-content img {
    width: 70%;
    height: auto;
    display: block;
    margin: 2rem auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: transform 0.3s ease;
}

.info-modal-content img:hover {
    transform: scale(1.02);
}

/* Ajustement responsive pour l'image */
@media (max-width: 1200px) {
    .info-modal-content img {
        width: 80%;
    }
}

@media (max-width: 768px) {
    .info-modal-content img {
        width: 90%;
        margin: 1.5rem auto;
    }
}

@media (max-width: 480px) {
    .info-modal-content img {
        width: 100%;
        margin: 1rem auto;
    }
}

/* Style spécifique pour l'image UML */
#umlModal .modal-content {
    max-width: 90%;
    padding: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

#umlModal .modal-content img {
    width: 70%;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: transform 0.3s ease;
}

#umlModal .modal-content img:hover {
    transform: scale(1.02);
}

/* Ajustement responsive pour l'image UML */
@media (max-width: 1200px) {
    #umlModal .modal-content img {
        width: 80%;
    }
}

@media (max-width: 768px) {
    #umlModal .modal-content {
        padding: 1.5rem;
    }
    
    #umlModal .modal-content img {
        width: 90%;
    }
}

@media (max-width: 480px) {
    #umlModal .modal-content {
        padding: 1rem;
    }
    
    #umlModal .modal-content img {
        width: 100%;
    }
}

/* Style pour les textes d'avertissement */
.warning-text {
    color: #FF8C00; /* Orange foncé */
    font-weight: 500;
    padding: 0.5rem;
    border-left: 3px solid #FF8C00;
    background-color: rgba(255, 140, 0, 0.1);
    border-radius: 0 4px 4px 0;
    margin: 0.5rem 0;
}
