html {
    box-sizing: border-box;
}

*, *:before, *:after {
    box-sizing: inherit;
}

body {
    font-family: Arial, sans-serif;
    background-color: #fff;
    color: #333;
    margin: 0;
    padding: 0;
    overflow-x: hidden; /* Prevent horizontal scrolling */
}

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

.header {
    background-color: #f8f8f8;
    border-bottom: 1px solid #e7e7e7;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header .logo {
    font-size: 24px;
    font-weight: bold;
    color: #0056b3;
    text-decoration: none;
}

.header .menu-toggle {
    display: none; /* Hidden by default on larger screens */
    font-size: 24px;
    cursor: pointer;
}

.navigation-menu ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
}

.navigation-menu li {
    margin-left: 20px;
}

.navigation-menu a {
    color: #0056b3;
    text-decoration: none;
    font-weight: bold;
}

@media (max-width: 768px) {
    .header .menu-toggle {
        display: block; /* Show toggle on smaller screens */
    }

    .navigation-menu {
        display: none; /* Hide menu by default on smaller screens */
        width: 100%;
        position: absolute;
        top: 60px; /* Position below the header */
        left: 0;
        background-color: #f8f8f8;
        border-top: 1px solid #e7e7e7;
    }

    .navigation-menu.active {
        display: block; /* Show when active */
    }

    .navigation-menu ul {
        flex-direction: column;
    }

    .navigation-menu li {
        margin: 0;
        text-align: center;
        border-bottom: 1px solid #e7e7e7;
    }

    .navigation-menu a {
        display: block;
        padding: 15px;
    }
}

h1 {
    font-size: 28px;
    color: #0056b3;
    margin-top: 0;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

#wordInput {
    width: 100%;
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.buttons {
    margin-bottom: 20px;
}

.btn {
    padding: 10px 20px;
    font-size: 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.btn-primary {
    background-color: #007bff;
    color: #fff;
}



.info-text, .note {
    background-color: #fefbcc;
    border: 1px solid #fceb77;
    padding: 15px;
    margin: 20px 0;
    border-radius: 4px;
    text-align: justify;
}

h2 {
    font-size: 22px;
    color: #0056b3;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
    margin-top: 30px;
}

p {
    line-height: 1.6;
    text-align: justify;
}

.word-list {
    margin-top: 25px;
}

.word-group {
    margin-bottom: 20px;
}

.word-group h3 {
    font-size: 1.1em;
    font-weight: 600;
    color: #333;
    border-bottom: 1px solid #ddd;
    padding-bottom: 8px;
    margin-bottom: 12px;
}

.words-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.word-item {
    display: inline-block;
    background-color: #e9ecef;
    color: #0056b3;
    padding: 6px 12px;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.word-item:hover {
    background-color: #0056b3;
    color: #fff;
}

.footer {
    background-color: #f8f8f8;
    border-top: 1px solid #e7e7e7;
    padding: 20px;
    text-align: center;
    margin-top: 30px;
}

.footer-links {
    margin-bottom: 10px;
}

.footer-links a {
    margin: 0 10px;
    color: #0056b3;
    text-decoration: none;
}

.copyright a {
    color: #0056b3;
    text-decoration: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    h1 {
        font-size: 24px;
    }

    h2 {
        font-size: 20px;
    }

    .unscramble-form {
        display: flex;
        flex-direction: column;
    }

    #wordInput {
        margin-bottom: 10px;
    }

    .buttons {
        display: flex;
    }

    .btn-primary {
        width: 100%;
        padding: 12px;
    }

    .word-group h3 {
        font-size: 1em;
    }

    .words-container {
        gap: 6px;
    }

    .word-item {
        padding: 5px 10px;
        font-size: 0.9em;
    }

    .footer-links a {
        margin: 0 5px;
        display: inline-block;
        margin-bottom: 10px;
    }

    .modal-content {
        width: 90%;
        margin: 20% auto;
        padding: 15px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 22px;
    }

    .header .logo {
        font-size: 20px;
    }

    .word-item {
        flex-grow: 1;
        text-align: center;
    }
}

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

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 600px;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

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

#modalDefinition h3 {
    font-size: 18px;
    color: #333;
}

#modalDefinition ul {
    list-style-type: disc;
    padding-left: 20px;
}

#modalDefinition li {
    margin-bottom: 10px;
}
