/* ================================
   성서 히브리어 단어장 - UI 컴포넌트
   버튼, 카드, 입력, 모달 등
   ================================ */

/* ================================
   1. 버튼 스타일
   ================================ */

/* 기본 버튼 */
button {
    font-family: 'Pretendard', sans-serif;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* Ripple (물결) 효과 */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: scale(0);
    animation: rippleEffect 0.4s ease-out forwards;
    pointer-events: none;
    z-index: 1000;
    will-change: transform, opacity;
}

@keyframes rippleEffect {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

/* Ripple 효과가 적용될 요소들 */
.mode-card,
.option-btn,
.icon-btn,
.primary-btn,
.secondary-btn,
.toggle-btn {
    position: relative;
    overflow: hidden;
}

/* 스위치 토글 스타일 */
.switch-toggle {
    width: 52px;
    height: 28px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    padding: 3px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
    will-change: background;
}

.switch-toggle.active {
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    border-color: rgba(34, 197, 94, 0.5);
}

.switch-knob {
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s ease-out;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    will-change: transform;
}

.switch-toggle.active .switch-knob {
    transform: translateX(24px);
}

/* Primary 버튼 */
.primary-btn {
    width: 100%;
    padding: 15px;
    background: var(--glass-hover-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-color);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.primary-btn:hover {
    background: var(--glass-active-bg);
    transform: translateY(-2px);
    box-shadow: var(--glass-shadow-hover);
}

/* Secondary 버튼 */
.secondary-btn {
    width: 100%;
    padding: 12px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-color);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 10px;
}

.secondary-btn:hover {
    background: var(--glass-hover-bg);
}

/* 아이콘 버튼 */
.icon-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 10px 15px;
    color: var(--text-color);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.icon-btn:hover {
    background: var(--glass-hover-bg);
    transform: translateY(-2px);
}

.icon-btn.small {
    padding: 8px 12px;
    font-size: 0.9rem;
    border-radius: 8px;
}

/* 삭제 버튼 */
.delete-grade-btn,
.delete-record-btn {
    background: rgba(231, 76, 60, 0.2);
    border: 1px solid rgba(231, 76, 60, 0.5);
    color: #ff6b6b;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.delete-grade-btn:hover,
.delete-record-btn:hover {
    background: rgba(231, 76, 60, 0.3);
}

/* ================================
   2. 카드 스타일
   ================================ */

/* 플래시카드 */
.card-container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: stretch;
}

.card {
    position: relative;
    width: 100%;
    max-width: 100%;
    height: 100%; /* 고정 높이 400px 제거 후 100%로 변경 */
    min-height: 200px; /* 최소 높이 확보 */
    perspective: 1000px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

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

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

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 30px;
    box-shadow: var(--glass-shadow);
    transition: transform 0.6s ease;
}

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

.hebrew-word {
    font-family: 'Frank Ruhl Libre', serif;
    font-size: 4rem;
    font-weight: bold;
    color: var(--text-color);
    margin-bottom: 20px;
    text-align: center;
    direction: rtl;
}

.hebrew-word-small {
    font-family: 'Frank Ruhl Libre', serif;
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--text-color);
    margin-bottom: 10px;
    text-align: center;
    direction: rtl;
}

.hebrew-text {
    font-family: 'Frank Ruhl Libre', serif;
    direction: rtl;
    font-weight: bold;
}

.pronunciation {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 15px;
    text-align: center;
}

.meaning {
    font-family: 'Pretendard', sans-serif;
    font-size: 1.8rem; /* 가독성 있는 한글 크기 */
    font-weight: 500;
    color: var(--text-color);
    text-align: center;
    line-height: 1.5;
    word-break: keep-all;
}

.hint-text {
    position: absolute;
    bottom: 30px;
    font-size: 0.9rem;
    opacity: 0.6;
    color: var(--text-color);
}

/* 북마크 버튼 */
.bookmark-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.bookmark-btn:hover {
    color: rgba(255, 255, 255, 0.7);
    transform: scale(1.1);
}

.bookmark-btn.active {
    color: #ffd700;
}

/* 오디오 버튼 */
.audio-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.audio-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* 도움말 버튼 (헤더) */
.help-btn-header {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.help-btn-header:hover {
    background: rgba(59, 130, 246, 0.3);
    color: white;
    transform: scale(1.1);
    border-color: rgba(59, 130, 246, 0.5);
}

.help-btn-header:active {
    transform: scale(0.95);
}

/* ================================
   3. 시험 카드
   ================================ */

.test-start-screen,
.test-quiz-screen,
.test-result-screen {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 20px;
    padding-bottom: 120px; /* 하단 버튼과 겹치지 않도록 여유 공간 확보 */
    box-shadow: var(--glass-shadow);
    height: auto; /* 고정 높이 제거하여 콘텐츠에 맞게 늘어나도록 함 */
    min-height: 100%; /* 최소 높이는 부모 크기만큼 */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 15px;
}

/* 결과 화면 추가 보장 */
.test-result-screen {
    background: var(--glass-bg) !important;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.test-start-screen h2,
.test-quiz-screen h2,
.test-result-screen h2 {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: var(--text-color);
}

/* 퀴즈 헤더 */
.quiz-header {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin-bottom: 0; /* margin removed, handled by flex spacing */
    flex-shrink: 0;
}

.timer-box {
    background: rgba(231, 76, 60, 0.2);
    border: 1px solid rgba(231, 76, 60, 0.5);
    padding: 8px 12px;
    border-radius: 10px;
    color: #ff6b6b;
    font-weight: bold;
    font-size: 0.95rem;
    white-space: nowrap;
}

.progress-box {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-bar-bg {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.progress-text {
    font-size: 0.9rem;
    color: white;
    opacity: 0.8;
    white-space: nowrap;
    min-width: 40px;
    text-align: right;
}

.abort-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ff6b6b;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.abort-btn:hover {
    background: rgba(231, 76, 60, 0.2);
    border-color: #e74c3c;
}

/* 퀴즈 콘텐츠 (중앙 정렬) */
.quiz-content {
    /* flex: 1; 제거하여 고정 공간 점유 방지 및 자동 크기 조절 */
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 20px 0;
    flex-shrink: 0; /* 화면이 작아져도 줄어들지 않음 */
}

/* 퀴즈 문제 */
.quiz-question {
    text-align: center;
    width: 100%;
    padding: 40px 20px;
    background: var(--glass-hover-bg);
    border-radius: 20px;
    margin: 0;
    font-family: 'Frank Ruhl Libre', serif;
    font-size: 3.5rem;
    font-weight: bold;
    color: white;
    box-shadow: var(--glass-shadow);
    /* direction: rtl; Hebrew supports rtl */
}

.quiz-question.meaning-question {
    font-family: 'Pretendard', sans-serif;
    font-size: 2rem;
    direction: ltr;
    word-break: keep-all;
    line-height: 1.4;
}

/* 퀴즈 선택지 */
.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px; /* auto 대신 고정 간격 부여 */
    margin-bottom: 30px; /* 하단 여유 공간 추가 */
    width: 100%;
    flex-shrink: 0; /* 줄어들지 않게 방지 */
}

.option-btn {
    width: 100%;
    padding: 15px 20px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-color);
    font-size: 1rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
}

.option-btn:hover {
    background: var(--glass-hover-bg);
    transform: translateX(5px);
}

.option-btn.correct {
    background: rgba(46, 204, 113, 0.3);
    border-color: #2ecc71;
}

.option-btn.wrong {
    background: rgba(231, 76, 60, 0.3);
    border-color: #e74c3c;
}

/* ================================
   4. 통계 카드
   ================================ */

/* 통계 카드 컨테이너 (Sortable) */
.stats-sortable-container {
    display: flex;
    flex-direction: column;
}

.stat-card {
    width: 100%;
    margin-bottom: 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 25px 20px;
    box-shadow: var(--glass-shadow);
    box-sizing: border-box;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card h3 {
    font-size: 1.1rem;
    margin-bottom: 20px;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

/* 드래그 핸들 스타일 */
.drag-handle {
    cursor: grab;
    padding: 5px 8px;
    margin-right: 5px;
    color: rgba(255, 255, 255, 0.5);
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
}

.drag-handle:hover {
    color: rgba(255, 255, 255, 0.9);
}

.drag-handle:active {
    cursor: grabbing;
}

/* SortableJS 드래그 상태 스타일 */
.sortable-ghost {
    opacity: 0.4;
    background: rgba(255, 255, 255, 0.2);
}

.sortable-chosen {
    transform: scale(1.02);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.sortable-drag {
    opacity: 1;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.stat-item {
    text-align: center;
    padding: 20px;
    background: var(--glass-hover-bg);
    border-radius: 12px;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-color);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
    color: var(--text-color);
}

/* ================================
   5. 달력
   ================================ */

.calendar-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.streak-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-top: 15px;
}

.calendar-day-header {
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 5px;
    opacity: 0.7;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.calendar-day.empty {
    background: transparent;
}

.calendar-day.today {
    border: 2px solid #667eea;
    font-weight: bold;
}

.calendar-day.level-1 {
    background: rgba(102, 126, 234, 0.3);
}

.calendar-day.level-2 {
    background: rgba(102, 126, 234, 0.5);
}

.calendar-day.level-3 {
    background: rgba(102, 126, 234, 0.7);
}

.calendar-day.level-4 {
    background: rgba(102, 126, 234, 0.9);
}

/* ================================
   6. 단어 아이템
   ================================ */

.word-item {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start; /* 상단 정렬로 변경하여 긴 텍스트 대응 */
    transition: all 0.3s ease;
    box-shadow: var(--glass-shadow);
}

.word-item:hover {
    background: var(--glass-hover-bg);
    transform: translateX(5px);
    box-shadow: var(--glass-shadow-hover);
}

.word-info {
    display: flex;
    flex-direction: column;
    gap: 8px; /* 간격 조정 */
    flex: 1;
}

.word-hebrew-list {
    font-size: 2.4rem; /* 가독성을 위해 대폭 확대 */
    font-weight: 700;
    color: var(--text-color);
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2px;
    text-align: left; /* 히브리어 좌측 정렬 강제 */
}

/* ================================
   7. 입력 요소
   ================================ */

input[type="text"],
input[type="number"],
select {
    width: 100%;
    height: 50px; /* 고정 높이로 통일 */
    padding: 0 20px; /* 좌우 여백 20px로 통일하여 텍스트 라인 맞춤 */
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: #ffffff; /* 글자색 완전 하얀색으로 통일 */
    font-size: 1rem;
    font-family: 'Pretendard', sans-serif;
    transition: all 0.3s ease;
    box-sizing: border-box;
    /* line-height is tricky with inputs, but height usually handles vertical centering */
}

/* Placeholder 색상 통일 (하얀색) */
input::placeholder,
textarea::placeholder {
    color: rgba(255, 255, 255, 0.8); /* placeholder도 밝은 하얀색 계열로 통일 */
}

textarea {
    width: 100%;
    padding: 20px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: #ffffff;
    font-size: 1rem;
    font-family: 'Pretendard', sans-serif;
    transition: all 0.3s ease;
    box-sizing: border-box;
    min-height: 100px;
    resize: vertical;
}

/* Hebrew Input for Textarea */
.hebrew-input {
    font-family: 'Frank Ruhl Libre', serif;
    font-size: 2rem;
    text-align: center;
    direction: rtl;
    line-height: 1.5;
}

/* Select 전용 스타일 (화살표 추가) */
select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.8)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 16px;
    padding-right: 45px !important; /* 화살표 공간 확보 */
    cursor: pointer;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
    outline: none;
    background: var(--glass-hover-bg);
    border-color: rgba(102, 126, 234, 0.5);
}

select option {
    background: #2d3748;
    color: white;
}

/* 체크박스 */
input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    cursor: pointer;
}

/* ================================
   8. 테이블
   ================================ */

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

.grade-table thead {
    background: var(--glass-hover-bg);
}

.grade-table th,
.grade-table td {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid var(--glass-border);
}

.grade-table th {
    font-weight: 600;
    font-size: 0.9rem;
}

.grade-table td {
    font-size: 0.95rem;
}

.score-high {
    color: #2ecc71;
    font-weight: bold;
}

/* ================================
   8.5. 랭킹 시스템
   ================================ */

.ranking-container {
    width: 100%;
}

.my-rank-card {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 165, 0, 0.1) 100%);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
}

.rank-badge {
    width: 50px;
    height: 50px;
    background: var(--glass-hover-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
}

.rank-badge.top-3 {
    background: linear-gradient(135deg, #ffd700 0%, #ff8c00 100%);
    color: #1a1a2e;
}

.update-rank-btn {
    width: 100%;
    margin-top: 15px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.update-rank-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ranking-item {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
}

.ranking-item.is-me {
    background: rgba(100, 200, 255, 0.15);
    border-color: rgba(100, 200, 255, 0.4);
}

.ranking-item.top-1 {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 215, 0, 0.05) 100%);
    border-color: rgba(255, 215, 0, 0.4);
}

.ranking-item.top-2 {
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.15) 0%, rgba(192, 192, 192, 0.05) 100%);
    border-color: rgba(192, 192, 192, 0.4);
}

.ranking-item.top-3 {
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.15) 0%, rgba(205, 127, 50, 0.05) 100%);
    border-color: rgba(205, 127, 50, 0.4);
}

.rank-number {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    color: white;
}

.user-info {
    flex: 1;
}

.user-name {
    font-weight: 600;
    color: white;
    font-size: 1rem;
}

.user-level {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 2px;
}

.user-stats {
    text-align: right;
}

.xp-value {
    font-weight: bold;
    color: #ffd700;
    font-size: 1.1rem;
}

.xp-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}

.ranking-disabled {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 40px 20px;
}

/* ================================
   SRS 복습 시스템 스타일
   ================================ */

.srs-container {
    width: 100%;
    min-height: calc(100vh - 200px);
    display: flex;
    flex-direction: column;
}

.srs-header {
    margin-bottom: 20px;
}

.srs-progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.srs-count {
    font-size: 1.1rem;
    font-weight: bold;
    color: white;
}

.srs-badges {
    display: flex;
    gap: 8px;
}

.srs-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.srs-badge.review {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.srs-badge.new {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.srs-progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.srs-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6 0%, #8b5cf6 100%);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* SRS 카드 영역 */
.srs-card-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 20px;
    padding-top: 20px;
}

.srs-card {
    width: 100%;
    max-width: 350px;
    height: 500px;
    perspective: 1000px;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
}

.srs-card-front,
.srs-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    transition: transform 0.5s ease;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.srs-card-front {
    background: linear-gradient(145deg, rgba(45, 55, 72, 0.95) 0%, rgba(26, 32, 44, 0.95) 100%);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.srs-card-back {
    background: linear-gradient(145deg, rgba(59, 130, 246, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
    border: 1px solid rgba(139, 92, 246, 0.3);
    transform: rotateY(180deg);
}

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

.srs-card.flipped .srs-card-back {
    transform: rotateY(0deg);
}

.srs-card.is-new .srs-card-front {
    border-color: rgba(34, 197, 94, 0.4);
}

.srs-new-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 4px 10px;
    border-radius: 10px;
}

.srs-hebrew {
    font-family: 'Frank Ruhl Libre', serif;
    font-size: 3.5rem;
    color: white;
    text-align: center;
    direction: rtl;
    line-height: 1.3;
}

.srs-lesson-badge {
    margin-top: 15px;
    padding: 5px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}

.srs-tap-hint {
    position: absolute;
    bottom: 20px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
}

.srs-meaning {
    font-size: 1.8rem;
    color: white;
    text-align: center;
    font-weight: 600;
    line-height: 1.4;
}

.srs-pronunciation {
    margin-top: 10px;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.6);
}

.srs-hebrew-small {
    margin-top: 20px;
    font-family: 'Frank Ruhl Libre', serif;
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.5);
    direction: rtl;
}

/* SRS 버튼 그룹 */
.srs-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    width: 100%;
    max-width: 400px;
    flex-shrink: 0;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.srs-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 8px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.2s ease;
}

.srs-btn:active {
    transform: scale(0.95);
}

.srs-btn-emoji {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.srs-btn-text {
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
}

.srs-btn-interval {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 2px;
}

.srs-btn.again {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
}

.srs-btn.again:hover {
    background: rgba(239, 68, 68, 0.25);
}

.srs-btn.hard {
    background: rgba(251, 191, 36, 0.15);
    border-color: rgba(251, 191, 36, 0.3);
}

.srs-btn.hard:hover {
    background: rgba(251, 191, 36, 0.25);
}

.srs-btn.good {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.3);
}

.srs-btn.good:hover {
    background: rgba(34, 197, 94, 0.25);
}

.srs-btn.easy {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
}

.srs-btn.easy:hover {
    background: rgba(59, 130, 246, 0.25);
}

/* SRS 빈 상태 & 완료 화면 */
.srs-empty,
.srs-complete {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
}

.srs-empty-icon,
.srs-complete-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.srs-empty h3,
.srs-complete h3 {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    margin-bottom: 10px;
}

.srs-empty p,
.srs-complete p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 1rem;
}

.srs-stats-summary {
    margin-top: 15px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    font-size: 0.9rem;
}

.srs-result-stats {
    display: flex;
    gap: 30px;
    margin-top: 20px;
}

.srs-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.srs-stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: white;
}

.srs-stat-item.correct .srs-stat-value {
    color: #4ade80;
}

.srs-stat-item.again .srs-stat-value {
    color: #f87171;
}

.srs-stat-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 4px;
}

/* ================================
   9. 빈 상태 메시지
   ================================ */

.empty-message {
    width: 100%;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 60px 30px;
    text-align: center;
    font-size: 1.1rem;
    color: var(--text-color);
    opacity: 0.9;
    box-shadow: var(--glass-shadow);
    min-height: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

/* ================================
   10. 모달
   ================================ */

#settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
}

#settings-modal.hidden {
    display: none;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    background: var(--glass-bg);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 30px;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 2001;
}

.modal-header-sticky {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.close-modal-btn-sticky {
    background: rgba(231, 76, 60, 0.2);
    border: 1px solid rgba(231, 76, 60, 0.5);
    color: #ff6b6b;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.close-modal-btn-sticky:hover {
    background: rgba(231, 76, 60, 0.3);
    transform: rotate(90deg);
}

.setting-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
}

.setting-card h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
}

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

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    opacity: 0.9;
}

/* ================================
   11. 토글 스위치
   ================================ */

.toggle-group {
    display: flex;
    background: rgba(0, 0, 0, 0.25); /* 더 진한 배경 */
    border-radius: 16px; /* 더 둥글게 */
    padding: 6px;
    gap: 8px;
    margin-top: 10px;
    width: 100%;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.1); /* 안쪽 그림자로 깊이감 */
}

.toggle-btn {
    flex: 1;
    padding: 14px 5px; /* 상하 패딩 넉넉하게 */
    border: none;
    border-radius: 12px;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    line-height: 1.4;
    word-break: keep-all; /* 단어 단위로 끊기 */
}

.toggle-btn:hover {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.05);
}

.toggle-btn.active {
    background: linear-gradient(135deg, #2193b0 0%, #1c7c94 100%); /* 청록색 그라데이션 */
    color: white;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2); /* 입체감 그림자 */
    transform: translateY(-1px);
}

/* ================================
   12. Glass Checkbox
   ================================ */

.glass-checkbox {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    position: relative;
    user-select: none;
    padding: 5px 0;
}

.glass-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.glass-checkbox .checkbox-box {
    width: 22px;
    height: 22px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    margin-right: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.glass-checkbox:hover .checkbox-box {
    background: var(--glass-hover-bg);
    transform: translateY(-1px);
}

.glass-checkbox input:checked ~ .checkbox-box {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
}

.glass-checkbox .checkbox-box i {
    color: var(--text-color);
    font-size: 12px;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.glass-checkbox input:checked ~ .checkbox-box i {
    opacity: 1;
    transform: scale(1);
    color: #3b82f6;
}

.glass-checkbox .label-text {
    font-size: 1rem;
    color: var(--text-color);
    font-weight: 500;
}
