body {
    font-family: 'Arial', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f0f0f0;
    margin: 0;
    color: #333;
    transition: background-color 0.5s ease, color 0.5s ease;
}

#game-container {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 30px;
    text-align: center;
    max-width: 600px;
    width: 90%;
    position: relative;
    transition: background-color 0.5s ease, box-shadow 0.5s ease;
}

/* Settings button */
#settings-button {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: transparent;
    border: none;
    font-size: 1.8em;
    color: #3b4cca;
    cursor: pointer;
    transition: color 0.3s ease, transform 0.3s ease;
    padding: 5px;
}

/* Updates button */
#updates-button {
    position: absolute;
    top: 15px;
    left: 15px; /* Position in top-left */
    background-color: transparent;
    border: none;
    font-size: 1.8em;
    color: #3b4cca;
    cursor: pointer;
    transition: color 0.3s ease, transform 0.3s ease;
    padding: 5px;
}

#settings-button:hover,
#updates-button:hover {
    color: #2a3c9b;
    transform: rotate(30deg);
}

body.dark-mode #settings-button,
body.dark-mode #updates-button {
    color: #ffcb05;
}

body.dark-mode #settings-button:hover,
body.dark-mode #updates-button:hover {
    color: #e0b000;
}

h1 {
    color: #cc0000;
    margin-bottom: 20px;
}

/* Neon effect for main title */
#pokedex-title {
    color: #ff0000; /* Red color */
    text-shadow: 
        0 0 1px #ff0000,
        0 0 2px #ff0000,
        0 0 3px #ff0000; /* Reduced glow for readability */
    animation: neon-glow 1.5s ease-in-out infinite alternate;
}

/* Neon effect for pokedex modal title */
#pokedex-modal-title {
    color: #ff0000; /* Red color */
    text-shadow: 
        0 0 1px #ff0000,
        0 0 2px #ff0000,
        0 0 3px #ff0000; /* Reduced glow for readability */
    animation: neon-glow 1.5s ease-in-out infinite alternate;
}

/* Neon effect for updates modal title */
#updates-modal-title {
    color: #ff0000; /* Red color */
    text-shadow: 
        0 0 1px #ff0000,
        0 0 2px #ff0000,
        0 0 3px #ff0000; /* Reduced glow for readability */
    animation: neon-glow 1.5s ease-in-out infinite alternate;
}

@keyframes neon-glow {
    from {
        text-shadow: 
            0 0 1px #ff0000,
            0 0 2px #ff0000,
            0 0 3px #ff0000;
    }
    to {
        text-shadow: 
            0 0 2px #ff0000,
            0 0 4px #ff0000,
            0 0 6px #ff0000;
    }
}

/* New main navigation container */
#main-navigation {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px; /* Space between pokedex button and the others */
    margin-bottom: 20px;
}

/* Updated Pokedex button */
.pokedex-main-button {
    background-color: #ffcb05; /* Yellow color */
    color: #3b4cca; /* Blue text */
    border: none;
    padding: 8px 15px; /* Adjust padding for better look with icon */
    font-size: 1.1em; /* Adjust font size */
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px; /* Space between icon and text */
    z-index: 1; /* Ensure it's above other elements if needed */
    margin: 0; /* Removed margin auto */
}

.pokedex-main-button img {
    height: 30px; /* Adjust icon size */
    width: auto;
}

.pokedex-main-button:hover {
    background-color: #e0b000; /* Darker yellow on hover */
    transform: translateY(-2px); /* Slight lift on hover */
}

/* Container for additional buttons */
#additional-buttons-container {
    display: flex;
    justify-content: center; /* Center the buttons */
    align-items: center;
    flex-wrap: wrap; 
    gap: 10px; 
}

#additional-buttons-container button {
    background-color: #3b4cca; 
    color: white;
    border: none;
    padding: 8px 15px;
    font-size: 0.9em;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#additional-buttons-container button:hover {
    background-color: #2a3c9b;
}

#volume-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.volume-control-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 250px;
}

.volume-control-wrapper span {
    font-weight: bold;
    font-size: 1.1em;
}

#music-toggle-button, #sfx-toggle-button, #reset-game-button, #submit-secret-code {
    background-color: #3b4cca; 
    color: white;
    border: none;
    padding: 8px 15px;
    font-size: 0.9em;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#music-toggle-button:hover, #sfx-toggle-button:hover, #submit-secret-code:hover {
    background-color: #2a3c9b;
}

#catch-area {
    margin-top: 20px;
}

#open-pokeball-button, #open-pokedex-button {
    background-color: #ffcb05;
    color: #3b4cca;
    border: none;
    padding: 15px 30px;
    font-size: 1.2em;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin: 10px;
}

#open-pokeball-button:hover {
    background-color: #e0b000;
}

#pokeball-selection {
    margin-bottom: 20px;
}

.pokeball-type-button {
    background-color: #ffcb05; 
    color: #3b4cca; 
    border: none;
    padding: 15px 25px;
    font-size: 1.1em;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease;
    margin: 5px;
    display: inline-flex; 
    flex-direction: column; 
    align-items: center;
    justify-content: center;
    min-width: 150px; 
}

.pokeball-type-button img {
    max-width: 60px; 
    height: 60px;
    margin-bottom: 5px; 
}

.pokeball-type-button[data-ball-type="greatball"] {
    background-color: #4CAF50; 
    color: white;
}

.pokeball-type-button:hover {
    transform: translateY(-2px);
}

.pokeball-type-button[data-ball-type="pokeball"]:hover {
    background-color: #e0b000;
}

.pokeball-type-button[data-ball-type="greatball"]:hover {
    background-color: #45a049;
}

#pokemon-display {
    min-height: 150px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
    flex-wrap: wrap; 
    gap: 10px; 
}

#pokemon-display img {
    max-width: 100px; 
    height: auto;
    animation: bounceIn 0.8s ease-out;
}

#message {
    margin-top: 15px;
    font-size: 1.1em;
    color: #555;
}

#catch-count-selection {
    margin-top: 15px;
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

#catch-count-selection label {
    font-weight: bold;
    color: #3b4cca;
}

#catch-count-selection select {
    padding: 8px 12px;
    border-radius: 5px;
    border: 1px solid #ddd;
    background-color: #f0f0f0;
    font-size: 1em;
    cursor: pointer;
    outline: none;
    color: #333;
}

#catch-count-selection select:focus {
    border-color: #ffcb05;
    box-shadow: 0 0 0 2px rgba(255, 203, 5, 0.3);
}

/* Modal Styles */
.modal {
    display: none; 
    position: fixed; 
    z-index: 1; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(0,0,0,0.4); 
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto; 
    padding: 30px;
    border: 1px solid #888;
    border-radius: 10px;
    width: 80%; 
    max-width: 500px;
    position: relative;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    animation: fadeIn 0.5s;
    transition: background-color 0.5s ease, border-color 0.5s ease, box-shadow 0.5s ease;
}

.close-button {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.5s ease;
}

.close-button:hover,
.close-button:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.pokedex-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    gap: 10px;
    flex-wrap: wrap;
}

.pokedex-tab-buttons {
    display: flex;
    gap: 10px;
    margin-right: auto;
    flex-wrap: wrap;
}

.pokedex-tab-buttons button {
    background-color: #3b4cca;
    color: white;
    border: none;
    padding: 8px 15px;
    font-size: 0.9em;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.pokedex-tab-buttons button:hover {
    background-color: #2a3c9b;
}

.pokedex-tab-buttons button.active-tab-button {
    background-color: #ffcb05;
    color: #3b4cca;
    font-weight: bold;
}

#sort-control-container {
    display: flex; /* Ensure it's a flex container */
    align-items: center; /* Vertically align items */
    gap: 10px; /* Space between label and select */
    flex-grow: 1; /* Allow it to grow and take available space */
    justify-content: center; /* Center content horizontally */
}

.pokedex-controls label {
    font-weight: bold;
    color: #3b4cca;
}

.pokedex-controls select {
    padding: 8px 12px;
    border-radius: 5px;
    border: 1px solid #ddd;
    background-color: #f0f0f0;
    font-size: 1em;
    cursor: pointer;
    outline: none;
    color: #333;
}

.pokedex-controls select:focus {
    border-color: #ffcb05;
    box-shadow: 0 0 0 2px rgba(255, 203, 5, 0.3);
}

#pokedex-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
    margin-top: 20px;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 8px; /* For scrollbar space */
}

.pokedex-entry {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    background-color: #f9f9f9;
    position: relative; 
    transition: background-color 0.5s ease, border-color 0.5s ease;
}

.pokedex-entry img {
    max-width: 80px;
    height: auto;
    margin-bottom: 5px;
}

.pokedex-entry p {
    font-size: 0.9em;
    font-weight: bold;
    margin: 0;
    color: #333;
    transition: color 0.5s ease;
}

.pokedex-entry.unknown {
    opacity: 0.5;
}

.pokedex-entry .duplicate-count {
    position: absolute;
    top: 5px;
    left: 5px;
    background-color: #3b4cca;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.7em;
    font-weight: bold;
    z-index: 10;
    transition: background-color 0.5s ease, color 0.5s ease;
}

.pokedex-entry p.rarity-common {
    color: #007bff; 
    font-size: 0.8em;
    font-weight: normal;
    transition: color 0.5s ease;
}

.pokedex-entry p.rarity-uncommon {
    color: #28a745; 
    font-size: 0.8em;
    font-weight: normal;
    transition: color 0.5s ease;
}

.pokedex-entry p.rarity-rare {
    color: #ffc107; 
    font-size: 0.8em;
    font-weight: normal;
    transition: color 0.5s ease;
}

.pokedex-entry p.rarity-legendary {
    color: #dc3545; 
    font-size: 0.8em;
    font-weight: bold;
    transition: color 0.5s ease;
}

.pokedex-entry p.rarity-secret {
    color: #8A2BE2; 
    font-size: 0.8em;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(138, 43, 226, 0.5); 
    transition: color 0.5s ease, text-shadow 0.5s ease;
}

.pokedex-entry p.rarity-evolution {
    color: #9900cc; 
    font-size: 0.8em;
    font-weight: bold;
    transition: color 0.5s ease;
}

.pokedex-entry p.rarity-unknown {
    color: #6c757d; 
    font-size: 0.8em;
    font-weight: normal;
    transition: color 0.5s ease;
}

.pokedex-entry p.rarity-exotic {
    color: #FF1493; /* Deep pink color */
    font-size: 0.8em;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(255, 20, 147, 0.5);
    transition: color 0.5s ease, text-shadow 0.5s ease;
}

#pokedex-completion {
    font-weight: bold;
    margin-top: 10px;
    color: #3b4cca;
    transition: color 0.5s ease;
}

.chances-display {
    margin-top: 20px;
    text-align: left;
}

.chances-display h3 {
    color: #3b4cca;
    margin-bottom: 10px;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
    transition: color 0.5s ease, border-color 0.5s ease;
}

.chances-display ul {
    list-style: none;
    padding: 0;
    margin-bottom: 20px;
}

.chances-display li {
    background-color: #e9e9e9;
    margin-bottom: 5px;
    padding: 8px 15px;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.5s ease;
}

.chances-display li span:first-child {
    font-weight: bold;
    color: #555;
    transition: color 0.5s ease;
}

.chances-display li span:last-child {
    color: #cc0000;
    font-weight: bold;
    transition: color 0.5s ease;
}

.stats-display {
    margin-top: 20px;
    text-align: left;
}

.stats-display ul {
    list-style: none;
    padding: 0;
}

.stats-display li {
    background-color: #e9e9e9;
    margin-bottom: 8px;
    padding: 10px 15px;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1em;
    transition: background-color 0.5s ease;
}

.stats-display li span:first-child {
    font-weight: bold;
    color: #3b4cca;
    transition: color 0.5s ease;
}

.stats-display li span:last-child {
    font-weight: bold;
    color: #cc0000;
    transition: color 0.5s ease;
}

#evolution-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-top: 20px;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 8px;
}

.evolution-list-item {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    background-color: #f9f9f9;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    transition: background-color 0.2s ease, transform 0.2s ease, border-color 0.5s ease;
}

.evolution-list-item:hover {
    background-color: #e0e0e0;
    transform: translateY(-2px);
}

.evolution-list-item.unknown {
    opacity: 0.5;
    cursor: not-allowed !important;
}

.evolution-list-item img {
    max-width: 80px;
    height: auto;
    margin-bottom: 5px;
}

.evolution-list-item p {
    font-size: 0.9em;
    font-weight: bold;
    margin: 0;
    color: #333;
    word-break: break-word;
    transition: color 0.5s ease;
}

.evolution-chain {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    flex-wrap: wrap;
}

.evolution-chain-detail {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    transition: border-color 0.5s ease;
}

.evolution-chain .evolution-stage, .evolution-chain-detail .evolution-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 5px;
    min-width: 90px;
}

.evolution-chain .evolution-stage img, .evolution-chain-detail .evolution-stage img {
    max-width: 70px;
    height: auto;
    margin-bottom: 5px;
}

.evolution-chain .evolution-stage p, .evolution-chain-detail .evolution-stage p {
    font-size: 0.9em;
    font-weight: bold;
    margin: 0;
    text-align: center;
    word-break: break-word;
    transition: color 0.5s ease;
}

.evolution-chain .arrow, .evolution-chain-detail .arrow {
    font-size: 2em;
    font-weight: bold;
    color: #3b4cca;
    margin: 0 10px;
    white-space: nowrap;
    transition: color 0.5s ease;
}

.evolution-requirements {
    font-size: 0.9em;
    color: #666;
    margin-top: 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background-color: #e9e9e9;
    padding: 10px;
    border-radius: 5px;
    width: 90%;
    box-sizing: border-box;
    transition: background-color 0.5s ease, color 0.5s ease;
}

.evolve-button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 1em;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 5px;
}

.evolve-button:hover:not(:disabled) {
    background-color: #45a049;
}

.evolve-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

/* New modal for evolution detail */
#pokemon-evolution-detail-modal .modal-content {
    max-width: 600px;
}

#evolution-detail-content {
    margin-top: 20px;
    max-height: 250px;
    overflow-y: auto;
    padding-right: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

#evolution-detail-pokemon-name {
    color: #cc0000;
    margin-bottom: 15px;
}

#back-to-evolution-list-button {
    background-color: #3b4cca;
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 1em;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 20px;
}

#back-to-evolution-list-button:hover {
    background-color: #445599;
}

/* Updates Modal Specific Styles */
#updates-content {
    margin-top: 20px;
    text-align: left;
    max-height: 350px;
    overflow-y: auto;
    padding-right: 8px;
}

#updates-content h3 {
    color: #3b4cca;
    margin-bottom: 10px;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
    transition: color 0.5s ease, border-color 0.5s ease;
}

#updates-content ul {
    list-style: none;
    padding: 0;
    margin-bottom: 20px;
}

#updates-content li {
    background-color: #e9e9e9;
    margin-bottom: 10px;
    padding: 10px 15px;
    border-radius: 5px;
    transition: background-color 0.5s ease;
}

#updates-content li strong {
    display: block;
    margin-bottom: 5px;
    color: #555;
    transition: color 0.5s ease;
}

/* Dark Mode Styles */
body.dark-mode {
    background-color: #2c2c2c; /* Dark background */
    color: #e0e0e0; /* Light text */
}

body.dark-mode #game-container {
    background-color: #3c3c3c; /* Slightly lighter dark for container */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

body.dark-mode #pokedex-title,
body.dark-mode #pokedex-modal-title,
body.dark-mode #updates-modal-title {
    color: #ff5555; /* Brighter red for neon in dark mode */
    text-shadow: 
        0 0 1px #ff5555,
        0 0 2px #ff5555,
        0 0 3px #ff5555;
}

body.dark-mode #music-toggle-button,
body.dark-mode #sfx-toggle-button,
body.dark-mode #additional-buttons-container button, /* Dark mode for new buttons */
body.dark-mode #reset-game-button,
body.dark-mode #submit-secret-code {
    background-color: #5566aa; /* Darker blue for buttons */
    color: white;
}

body.dark-mode #music-toggle-button:hover,
body.dark-mode #sfx-toggle-button:hover,
body.dark-mode #additional-buttons-container button:hover, /* Dark mode hover for new buttons */
body.dark-mode #submit-secret-code:hover {
    background-color: #445599;
}

/* Updated Pokedex button */
body.dark-mode .pokedex-main-button {
    background-color: #ccaa00; /* Darker yellow */
    color: #eee; /* Lighter text for dark mode */
}

body.dark-mode .pokedex-main-button:hover {
    background-color: #bbaa00;
}

body.dark-mode #open-pokeball-button { /* Keep this if other buttons use the same style */
    background-color: #ccaa00; /* Darker yellow */
    color: #eee;
}

body.dark-mode #open-pokeball-button:hover {
    background-color: #bbaa00;
}

body.dark-mode .pokeball-type-button {
    background-color: #ccaa00;
    color: #eee;
}

body.dark-mode .pokeball-type-button[data-ball-type="greatball"] {
    background-color: #388e3c; /* Darker green */
    color: white;
}

body.dark-mode .pokeball-type-button[data-ball-type="pokeball"]:hover {
    background-color: #bbaa00;
}

body.dark-mode .pokeball-type-button[data-ball-type="greatball"]:hover {
    background-color: #307a34;
}

body.dark-mode #message {
    color: #bbb;
}

body.dark-mode #catch-count-selection label {
    color: #88aaff;
}

body.dark-mode #catch-count-selection select {
    background-color: #4c4c4c;
    border-color: #555;
    color: #eee;
}

/* Modal Dark Mode */
body.dark-mode .modal-content {
    background-color: #4c4c4c;
    border-color: #666;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.6);
}

body.dark-mode .close-button {
    color: #bbb;
}

body.dark-mode .close-button:hover,
body.dark-mode .close-button:focus {
    color: white;
    text-decoration: none;
    cursor: pointer;
}

body.dark-mode .pokedex-tab-buttons button {
    background-color: #5566aa;
    color: white;
}

body.dark-mode .pokedex-tab-buttons button:hover {
    background-color: #445599;
}

body.dark-mode .pokedex-tab-buttons button.active-tab-button {
    background-color: #ccaa00;
    color: #eee;
}

body.dark-mode .pokedex-controls label {
    color: #88aaff;
}

body.dark-mode .pokedex-controls select {
    background-color: #4c4c4c;
    border-color: #555;
    color: #eee;
}

body.dark-mode .pokedex-entry {
    background-color: #555555;
    border-color: #666;
}

body.dark-mode .pokedex-entry p {
    color: #eee;
}

body.dark-mode .pokedex-entry .duplicate-count {
    background-color: #5566aa;
    color: white;
}

body.dark-mode .pokedex-entry p.rarity-common {
    color: #88bbff; 
}

body.dark-mode .pokedex-entry p.rarity-uncommon {
    color: #77dd88; 
}

body.dark-mode .pokedex-entry p.rarity-rare {
    color: #ffee77; 
}

body.dark-mode .pokedex-entry p.rarity-legendary {
    color: #ff8888; 
}

body.dark-mode .pokedex-entry p.rarity-secret {
    color: #AA88EE; 
    text-shadow: 0 0 5px rgba(170, 136, 238, 0.5); 
}

body.dark-mode .pokedex-entry p.rarity-evolution {
    color: #bb66dd; 
}

body.dark-mode .pokedex-entry p.rarity-unknown {
    color: #999; 
}

body.dark-mode .pokedex-entry p.rarity-exotic {
    color: #FF69B4; /* Lighter pink for dark mode */
    text-shadow: 0 0 5px rgba(255, 105, 180, 0.5);
}

body.dark-mode #pokedex-completion {
    color: #88aaff;
}

body.dark-mode .chances-display h3 {
    color: #88aaff;
    border-color: #555;
}

body.dark-mode .chances-display li {
    background-color: #555555;
}

body.dark-mode .chances-display li span:first-child {
    color: #bbb;
}

body.dark-mode .chances-display li span:last-child {
    color: #ff8888;
}

body.dark-mode .stats-display li {
    background-color: #555555;
}

body.dark-mode .stats-display li span:first-child {
    color: #88aaff;
}

body.dark-mode .stats-display li span:last-child {
    color: #ff8888;
}

body.dark-mode .evolution-list-item {
    background-color: #555555;
    border-color: #666;
}

body.dark-mode .evolution-list-item:hover {
    background-color: #666666;
}

body.dark-mode .evolution-list-item p {
    color: #eee;
}

body.dark-mode .evolution-chain-detail {
    border-color: #555;
}

body.dark-mode .evolution-chain .evolution-stage p,
body.dark-mode .evolution-chain-detail .evolution-stage p {
    color: #eee;
}

body.dark-mode .evolution-chain .arrow,
body.dark-mode .evolution-chain-detail .arrow {
    color: #88aaff;
}

body.dark-mode .evolution-requirements {
    background-color: #555555;
    color: #bbb;
}

body.dark-mode .evolve-button {
    background-color: #388e3c;
    color: white;
}

body.dark-mode .evolve-button:hover:not(:disabled) {
    background-color: #307a34;
}

body.dark-mode #evolution-detail-pokemon-name {
    color: #ff8888;
}

body.dark-mode #back-to-evolution-list-button {
    background-color: #5566aa;
    color: white;
}

body.dark-mode #back-to-evolution-list-button:hover {
    background-color: #445599;
}

/* Dark mode for updates modal content */
body.dark-mode #updates-content h3 {
    color: #88aaff;
    border-color: #777;
}

body.dark-mode #updates-content li {
    background-color: #555555;
}

body.dark-mode #updates-content li strong {
    color: #bbb;
}

/* Volume Toggle Button */
.volume-toggle-button {
    background-color: #ccc;
    width: 100px;
    height: 42px;
    border-radius: 21px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2px;
    border: none;
}

.volume-toggle-button.active {
    background-color: #4CAF50; /* Green for ON */
}

.volume-toggle-button .toggle-circle {
    width: 36px;
    height: 36px;
    background-color: white;
    border-radius: 50%;
    position: absolute;
    top: 3px;
    left: 3px;
    transition: left 0.3s ease;
}

.volume-toggle-button.active .toggle-circle {
    left: calc(100% - 39px);
}

.volume-toggle-button .toggle-text {
    position: absolute;
    font-size: 1em;
    font-weight: bold;
    color: white;
    transition: opacity 0.2s ease;
}

.volume-toggle-button .on-text {
    left: 15px;
    opacity: 0;
}

.volume-toggle-button.active .on-text {
    opacity: 1;
}

.volume-toggle-button .off-text {
    right: 15px;
    opacity: 1;
}

.volume-toggle-button.active .off-text {
    opacity: 0;
}

/* New styles for dark mode toggle text */
.volume-toggle-button .light-text {
    right: 15px;
    opacity: 1;
}

.volume-toggle-button.active .light-text {
    opacity: 0;
}

.volume-toggle-button .dark-text {
    left: 15px;
    opacity: 0;
}

.volume-toggle-button.active .dark-text {
    opacity: 1;
}

body.dark-mode .volume-toggle-button {
    background-color: #555;
}

/* Center volume toggle buttons when in a settings section */
.settings-section .volume-toggle-button {
    margin: 0 auto;
}

/* Secret Code Input and Reset Game Button */
#secret-code-input-container {
    margin-top: 10px; /* Reduced margin */
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap; /* Allow wrapping for smaller screens */
}

#secret-code-input {
    padding: 8px 12px;
    border-radius: 5px;
    border: 1px solid #ddd;
    background-color: #f0f0f0;
    font-size: 1em;
    outline: none;
    color: #333;
    width: 180px;
}

#secret-code-input:focus {
    border-color: #ffcb05;
    box-shadow: 0 0 0 2px rgba(255, 203, 5, 0.3);
}

#reset-game-button {
    background-color: #dc3545; /* Red color for danger/reset */
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 1em;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#reset-game-button:hover {
    background-color: #c82333;
}

body.dark-mode #reset-game-button {
    background-color: #e65c5c; /* Slightly brighter red for dark mode */
}

body.dark-mode #reset-game-button:hover {
    background-color: #d14747;
}

/* Settings Modal Specific Styles */
#settings-modal h2 {
    color: #3b4cca;
    margin-bottom: 20px;
}

body.dark-mode #settings-modal h2 {
    color: #88aaff;
}

.settings-section {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    background-color: #f9f9f9;
    transition: background-color 0.5s ease, border-color 0.5s ease;
}

body.dark-mode .settings-section {
    background-color: #555555;
    border-color: #666;
}

.settings-section h3 {
    color: #555;
    margin-top: 0;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    transition: color 0.5s ease, border-color 0.5s ease;
}

body.dark-mode .settings-section h3 {
    color: #bbb;
    border-color: #777;
}

/* Specific layout for volume controls within settings */
#volume-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

/* Specific layout for secret code input within settings */
#secret-code-setting #secret-code-input-container {
    margin-top: 0; /* Reset default margin */
}

/* Specific layout for reset game button within settings */
#reset-game-setting #reset-game-button {
    margin-top: 0; /* Reset default margin */
}

/* Language Selection */
.language-selection {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.language-button {
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.1s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 60px; /* Fixed width for flag container */
    height: 40px; /* Fixed height for flag container */
    overflow: hidden; /* Hide overflow if image is slightly larger */
}

.language-button:hover {
    background-color: #e0e0e0;
    border-color: #bbb;
    transform: translateY(-2px);
}

.language-button img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Cover the button area */
    border-radius: 4px; /* Slightly rounded corners for the flag image */
}

body.dark-mode .language-button {
    background-color: #4c4c4c;
    border-color: #666;
}

body.dark-mode .language-button:hover {
    background-color: #555;
    border-color: #777;
}

/* Animations */
@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
        opacity: 1;
    }
    100% {
        transform: scale(1);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}