/* 컴포넌트 스타일 - 버튼, 카드, 폼 요소 등 재사용 가능한 UI 요소 */

/* 버튼 스타일 */
button {
    cursor: pointer;
    border: none;
    font-family: 'Noto Sans KR', sans-serif;
}

/* 카테고리 토글 버튼 */
.category-toggle {
    background: transparent;
    font-size: 1rem;
    color: #555;
    padding: 5px 10px;
    transition: all 0.3s ease;
}

.category-toggle:hover {
    color: #333;
    transform: translateY(-2px);
}

/* 학년 버튼 */
.grade-button {
    padding: 8px 15px;
    border-radius: 20px;
    background-color: #f1f1f1;
    color: #555;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.grade-button:hover {
    background-color: #e5e5e5;
}

.grade-button.active {
    background-color: #21d4fd;
    color: white;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(33, 212, 253, 0.3);
}

/* 즐겨찾기 체크박스 */
.toggle-checkbox {
    display: none;
}

.toggle-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    color: #555;
    font-size: 0.9rem;
}

.toggle-icon {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    background-color: #e5e5e5;
    border-radius: 12px;
    margin-right: 10px;
    transition: all 0.3s ease;
}

.toggle-icon:before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    background-color: white;
    transition: all 0.3s ease;
}

.toggle-checkbox:checked + .toggle-label .toggle-icon {
    background-color: #b721ff;
}

.toggle-checkbox:checked + .toggle-label .toggle-icon:before {
    transform: translateX(20px);
}

/* 정렬 드롭다운 */
.sort-select {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #ddd;
    background-color: white;
    color: #333;
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 0.9rem;
    outline: none;
}

.sort-select:focus {
    border-color: #b721ff;
}

/* 카드 디자인 */
.card-front, .card-back {
    background-color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding: 25px;
}

/* 단어 헤더 */
.word-header {
    margin-bottom: 20px;
}

.english-word {
    font-size: 2.5rem;
    font-weight: 700;
    color: #333;
    margin: 15px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

/* 발음 버튼 - iOS 터치 문제 해결 */
.pronunciation-btn {
    background: transparent;
    color: #0066cc !important;
    border: none;
    font-size: 1.2rem;
    padding: 5px;
    cursor: pointer;
    /* iOS 터치 최적화 */
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    transform: none !important;
    transition: none !important;
}

/* 호버 효과 완전 제거 - iOS 문제 방지 */
.pronunciation-btn:hover,
.pronunciation-btn:focus,
.pronunciation-btn:active {
    color: #0066cc !important;
    transform: none !important;
    background: transparent !important;
}

/* 즐겨찾기 버튼 */
.favorite-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 1.4rem;
    color: #ccc;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.favorite-btn.active {
    color: #ffcc00;
}

.favorite-btn:hover {
    transform: scale(1.1);
}

/* 스펠링 테이블 */
.spelling-table {
    width: 100%;
    max-width: 400px;
    table-layout: fixed;
    margin: 15px 0;
    border-collapse: separate;
    border-spacing: 5px;
}

.spelling-table .letter td {
    padding: 8px 5px;
    text-align: center;
    background-color: #f5f5f5;
    border-radius: 6px;
    font-weight: 700;
    font-size: 1.2rem;
    color: #333;
}

.spelling-table .pronunciation td {
    padding: 5px;
    text-align: center;
    font-size: 0.9rem;
    color: #666;
}

/* 발음 정보 */
.pronunciation-info {
    margin: 15px 0;
}

.word-pronunciation {
    color: #666;
    font-size: 1.1rem;
    margin: 8px 0;
    font-style: italic;
}

.pronunciation-guide {
    color: #b721ff;
    font-size: 1.2rem;
    font-weight: 500;
    margin: 8px 0;
}

/* 뜻 보기 버튼 */
.flip-btn {
    margin-top: 20px;
    padding: 10px 25px;
    border-radius: 25px;
    background-image: linear-gradient(135deg, #12c2e9, #c471ed, #f64f59);
    color: white;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.flip-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* 단어 의미 및 상세 정보 */
.word-meaning {
    font-size: 2.2rem;
    color: #d43f8d;
    margin-bottom: 25px;
    font-weight: 700;
}

.word-details {
    width: 100%;
    text-align: left;
    margin-bottom: 20px;
}

.synonyms-antonyms, .word-examples, .related-expressions, .etymology {
    margin-bottom: 15px;
}

.word-example {
    padding: 8px 0;
    border-bottom: 1px solid #f1f1f1;
    color: #555;
    font-size: 1rem;
}

.example-pronunciation-btn {
    color: #0066cc !important;
    cursor: pointer;
    margin-right: 8px;
    /* iOS 터치 최적화 */
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    transform: none !important;
    transition: none !important;
}

/* 예문 스피커 호버 효과도 제거 */
.example-pronunciation-btn:hover,
.example-pronunciation-btn:focus,
.example-pronunciation-btn:active {
    color: #0066cc !important;
    transform: none !important;
}

/* 탐색 버튼 */
.nav-btn {
    padding: 10px 20px;
    border-radius: 30px;
    background-color: #f8f8f8;
    color: #444;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.nav-btn:not(:disabled):hover {
    background-color: #eaeaea;
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 학습 옵션 버튼 */
.option-btn {
    padding: 8px 12px;
    border-radius: 5px;
    background-color: #f1f1f1;
    color: #444;
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.option-btn i {
    font-size: 1.2rem;
    margin-bottom: 3px;
}

.option-btn:hover {
    background-color: #e5e5e5;
}

/* 완료 화면 버튼 */
.completion-btn {
    padding: 12px 25px;
    border-radius: 25px;
    background-color: #f1f1f1;
    color: #444;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.completion-btn:hover {
    background-color: #e5e5e5;
}

.completion-btn.primary {
    background-image: linear-gradient(135deg, #12c2e9, #c471ed, #f64f59);
    color: white;
}

.completion-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

/* 로딩 스피너 */
.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(33, 212, 253, 0.3);
    border-top: 4px solid #21d4fd;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 단어 카드 스타일 */
.word-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-image: var(--primary-gradient, linear-gradient(to right, rgba(255, 78, 255, 1), rgba(153, 179, 255, 1)));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 26px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.4);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

/* Font Awesome 아이콘을 위한 스타일 */
.word-icon i.fas {
    font-size: 28px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
    position: relative;
    z-index: 2;
}

/* 이모지 아이콘을 위한 스타일 */
.word-icon:has(i:empty) {
    font-size: 30px; /* 이모지는 좀 더 크게 표시 */
    line-height: 1;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* 단어 카테고리별 그라데이션 변형 */
.word-icon[data-word-type="animal"]::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(211, 84, 0, 0.3);
    z-index: 1;
}

.word-icon[data-word-type="food"]::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(39, 174, 96, 0.3);
    z-index: 1;
}

.word-icon[data-word-type="place"]::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(142, 68, 173, 0.3);
    z-index: 1;
}

.word-icon[data-word-type="transport"]::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(41, 128, 185, 0.3);
    z-index: 1;
}

.word-icon[data-word-type="education"]::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(217, 168, 29, 0.3);
    z-index: 1;
}

.word-icon[data-word-type="time"]::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(22, 160, 133, 0.3);
    z-index: 1;
}

.word-icon[data-word-type="person"]::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(192, 57, 43, 0.3);
    z-index: 1;
}

.word-icon[data-word-type="work"]::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(44, 62, 80, 0.3);
    z-index: 1;
}

.word-icon[data-word-type="entertainment"]::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(142, 68, 173, 0.3);
    z-index: 1;
}

.word-icon[data-word-type="technology"]::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(30, 43, 56, 0.3);
    z-index: 1;
}

.word-icon[data-word-type="greeting"]::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(231, 76, 60, 0.3);
    z-index: 1;
}

.word-icon[data-word-type="default"]::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(93, 109, 126, 0.3);
    z-index: 1;
}

/* 아이콘에 hover 효과 추가 */
.word-icon:hover {
    transform: scale(1.05);
    box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.6), 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
} 