* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: #f0f4f8;
    color: #333;
    line-height: 1.6;
}

header {
    background-color: #2196F3;
    color: white;
    padding: 1em 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1em;
}

header h1 {
    font-size: 1.8em;
    font-weight: 700;
}

.logout {
    background-color: #1E88E5; 
    padding: 0.6em 1.2em;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    color: white;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.logout:hover {
    background-color: #1565C0; 
    transform: translateY(-2px);
}

.logout:active {
    transform: translateY(0);
    box-shadow: none;
}


main {
    max-width: 1200px;
    margin: 2em auto;
    padding: 0 1em;
}

section {
    background-color: white;
    padding: 2em;
    margin-bottom: 2em;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

section:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 12px rgba(0,0,0,0.2);
}

section h2 {
    margin-bottom: 1em;
    color: #2196F3; 
    font-size: 1.5em;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 0.5em;
}

.vocabulary-container {
    width: 100%;
}

#word-list {
    list-style: none;
    width: 100%;
    max-width: 800px;
    margin-bottom: 1em;
}

#word-list li {
    background-color: #E3F2FD;
    padding: 0.8em;
    margin: 0.5em 0;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease;
}

#word-list li:hover {
    background-color: #BBDEFB;
}

.delete-word {
    background-color: #f44336; 
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    color: white;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.delete-word:hover {
    background-color: #d32f2f;
    transform: scale(1.1);
}

.delete-word:active {
    transform: scale(1);
}


.add-word-form {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 800px;
}

.add-word-form input {
    padding: 0.8em;
    margin: 0.5em 0;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.add-word-form input:focus {
    border-color: #2196F3;
    outline: none;
}

#add-word {
    background-color: #2196F3; 
    color: white;
    border: none;
    padding: 0.8em;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    margin-top: 0.5em;
}

#add-word:hover {
    background-color: #1976D2; 
    transform: translateY(-2px);
}

#add-word:active {
    transform: translateY(0);
    box-shadow: none;
}


.error {
    color: #f44336; 
    text-align: center;
    margin-top: 0.5em;
    font-weight: bold;
}


.flashcard-container {
    margin: 1em 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.flashcard {
    width: 100%;
    max-width: 400px;
    height: 250px;
    perspective: 1000px;
}

.flashcard-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flashcard.flipped .flashcard-inner {
    transform: rotateY(180deg);
}

.flashcard .front,
.flashcard .back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5em;
    padding: 1em;
}

.flashcard .front {
    background-color: #1565C0; 
    color: white;
}

.flashcard .back {
    background-color: #64B5F6; 
    color: white;
    transform: rotateY(180deg);
}


.flashcard-button {
    background-color: #2196F3; 
    color: white;
    border: none;
    padding: 0.8em 1.5em;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.flashcard-button:hover {
    background-color: #1976D2; 
    transform: translateY(-2px);
}

.flashcard-button:active {
    transform: translateY(0);
    box-shadow: none;
}


.mcq-container {
    width: 100%;
    max-width: 800px;
}

.mcq-container .quiz-question {
    background-color: #E3F2FD;
    padding: 1em;
    margin: 0.5em 0;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.mcq-container .quiz-question:hover {
    background-color: #BBDEFB;
}

.mcq-container select {
    width: 100%;
    padding: 0.6em;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.mcq-container select:focus {
    border-color: #2196F3;
    outline: none;
}


.fill-blanks-container {
    width: 100%;
    max-width: 800px;
}

.fill-blanks-container .quiz-question {
    background-color: #E3F2FD;
    padding: 1em;
    margin: 0.5em 0;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.fill-blanks-container .quiz-question:hover {
    background-color: #BBDEFB;
}

.fill-blanks-container input {
    width: 100%;
    padding: 0.6em;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.fill-blanks-container input:focus {
    border-color: #2196F3;
    outline: none;
}


.matching-container {
    width: 100%;
    max-width: 800px;
}

.matching-container .quiz-question {
    background-color: #E3F2FD;
    padding: 1em;
    margin: 0.5em 0;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.matching-container .quiz-question:hover {
    background-color: #BBDEFB;
}

.matching-container .matching-pairs {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

.matching-container .matching-column {
    width: 45%;
}

.matching-container ol {
    list-style: none;
}

.matching-container li {
    margin: 0.5em 0;
}

.matching-container select {
    width: 100%;
    padding: 0.6em;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.matching-container select:focus {
    border-color: #2196F3;
    outline: none;
}


.quiz-button {
    background-color: #2196F3; /* Ko‘k rang */
    color: white;
    border: none;
    padding: 0.8em 1.5em;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    margin-top: 1em;
}

.quiz-button:hover {
    background-color: #1976D2; 
    transform: translateY(-2px);
}

.quiz-button:active {
    transform: translateY(0);
    box-shadow: none;
}


.results-container {
    width: 100%;
    max-width: 800px;
    overflow-x: auto;
}

.results-container table {
    width: 100%;
    border-collapse: collapse;
}

.results-container th,
.results-container td {
    border: 1px solid #ccc;
    padding: 0.8em;
    text-align: center;
}

.results-container th {
    background-color: #2196F3; 
    color: white;
    font-weight: bold;
}

.results-container tr:nth-child(even) {
    background-color: #E3F2FD;
}

.results-container tr:hover {
    background-color: #BBDEFB;
}


.progress-container {
    width: 100%;
    max-width: 800px;
}

.progress-container p {
    background-color: #E1F5FE;
    padding: 0.8em;
    margin: 0.5em 0;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.progress-container p:hover {
    background-color: #B3E5FC;
}


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

    .flashcard {
        max-width: 90%;
    }

    .add-word-form,
    #word-list,
    .mcq-container,
    .fill-blanks-container,
    .matching-container,
    .results-container {
        max-width: 100%;
    }

    .matching-container .matching-pairs {
        flex-direction: column;
        align-items: center;
    }

    .matching-container .matching-column {
        width: 100%;
    }
}

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

    section h2 {
        font-size: 1.2em;
    }

    .flashcard .front,
    .flashcard .back {
        font-size: 1.2em;
    }

    .quiz-button,
    .flashcard-button {
        padding: 0.5em 1em;
        font-size: 0.9em;
    }

    .results-container table th,
    .results-container table td {
        padding: 0.5em;
    }
}
