@font-face {
    font-family: 'MatrixCodeNFI';
    src: url('../fonts/MatrixCodeNfi-YPPj.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

body {
    font-family: Arial, sans-serif;
    background: url('../images/background.jpg') no-repeat center center fixed;
    background-size: cover;
    color: #111; /* Darker color for better readability */
    transition: background-color 0.3s, color 0.3s, background-image 0.3s;
}

body.dark-mode {
    background-color: #111; /* Darker background color */
    color: #fff; /* White text color for better readability */
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    text-align: center;
}

body.dark-mode .container {
    padding: 20px; /* Ensure padding consistency */
}

header {
    margin-bottom: 20px;
}

body.dark-mode header {
    margin-bottom: 20px;
}

.title {
    font-family: 'MatrixCodeNFI', Arial, sans-serif;
    font-size: 3.5em;
}

.title-container {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 10px 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    display: inline-block;
    margin-bottom: 10px; /* Add margin to separate from the button */
    position: relative; /* Add position relative for centering */
}

body.dark-mode .title-container {
    background: rgba(18, 18, 18, 0.7);
    color: #fff;
}

.theme-switch-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: absolute; /* Change to absolute positioning */
    top: 10px; /* Adjust the position to the top of the title container */
    right: 10px; /* Align to the right */
}

.theme-switch {
    position: relative;
    display: inline-block;
    width: 34px;
    height: 20px;
}

.theme-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;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 12px;
    width: 12px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #4a6a35; /* Match the green theme */
}

input:checked + .slider:before {
    transform: translateX(14px);
}

.mode-switch-container {
    margin-top: 10px; /* Add margin to separate from the title */
}

.glass-window {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

body.dark-mode .glass-window {
    background: rgba(18, 18, 18, 0.7);
    color: #fff;
}

.input-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.letters-container {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.letter-input {
    width: 50px; /* Adjusted width for desktop */
    height: 50px; /* Adjusted height for desktop */
    text-align: center;
    font-size: 32px; /* Adjusted font size for desktop */
    font-weight: bold; /* Increased font weight */
    border-radius: 5px;
    border: 1px solid #ccc;
    transition: background-color 0.3s, color 0.3s;
    background-color: #fff; /* Ensure consistent background color for light mode */
    color: #111; /* Consistent text color for light mode */
    caret-color: transparent; /* Hide the cursor on all screens */
    cursor: pointer; /* Show pointer cursor */
}

body.dark-mode .letter-input {
    background-color: #444;
    color: #fff; /* White text color for dark mode */
    border: 1px solid #666;
}

.button-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px; /* Adjust the gap to control space between buttons */
    margin-top: 20px; /* Optional: Adjust as needed for spacing from other elements */
    flex-wrap: nowrap; /* Ensure no wrapping occurs */
}

button.submit-button, button.eraser-button {
    width: 50px; /* Adjust as needed for consistency */
    height: 50px; /* Adjust as needed for consistency */
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #333;
    border: 1px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s, font-weight 0.3s; /* Transition for scaling and font-weight */
    margin: 0; /* Ensure there's no margin that might cause stacking */
}

button.submit-button i, button.eraser-button i {
    font-size: 24px; /* Adjust as needed */
    color: #fff;
}

body.dark-mode button.submit-button, body.dark-mode button.eraser-button {
    background-color: #666;
}

body.dark-mode button.submit-button:hover, body.dark-mode button.eraser-button:hover {
    background-color: #777;
}


.letter-input.green {
    background-color: #6aa84f;
}

body.dark-mode .letter-input.green {
    background-color: #4a6a35; /* Darker green for better readability */
}

.letter-input.yellow {
    background-color: #ffd966;
}

body.dark-mode .letter-input.yellow {
    background-color: #b68d00; /* Darker yellow for better readability */
}

.results-container {
    margin-top: 20px; /* Add space below the buttons */
    max-height: 400px; /* Adjust height as needed */
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    color: #111; /* Adjust text color for readability */
}

body.dark-mode .results-container {
    background: rgba(18, 18, 18, 0.7);
    color: #fff; /* Adjust text color for readability in dark mode */
}

.results-content {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.result-item {
    flex: 1 1 calc(25% - 10px); /* Adjust the width percentage as needed */
    padding: 5px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 5px;
    text-align: center;
}

body.dark-mode .result-item {
    background: rgba(50, 50, 50, 0.8);
}

@media (max-width: 480px) {
    .input-row {
        flex-wrap: wrap;
    }

    .letters-container {
        flex: 1 0 100%;
        justify-content: center;
        gap: 5px;
    }

    .button-container {
        flex: 1 0 100%;
        justify-content: center;
        margin-top: 10px;
    }

    .letter-input {
        width: calc(20% - 5px);
        height: 40px;
        font-size: 18px;
    }

    .submit-button, .eraser-button {
        width: 40px;
        height: 40px;
    }

    .submit-button i, .eraser-button i {
        font-size: 1.2em;
    }

    .submit-button.active i {
        transform: scale(1.1);
    }
}
