/* wordstyles.css */
@import url('https://fonts.googleapis.com/css2?family=Dongle:wght@300&family=Gamja+Flower&family=Gowun+Dodum&display=swap');
/* 기본 스타일 */
body {
    font-family: "Gowun Dodum", sans-serif;
    background-color: #f5f5f5;
    margin: 0;
    padding: 0;
    text-align: center;
}

/* 초기 선택 화면 */
#selection-screen {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
}
/* 기존 .game-header 스타일 수정 */
.game-header {
    display: flex; /* Flexbox 활성화 */
    justify-content: center; /* 가운데 정렬 */
    align-items: center; /* 수직 가운데 정렬 */
    gap: 10px; /* 제목과 버튼 사이 간격 */
    margin-bottom: 20px; /* 아래쪽 여백 추가 */
}

.selection-button {
    padding: 15px 30px;
    margin: 10px;
    font-size: 18px;
    cursor: pointer;
    border: none;
    border-radius: 5px;
    background-color: #2196F3;
    color: white;
    transition: background-color 0.3s;
}

.selection-button:hover {
    background-color: #0b7dda;
}

/* 낱말 카드 섹션 */
#flashcards {
    padding: 20px;
}

.flashcard-settings {
    margin-bottom: 20px;
}

.flashcard-settings label {
    margin-right: 10px;
    font-size: 16px;
}

#flashcard-difficulty {
    padding: 8px;
    font-size: 16px;
    border-radius: 5px;
    border: 1px solid #ccc;
}

/* 진행 바 스타일 */
#progress-bar-container {
    width: 80%;
    background-color: #e0e0e0;
    border-radius: 5px;
    margin: 20px auto;
    height: 20px;
}

#progress-bar {
    width: 0%;
    height: 100%;
    background-color: #4CAF50;
    border-radius: 5px;
    transition: width 0.5s;
}

#progress-text {
    margin-top: 5px;
    font-size: 16px;
    color: #333;
}

/* 카드 스타일 */
.card {
    width: 300px;
    height: 200px;
    margin: 20px auto;
    perspective: 1000px;
    position: relative;
}

.card-face {
    width: 100%;
    height: 100%;
    position: absolute;
    backface-visibility: hidden;
    border: 2px solid #ccc;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    background-color: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    padding: 10px;
    box-sizing: border-box;
}

.card-face.front {
    /* 앞면 스타일 */
}

.card-face.back {
    transform: rotateY(180deg);
}

.card.flipped .front {
    transform: rotateY(180deg);
}

.card.flipped .back {
    transform: rotateY(360deg);
}

/* 음성 재생 버튼 */
#speakBtn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #555;
    transition: color 0.3s;
}

#speakBtn:hover {
    color: #000;
}

/* 컨트롤 버튼 */
.controls {
    margin-top: 20px;
}

.controls button {
    padding: 10px 20px;
    margin: 0 10px;
    font-size: 16px;
    cursor: pointer;
    border: none;
    border-radius: 5px;
    background-color: #4CAF50;
    color: white;
    transition: background-color 0.3s;
}

.controls button:hover {
    background-color: #45a049;
}

/* 단어 게임 섹션 */
#word-game {
    padding: 20px;
}

.game-settings, .game-mode-selection {
    margin-bottom: 20px;
}

.game-settings button, .game-mode-selection button {
    padding: 10px 20px;
    margin: 5px;
    font-size: 16px;
    cursor: pointer;
    border: none;
    border-radius: 5px;
    background-color: #FF9800;
    color: white;
    transition: background-color 0.3s;
}

.game-settings button:hover, .game-mode-selection button:hover {
    background-color: #e68900;
}
/* 난이도 및 게임 모드 버튼 기본 스타일 */
.difficulty-button, .mode-button {
    padding: 10px 20px;
    margin: 5px;
    font-size: 16px;
    cursor: pointer;
    border: 2px solid transparent; /* 기본 테두리 */
    border-radius: 5px;
    background-color: #FF9800; /* 기본 배경색 */
    color: white;
    transition: all 0.3s ease;
}

.difficulty-button:hover, .mode-button:hover {
    background-color: #e68900; /* 호버 시 배경색 변경 */
}
/* 선택된 버튼 스타일 */
.difficulty-button.selected, .mode-button.selected {
    border: 2px solid #000; /* 두꺼운 검정색 테두리 */
    background-color: #FFC107; /* 강조된 배경색 */
    color: #000; /* 텍스트 색상 변경 */
}

/* 선택된 버튼 호버 효과 */
.difficulty-button.selected:hover, .mode-button.selected:hover {
    background-color: #FFB300; /* 호버 시 배경색 변경 */
}

.hidden {
    display: none;
}

/* 게임 영역 */
.game-area {
    margin-top: 20px;
}

#scoreDisplay {
    font-size: 20px;
    margin-bottom: 10px;
}

#timer {
    font-size: 18px;
    margin-bottom: 20px;
}

#question.quiz-card {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: white; /* 흰색 배경 추가 */
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    margin: 0 auto 20px auto;
    width: 80%;
    min-height: 60px;
    font-size: 22px;
    box-sizing: border-box;
}

/* 옵션 버튼 스타일 */
#options {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#options button {
    padding: 10px 20px;
    margin: 5px 0;
    width: 60%;
    font-size: 16px;
    cursor: pointer;
    border: none;
    border-radius: 5px;
    background-color: #2196F3;
    color: white;
    transition: background-color 0.3s;
}

#options button:hover {
    background-color: #0b7dda;
}

/* 정답 및 오답 스타일 */
.correct-answer {
    background-color: #4CAF50 !important; /* 녹색 */
    color: white;
    border: 2px solid #388E3C;
    animation: highlight 0.5s forwards;
}

.incorrect-answer {
    background-color: #F44336 !important; /* 빨간색 */
    color: white;
    border: 2px solid #D32F2F;
    animation: highlight 0.5s forwards;
}

/* 버튼 비활성화 스타일 */
.options button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* 애니메이션 정의 */
@keyframes highlight {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* 모달 스타일 */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto; /* 15% from the top and centered */
    padding: 20px;
    border: 1px solid #888;
    width: 80%; /* Could be more or less, depending on screen size */
    max-width: 400px;
    border-radius: 10px;
    position: relative;
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 15px;
    cursor: pointer;
}

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

#playerName {
    width: 80%;
    padding: 10px;
    margin: 15px 0;
    font-size: 16px;
    border-radius: 5px;
    border: 1px solid #ccc;
}

#submitScoreBtn {
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    border: none;
    border-radius: 5px;
    background-color: #4CAF50;
    color: white;
    transition: background-color 0.3s;
}

#submitScoreBtn:hover {
    background-color: #45a049;
}

/* 기록 보기 테이블 스타일 */
#recordsTable {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

#recordsTable th, #recordsTable td {
    border: 1px solid #ddd;
    padding: 8px;
}

#recordsTable th {
    background-color: #f2f2f2;
    font-weight: bold;
}
/* "기록 보기" 버튼 스타일 */
#viewRecordsBtn {
    padding: 5px 10px; /* 버튼 내부 여백 줄이기 */
    font-size: 14px; /* 버튼 텍스트 크기 조정 */
    border-radius: 5px; /* 모서리 둥글게 */
    background-color: #f0f0f0; /* 연한 회색 배경 */
    color: #333; /* 텍스트 색상 */
    border: 1px solid #ccc; /* 얇은 테두리 */
    cursor: pointer; /* 커서 포인터 표시 */
    transition: background-color 0.3s, color 0.3s; /* 호버 효과 애니메이션 */
}

#viewRecordsBtn:hover {
    background-color: #e0e0e0; /* 호버 시 배경색 변경 */
    color: #000; /* 호버 시 텍스트 색상 변경 */
}
.easy-difficulty {
    color: #4CAF50;
    font-weight: bold;
}

.medium-difficulty {
    color: #FF9800;
    font-weight: bold;
}

.hard-difficulty {
    color: #F44336;
    font-weight: bold;
}

/* 기록 필터링 및 정렬 섹션 스타일 */
.records-filters {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.records-filters label {
    margin: 5px 10px;
    font-size: 14px;
}

.records-filters select {
    padding: 5px;
    margin: 5px 10px;
    font-size: 14px;
    border-radius: 5px;
    border: 1px solid #ccc;
}

.records-filters button {
    padding: 5px 15px;
    margin: 5px 10px;
    font-size: 14px;
    cursor: pointer;
    border: none;
    border-radius: 5px;
    background-color: #2196F3;
    color: white;
    transition: background-color 0.3s;
}

.records-filters button:hover {
    background-color: #0b7dda;
}

/* 반응형 디자인 */
@media screen and (max-width: 600px) {
    #viewRecordsBtn {
        padding: 5px 10px; /* 버튼 내부 여백 줄이기 */
        font-size: 16px; /* 버튼 글씨 크기 조정 */
        width: auto; /* 너비를 콘텐츠 크기에 맞춤 */
        height: auto; /* 높이 자동 설정 */
        margin-left: 10px; /* 제목과 버튼 사이 간격 추가 */
    }
    .difficulty-button, .mode-button {
        padding: 8px 16px; /* 버튼 내부 여백 줄이기 */
        font-size: 14px; /* 폰트 크기 조정 */
        margin: 3px; /* 버튼 간격 조정 */
    }

    .difficulty-button.selected, .mode-button.selected {
        border: 2px solid #000; /* 동일한 테두리 유지 */
        background-color: #FFC107; /* 동일한 강조된 배경색 유지 */
        color: #000; /* 동일한 텍스트 색상 유지 */
    }
    .game-header {
        flex-wrap: nowrap; /* 줄바꿈 방지 */
        justify-content: center; /* 가운데 정렬 유지 */
        gap: 5px; /* 제목과 버튼 사이 간격 더 줄이기 */
    }
    .controls {
        display: flex;
        justify-content: space-between; /* 버튼을 좌우로 정렬 */
        align-items: center; /* 수직 가운데 정렬 */
        margin-top: 20px; /* 카드와 버튼 사이 간격 추가 */
    }

    .controls button {
        padding: 10px 15px; /* 버튼의 크기 조정 */
        font-size: 14px; /* 버튼 텍스트 크기 조정 */
        flex-grow: 1; /* 버튼이 균등하게 공간을 차지 */
        max-width: 45%; /* 각 버튼의 최대 너비 제한 */
        margin: 0 5px; /* 버튼 간의 간격 추가 */
    }    
    .card {
        width: 90%;
        aspect-ratio: 3 / 2; /* 너비와 높이의 비율을 3:2로 설정 */
        margin-bottom: 20px; /* 카드 하단에 여백 추가 */
    }

    #options button {
        width: 80%;
    }

    .modal-content {
        width: 90%;
    }

    #question.quiz-card {
        width: 90%;
    }

    /* 낱말 카드 글자 크기 조정 */
    #word-text, #meaning-text {
        font-size: 40px;
    }

    /* 게임 시작 버튼 스타일 개선 */
    #startGameBtn {
        padding: 12px 24px;
        font-size: 18px;
        background-color: #4CAF50;
        color: white;
        border: none;
        border-radius: 5px;
        cursor: pointer;
        transition: background-color 0.3s;
        margin-bottom: 20px;
    }

    #startGameBtn:hover {
        background-color: #45a049;
    }

    /* 퀴즈 단어 카드 높이 조정 */
    #question.quiz-card {
        min-height: 80px;
    }
}
