/* Styles for the interactive AI knowledge quiz */

/* Tło quizu z gradientem */
.section-quiz {
    background: linear-gradient(135deg, #ffd1dc 0%, #ffecd6 100%);
    padding: 40px 20px;
    border-radius: 8px;
    
}

/* Kontener quizu jako grid */
#quizContainer {
    display: grid;
    grid-template-columns: 230px 510px;
    width: 90%;
    max-width: 800px;
    margin: 20px auto;
    gap: 20px;
}

/* Ukryj oryginalne kontenery terms i answers */
#terms,
#answers {
    display: none;
}

/* Kontenery dla terminów i odpowiedzi */
#terms,
.terms-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 230px;
    width: 230px;
}

#answers,
.answers-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 510px;
    width: 510px;
}

/* Styl dla terminu (lewa kolumna) */
.term {
    cursor: grab;
    user-select: none;
    font-family: "Roboto", Helvetica;
    font-weight: 700;
    color: #000000;
    font-size: 18px;
    text-align: center;
    display: flex;
    width: 230px;
    height: 80px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px 10px;
    position: relative;
    border: 4px solid;
    border-color: transparent;
    border-image: linear-gradient(
            to bottom,
            rgb(255, 255, 255),
            rgba(255, 255, 255, 0) 51%,
            rgb(255, 255, 255) 100%
        )
        1;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.3) 0%,
        rgba(249.77, 249.77, 249.77, 0.3) 100%
    );
    touch-action: none; /* Needed for mobile drag */
    box-sizing: border-box; /* Include padding in height */
}

.term:active {
    cursor: grabbing;
}

/* Styl dla definicji (prawa kolumna) */
.answer {
    flex: 1;
    font-family: "Roboto", Helvetica;
    font-weight: 500;
    color: #000000;
    font-size: 18px;
    text-align: center;
    letter-spacing: 0;
    display: flex;
    width: 510px;
    height: 80px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px 10px;
    position: relative;
    border: 2px solid;
    border-color: transparent;
    box-shadow: inset 0px 0px 10px #ffffff, 0px 0px 10px #ffbc004f;
    border-image: linear-gradient(
            to bottom,
            rgb(255, 255, 255),
            rgba(255, 255, 255, 0) 51%,
            rgb(255, 255, 255) 100%
        )
        1;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(249.77, 249.77, 249.77, 0.05) 100%
    );
    box-sizing: border-box; /* Include padding in height */
}

/* Styl dla komórki tabeli quizu (wspólny dla term i answer) */
.quiz-cell {
    background-color: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(5px);
    border-radius: 4px;
    padding: 15px;
    text-align: center;
    height: 80px; /* Fixed height for all cells */
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Roboto", sans-serif;
    margin: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    box-sizing: border-box; /* Ensure padding is included in height */
}

/* Styl dla terminu (lewa komórka) */
.quiz-term {
    font-weight: 700;
    color: #333;
    cursor: grab;
    border-right: none;
    border: 4px solid transparent;
    border-image: linear-gradient(
            to bottom,
            rgb(255, 255, 255),
            rgba(255, 255, 255, 0) 51%,
            rgb(255, 255, 255) 100%
        )
        1;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.3) 0%,
        rgba(249.77, 249.77, 249.77, 0.3) 100%
    );
}

.quiz-term:active {
    cursor: grabbing;
}

/* Styl dla definicji (prawa komórka) */
.quiz-definition {
    font-weight: 400;
    color: #444;
    border-left: none;
    border: 2px solid transparent;
    box-shadow: inset 0px 0px 10px #ffffff, 0px 0px 10px #ffbc004f;
    border-image: linear-gradient(
            to bottom,
            rgb(255, 255, 255),
            rgba(255, 255, 255, 0) 51%,
            rgb(255, 255, 255) 100%
        )
        1;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(249.77, 249.77, 249.77, 0.05) 100%
    );
}

/* Nagłówek quizu */
.quiz-header {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
}

.quiz-header h2 {
    font-size: 32px;
    margin-bottom: 10px;
}

.quiz-header p {
    font-size: 18px;
    opacity: 0.8;
}

/* Feedback message section */
#feedbackMessage,
.feedback-message {
    margin-top: 30px;
    width: 100%;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    padding: 10px 20px;
    font-family: "Roboto", Helvetica;
    line-height: 1.6;
}

/* Styles dla dopasowanych par */
.matched-pair {
    margin-bottom: 10px;
    padding: 8px 15px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.quiz-complete {
    margin-top: 20px;
    padding: 15px;
    background-color: rgba(247, 204, 103, 0.3);
    border-radius: 8px;
    text-align: center;
    font-size: 18px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(247, 204, 103, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(247, 204, 103, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(247, 204, 103, 0);
    }
}

.correct-match {
    position: relative;
}

.correct-match::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(124, 252, 0, 0.2);
    pointer-events: none;
    animation: fadeOut 0.8s ease forwards;
}

.incorrect-match {
    position: relative;
}

.incorrect-match::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 0, 0, 0.2);
    pointer-events: none;
    animation: fadeOut 0.8s ease forwards;
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Responsive styles */
@media (max-width: 992px) {
    #quizContainer {
        grid-template-columns: 1fr;
    }

    #terms,
    .terms-container,
    #answers,
    .answers-container {
        width: 100%;
    }

    .term,
    .answer {
        width: 100%;
    }
}

@media (max-width: 768px) {
    #quizContainer {
        grid-template-columns: 1fr;
    }

    .quiz-cell {
        height: auto;
        min-height: 80px; /* Ensure minimum height on mobile */
        padding: 10px;
    }
}

@media (max-width: 576px) {
    .term,
    .answer {
        font-size: 16px;
        height: auto;
        min-height: 70px;
    }

    #feedbackMessage,
    .feedback-message {
        font-size: 14px;
    }
}