/* Styles généraux */
body {
    font-family: Arial, sans-serif;
    background-color: #f0f2f5;
    color: #333;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 900px;
    margin: 20px auto;
    padding: 0 20px;
}

header {
    background-color: white;
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid #ddd;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    position: relative;
}

header img {
    height: 50px;
    width: auto;
}

header h1 {
    margin: 10px 0 0;
    font-size: 1.8em;
    color: #4CAF50;
}

h2 {
    margin-top: 0;
    font-size: 1.5em;
    color: #4CAF50;
    border-bottom: 2px solid #ddd;
    padding-bottom: 5px;
    margin-bottom: 20px;
}

/* Bouton thÃ¨me */
#theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #4CAF50;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}
#theme-toggle:hover {
    background: #45a049;
}

/* Styles pour les cartes de dÃ©tection */
.recent-detection,
.recent-detections,
.stats,
.chart-container,
.top-species,
.unique-species {
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.detections-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.detection-card {
    display: flex;
    align-items: center;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 10px;
    transition: box-shadow 0.3s;
}

.detection-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.detection-card img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 5px;
    margin-right: 15px;
}

.detection-info {
    flex-grow: 1;
}

.detection-info .common-name {
    font-size: 1.4em;
    margin: 0;
    line-height: 1.2;
    font-weight: bold;
}

.detection-info .scientific-name {
    font-style: italic;
    font-size: 0.9em;
    margin: 0 0 5px 0;
    line-height: 1.2;
    color: #999;
}

.detection-info .confidence {
    display: block;
    font-size: 1em;
    color: #2196F3;
    font-weight: bold;
    margin-top: 5px;
}

.detection-info small {
    display: block;
    font-size: 0.8em;
    color: #999;
    margin-top: 5px;
}

/* Styles pour le tableau de stats */
.stats table {
    width: 100%;
    border-collapse: collapse;
}

.stats td {
    padding: 12px;
    font-weight: 600;
    font-size: 1.1em;
    border-bottom: 1px solid #f0f0f0;
    text-align: center;
}

.stats tr:last-child td {
    border-bottom: none;
}

.stats td:first-child {
    text-align: left;
}

.stats td:last-child {
    text-align: right;
    font-weight: 700;
    color: #4CAF50;
}

/* Styles pour le lien invisible */
.stats a {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    display: block;
}

.stats a:hover {
    text-decoration: underline;
}

/* Styles pour le nouveau tableau d'espÃ¨ces uniques */
.unique-species table {
    width: 100%;
    border-collapse: collapse;
    border: none;
}

.unique-species th, .unique-species td {
    padding: 12px;
    text-align: center;
    border: 1px solid #ccc;
}

.unique-species th {
    background-color: #f8f8f8;
    font-weight: bold;
    color: #4CAF50;
    white-space: nowrap;
}


/* Styles pour les graphiques */
.chart-container {
  min-height: 300px;
}

/* Styles pour le lecteur audio */
.audio-container {
    position: absolute;
    top: 20px;
    left: 20px;
}

.audio-container audio {
    width: 200px;
}

.audio-container button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    border-radius: 5px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: background-color 0.3s ease;
}

.audio-container button:hover {
    background-color: #45a049;
}

/* Styles des liens dans les cartes de dÃ©tection */
.bird-link,
.bird-link:visited {
    color: #4CAF50;
    text-decoration: none;
}

.bird-link:hover {
    text-decoration: underline;
}

/* Styles pour le top 5 */
.top-species ol {
    list-style: none;
    padding: 0;
    margin: 0;
}

.top-species li {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 1.1em;
    font-weight: 600;
}

.top-species li:last-child {
    border-bottom: none;
}

/* ---------------------- */
/* ðŸŽ MODE SOMBRE */
/* ---------------------- */
body.dark {
    background-color: #181a1b;
    color: #e0e0e0;
}

body.dark header {
    background-color: #242526;
    border-bottom: 1px solid #333;
}

body.dark h2 {
    color: #90caf9;
    border-color: #333;
}

body.dark .recent-detection,
body.dark .recent-detections,
body.dark .stats,
body.dark .chart-container,
body.dark .top-species,
body.dark .unique-species {
    background-color: #242526;
    color: #e0e0e0;
    border: 1px solid #333;
}

body.dark .stats td {
    border-bottom: 1px solid #333;
}

body.dark .stats tr:last-child td {
    border-bottom: none;
}

body.dark .stats td:last-child {
    color: #90caf9;
}

body.dark a,
body.dark .bird-link {
    color: #90caf9;
}

body.dark .stats a {
    color: inherit;
}

body.dark .unique-species th {
    background-color: #2c2d2e;
    color: #90caf9;
    border: 1px solid #555;
}

body.dark .unique-species th, body.dark .unique-species td {
    border: 1px solid #555;
}

/* Media Query pour les petits écrans */
@media (max-width: 600px) {
    .unique-species th, .unique-species td {
        padding: 5px;
        font-size: 0.7em;
        white-space: normal;
        overflow-wrap: break-word;
    }
}

