/* --- TABLEAU DE BORD --- */
.dashboard-container {
    width: 100%;
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background-color: #f4f7f6;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.dashboard-header {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 50px; /* Espace pour les boutons */
}

.dashboard-header h1 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
    font-size: 2.5em;
    font-weight: bold;
}

.mode-toggle {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 0;
    padding: 8px 16px;
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 0.85em;
    cursor: pointer;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.mode-toggle:hover {
    opacity: 1;
    background-color: #5a6268;
}

.control-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: #fff;
    padding: 20px;
    border-radius: 10px;
}

.panel-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 20px;
}

.segment-display-container {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
}
.seats-container {
    grid-column: 1 / 2;
    grid-row: 2 / 3;
}
.ride-mockup {
    grid-column: 2 / 3;
    grid-row: 1 / 3;
}

.left-panel, .right-panel {
    display: none;
}

.panel-title {
    font-size: 0.9em;
    font-weight: bold;
    color: #555;
    margin-bottom: 10px;
    text-align: center;
    text-transform: uppercase;
    background: #e9ecef;
    padding: 15px;
    border-radius: 8px;
}

.segment-display-container, .seats-container, .ride-mockup, .sonometer {
    background: #e9ecef;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.segment-display {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 6em;
    color: #ff4757;
    background-color: #2f3640;
    padding: 10px;
    border-radius: 5px;
    text-shadow: 0 0 10px #ff4757;
    line-height: 1;
}

.seats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    max-width: 200px;
    margin: 0 auto;
}

.seat {
    width: 30px;
    height: 30px;
    background-color: #ced4da;
    border-radius: 5px;
    border: 2px solid #adb5bd;
}

.seat.occupied {
    background-color: #27ae60;
    border-color: #2ecc71;
    box-shadow: 0 0 10px #27ae60;
}

.ride-mockup {
    position: relative;
    height: 100%;
    overflow: hidden;
    border-radius: 8px;
}

.ride-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.track-title {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 0.9em;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 3px black;
    text-transform: uppercase;
    z-index: 10;
}

.sensor {
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: #7f8c8d;
    border-radius: 50%;
    border: 2px solid #fff;
    z-index: 10;
}

.sensor.active {
    background-color: #f1c40f;
    box-shadow: 0 0 15px #f1c40f, 0 0 20px white;
}

.panel-bottom {
    display: flex;
    gap: 20px;
    align-items: stretch;
}

.sonometer {
    flex: 3;
}

.sonometer-bar {
    width: 100%;
    height: 40px;
    background-color: #ccc;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 10px;
}

.sonometer-level {
    height: 100%;
    background: linear-gradient(90deg, #27ae60, #f1c40f, #e74c3c);
}

.sonometer-value {
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
}

.controls {
    flex: 2;
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    background: #e9ecef;
    padding: 15px;
    border-radius: 8px;
}

.btn-control {
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1.2em;
    font-weight: bold;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-control.start {
    background-color: #2ecc71;
    box-shadow: 0 5px 0 #27ae60;
}
.btn-control.start:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 #27ae60;
}

.btn-control.stop {
    background-color: #e74c3c;
    box-shadow: 0 5px 0 #c0392b;
}
.btn-control.stop:active {
    top: 5px;
    box-shadow: 0 0 #c0392b;
}

.diagnostic-container {
    margin: 20px -20px -20px -20px;
    padding: 20px 20px 10px 20px;
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
}

.diagnostic-container .setting-item {
    padding-left: 0;
    padding-right: 0;
    background-color: transparent;
}

.diagnostic-container .setting-item:last-child {
    border-bottom: none;
}

.status-indicator {
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 5px;
    color: white;
    min-width: 70px;
    text-align: center;
}

.status-indicator.status-active {
    background-color: #28a745;
}

.status-indicator.status-inactive {
    background-color: #6c757d;
}

.motor-status {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 5px 15px;
    border-radius: 5px;
    font-size: 0.9em;
    font-weight: bold;
    z-index: 10;
    min-width: 120px;
    text-align: center;
}

/* --- FIN TABLEAU DE BORD --- */

/* --- RESPONSIVE TABLEAU DE BORD --- */
@media (max-width: 992px) {
    .panel-main {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    /* La maquette passe sous les autres panneaux sur les écrans plus petits */
    .ride-mockup {
        grid-column: 1 / 2;
        grid-row: 3 / 4;
        height: 300px; /* Hauteur fixe pour un meilleur affichage sur mobile */
    }
}

@media (max-width: 768px) {
    .dashboard-header h1 {
        font-size: 2em;
    }
    .segment-display {
        font-size: 4em;
    }
    .panel-bottom {
        flex-direction: column;
    }
    .controls {
        flex-direction: column;
    }
}
/* --- FIN RESPONSIVE TABLEAU DE BORD --- */


/* --- PAGE ACCUEIL --- */
.accueil-container {
    width: 100%;
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
}

.accueil-header h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 2.5em;
    font-weight: bold;
}

.attraction-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
}

.attraction-card {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
}

.attraction-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
}

.attraction-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    display: block;
}

.attraction-name-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    padding: 30px 20px 20px;
}

.attraction-name {
    color: white;
    font-size: 1.8em;
    font-weight: bold;
    text-shadow: 1px 1px 5px black;
}

/* --- RESPONSIVE ACCUEIL --- */
@media (max-width: 768px) {
    .attraction-grid {
        grid-template-columns: 1fr;
    }

    .accueil-header h1 {
        font-size: 2em;
    }
}


/* --- PAGE GESTION CAPTEURS --- */
.settings-container {
    width: 100%;
    max-width: 900px;
    margin: 20px auto;
    padding: 20px;
}

.settings-header h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 2.5em;
    font-weight: bold;
}

.settings-panel {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 20px;
    border-bottom: 1px solid #e9ecef;
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-info {
    flex: 1;
    padding-right: 20px;
}

.setting-title {
    font-size: 1.2em;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.setting-description {
    font-size: 0.9em;
    color: #6c757d;
}

.setting-input, .setting-select {
    padding: 8px 12px;
    border-radius: 5px;
    border: 1px solid #ced4da;
    font-size: 1em;
    min-width: 150px;
    text-align: center;
}

/* --- Toggle Switch --- */
.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}

.switch input { 
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
}

input:checked + .slider {
  background-color: #27ae60;
}

input:focus + .slider {
  box-shadow: 0 0 1px #27ae60;
}

input:checked + .slider:before {
  transform: translateX(26px);
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}
/* --- Fin Toggle Switch --- */


@media (max-width: 768px) {
    .settings-header h1 {
        font-size: 2em;
    }
    .setting-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
}


/* --- PAGE STATISTIQUES --- */
.stats-container {
    width: 100%;
    max-width: 1400px;
    margin: 20px auto;
    padding: 20px;
}

.stats-header h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 2.5em;
    font-weight: bold;
}

.stats-filters {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 30px;
}

.filter-group {
    display: flex;
    gap: 10px;
    background-color: #e9ecef;
    padding: 5px;
    border-radius: 8px;
}

.filter-btn {
    padding: 8px 15px;
    border: none;
    background-color: transparent;
    border-radius: 6px;
    font-weight: 600;
    color: #495057;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn.active {
    background-color: #fff;
    color: #27ae60;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
    margin-bottom: 25px;
}

.chart-container {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    height: 400px;
}

.chart-container-full {
    grid-column: 1 / -1;
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    height: 400px;
}

.chart-title {
    text-align: center;
    font-size: 1.2em;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
}

@media (max-width: 992px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

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

.table-container {
    margin-top: 20px;
    overflow-x: auto;
}

#tracking-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

#tracking-data-table th, #tracking-data-table td {
    border: 1px solid #ddd;
    padding: 8px 12px;
    text-align: left;
}

#tracking-data-table thead {
    background-color: #f2f2f2;
}

#tracking-data-table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

#tracking-data-table tbody tr:hover {
    background-color: #f1f1f1;
}

.diagnostic-container .setting-item {
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
    margin-bottom: 0;
    border-radius: 0;
}

.diagnostic-container .setting-item:last-child {
    border-bottom: 1px solid #dee2e6;
}

.status-indicator {
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 5px;
    color: white;
}

.status-indicator.status-active {
    background-color: #28a745;
}

.status-indicator.status-inactive {
    background-color: #6c757d;
} 