/* Флаш карт харуулах үндсэн загварын гоёлсон CSS */

/* Үндсэн загварууд */
body {
    background-color: #f0f5ff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #1f2937;
    min-height: 100vh;
    position: relative;
    background-image: radial-gradient(#d5e3ff 1px, transparent 1px);
    background-size: 25px 25px;
}

.flashcard-container {
    max-width: 1000px;
    margin: 0px auto;
    background-color: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(76, 94, 157, 0.12), 0 5px 15px rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(226, 232, 240, 0.8);
    /* Хөдөлгөөн үүсгэх transition-г хассан */
}

/* HSK түвшний навигаци */
.hsk-navigation {
    display: flex;
    justify-content: space-between;
    background-color: #fefefe;
    border-bottom: 0px solid #e9ecef;
        border-left: 0px solid #e9ecef;
    
    border-radius: 0px 0px 0 0;
    overflow: hidden;
}

.hsk-navigation a {
    flex: 1;
    text-align: center;
    padding: 18px 0;
    text-decoration: none;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #4b5563;
    transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
    position: relative;
}

.hsk-navigation a.active {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.hsk-navigation a.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #4f46e5, #6366f1);
}

.hsk-navigation a:hover:not(.active) {
    background-color: #e9ecef;
    color: #4338ca;
    transform: translateY(-2px);
}

/* Гарчиг */
.d-flex.justify-content-between.align-items-center.mb-4 {
    display: block !important;
    text-align: center;
    padding: 35px 0 25px;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 0 !important;
    background: linear-gradient(to bottom, #fcfcfd, #f9fafb);
}

.d-flex.justify-content-between.align-items-center.mb-4 h2 {
    font-size: 36px;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 10px;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #1e293b, #334155);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
}

.d-flex.justify-content-between.align-items-center.mb-4 h2::after {
    content: '';
    display: block;
    width: 100px;
    height: 5px;
    background: linear-gradient(90deg, #6366f1, #4f46e5);
    margin: 15px auto 0;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.25);
}

.d-flex.justify-content-between.align-items-center.mb-4 .dropdown {
    display: none;
}

/* Таб системтэй карт загвар */
.nav-tabs {
    display: flex;
    border-bottom: none;
    background-color: #f3f4f6;
    padding: 8px;
    border-radius: 12px;
    margin: 0 20px;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.05);
}

.nav-item {
    flex: 1;
    margin: 0 5px;
}

.nav-link {
    border-radius: 10px !important;
    text-align: center;
    width: 100%;
    padding: 16px 0;
    font-size: 16px;
    font-weight: 700;
    border: none !important;
    transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
    color: #4b5563;
    position: relative;
    overflow: hidden;
}

.nav-link.active {
    background: linear-gradient(135deg, #6366f1, #4f46e5) !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 6px 12px rgba(99, 102, 241, 0.25);
    transform: translateY(-1px);
}

.nav-link.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0));
    transform: translateX(-100%);
    animation: shine 2s infinite;
}

@keyframes shine {
    100% {
        transform: translateX(100%);
    }
}

.nav-link:hover:not(.active) {
    background-color: #e5e7eb;
    color: #4338ca;
    transform: translateY(-2px);
}

/* Хятад үг */
.chinese-word {
    font-size: 240px;
    color: #1e293b;
    font-weight: bold;
    line-height: 1.2;
    margin: 10% 0 20px;
    transition: all 0.6s cubic-bezier(0.19, 1, 0.22, 1);
    text-shadow: 0 6px 12px rgba(0, 0, 0, 0.07);
    text-align: center;
    display: block;
    position: relative;
}

.chinese-word::after {
    content: '';
    position: absolute;
    width: 120px;
    height: 120px;
    background-color: rgba(99, 102, 241, 0.05);
    border-radius: 50%;
    z-index: -1;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.6s cubic-bezier(0.19, 1, 0.22, 1);
}

.chinese-word:hover {
    transform: scale(1.05);
    text-shadow: 0 10px 16px rgba(0, 0, 0, 0.12);
}

.chinese-word:hover::after {
    width: 250px;
    height: 250px;
}

/* Сонсох товч */
.speak-btn-main {
    background: none;
    border: none !important;
    color: #6366f1;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 70px !important;
    height: 70px !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    margin: 25px auto;
    border-radius: 50%;
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    box-shadow: 0 6px 12px rgba(99, 102, 241, 0.2);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(79, 70, 229, 0.1));
    position: relative;
    z-index: 1;
}

.speak-btn-main::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(79, 70, 229, 0.2));
    z-index: -1;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

.speak-btn-main:hover {
    transform: scale(1.1) translateY(-5px);
    box-shadow: 0 12px 20px rgba(99, 102, 241, 0.25);
}

.speak-btn-main:hover::before {
    opacity: 1;
    transform: scale(1.3);
}

.speak-btn-main i {
    font-size: 32px !important;
    color: #6366f1 !important;
    display: block !important;
    transition: all 0.3s ease;
}

.speak-btn-main:hover i {
    color: #4f46e5 !important;
    transform: scale(1.1);
}

/* Сонсох товчны анимейшн */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.6);
    }
    70% {
        box-shadow: 0 0 0 20px rgba(99, 102, 241, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
    }
}

.speak-btn-main:active {
    animation: pulse 1s;
    transform: scale(0.95);
}

/* Пиньин контейнер */
.pinyin-container {
    position: relative;
    padding: 10px 0;
}

.pinyin-container::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.1), rgba(99, 102, 241, 0.4), rgba(99, 102, 241, 0.1));
    border-radius: 10px;
}

.pinyin-container .pinyin {
    font-size: 2.2rem;
    color: #6366f1;
    font-weight: 600;
    margin: 15px 0;
    letter-spacing: 0.02em;
    text-shadow: 0 2px 4px rgba(99, 102, 241, 0.1);
}

/* Монгол үг */
.mongolian-word {
    font-size: 3.2rem !important;
    font-weight: 800;
    margin-top: 10%;
    color: #1e293b;
    line-height: 1.1;
    margin-bottom: 20px;
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    display: block;
    position: relative;
}

.mongolian-word::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.2), rgba(79, 70, 229, 0.5), rgba(99, 102, 241, 0.2));
    margin: 15px auto 0;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.15);
}

.mongolian-word:hover {
    transform: translateY(-3px);
    text-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
}



/* Ойлгоогүй үгийн чекбокс */
.form-check.form-check-inline {
    margin: 0 !important;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-check-input.not-understood-checkbox {
    margin-right: 14px;
    width: 24px;
    height: 24px;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
    position: relative;
    overflow: hidden;
}

.form-check-input.not-understood-checkbox:checked {
    background-color: #6366f1;
    border-color: #6366f1;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.25);
}

.form-check-input.not-understood-checkbox:checked::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    background-color: white;
    border-radius: 50%;
    animation: checkPulse 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

@keyframes checkPulse {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0.5;
    }
    100% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
}

.form-check-label {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    color: #4b5563;
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-check-label:hover {
    color: #6366f1;
}

/* Статистик хэсэг */
.stats-info {
    display: block;
    text-align: center;
    color: #64748b;
    font-size: 14px;
    padding: 18px;
    background: #fefefe;
    border-bottom: 0px solid #e9ecef;
    margin-bottom: 15px;
    font-weight: normal;
    letter-spacing: 0.01em;
}

#remainingCounter, 
#notUnderstoodCounter {
    display: inline-block;
    background-color: #a94e4e;
    color: white;
    font-weight: bold;
    padding: 3px 6px;
    border-radius: 4px;
    margin-left: 3px;
    min-width: 24px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
}

#remainingCounter:hover, 
#notUnderstoodCounter:hover {
    background-color: rgba(99, 102, 241, 0.15);
    transform: translateY(-1px);
}


.category-navigation {
    display: flex;
    justify-content: space-between;
    background-color: #f8fafc;
    border-bottom: 1px solid #e9ecef;
    border-radius: 1px 1px 0 0;
    overflow: hidden;
}

/* Зүйлсийн хооронд зураас нэмэх */
.category-navigation > * {
    position: relative;
}

.category-navigation > *:not(:last-child)::after {
    content: "";
    position: absolute;
    right: 0;
    top: 15%;
    height: 70%;
    width: 1px;
    background-color: #dedede;
}

.category-navigation a {
    flex: 1;
    text-align: center;
    padding: 18px 0;
    text-decoration: none;
    font-weight: 700;
    color: #4b5563;
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    letter-spacing: 0.01em;
    position: relative;
    overflow: hidden;
}

.category-navigation a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 0;
    height: 3px;

    background: linear-gradient(90deg, transparent, #6366f1, transparent);
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    transform: translateX(-50%);
}

.category-navigation a.active {
    background: #6059e9;
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.category-navigation a.active::before {
    width: 80%;
}

.category-navigation a.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: #4338ca;
}

.category-navigation a:hover:not(.active):not(.disabled) {
    background-color: #e9ecef;
    color: #4338ca;
   
}

.category-navigation a:hover:not(.active):not(.disabled)::before {
    width: 60%;
}

.category-navigation a.disabled {
    color: #9ca3af;
    cursor: not-allowed;
    pointer-events: auto;
    background-color: #f3f4f6;
}

.category-navigation a i {
    margin-right: 6px;
    transition: all 0.3s ease;
}

.category-navigation a:hover:not(.disabled) i {
    transform: translateY(-2px);
}

/* Хүрээг хасах */
.btn-outline-primary {
    border: none !important;
    background: none !important;
    color: #6366f1 !important;
    transition: all 0.3s ease;
}

.btn-outline-primary:hover, 
.btn-outline-primary:active,
.btn-outline-primary:focus {
    border: none !important;
    background: rgba(99, 102, 241, 0.08) !important;
    box-shadow: none !important;
    outline: none !important;
    color: #4f46e5 !important;
    transform: translateY(-2px);
}

/* Эрхгүй категори сонгоход харуулах мессеж */
#permissionMessage {
    margin: 30px;
    border-radius: 16px;
    position: relative;
    box-shadow: 0 8px 15px rgba(244, 63, 94, 0.08);
    padding: 25px;
    background-color: #fff1f2;
    border: 1px solid #fecdd3;
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#permissionMessage .btn-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border: none;
    color: white;
    font-weight: 700;
    padding: 12px 20px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.3);
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    letter-spacing: 0.01em;
}

#permissionMessage .btn-warning:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(245, 158, 11, 0.35);
    background: linear-gradient(135deg, #f59e0b, #ca8a04);
}

#permissionMessage .btn-outline-secondary {
    color: #6b7280;
    border: 1px solid #d1d5db !important;
    background-color: white !important;
    font-weight: 600;
    padding: 12px 20px;
    border-radius: 10px;
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

#permissionMessage .btn-outline-secondary:hover {
    color: #4b5563;
    background-color: #f8fafc !important;
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
    border-color: #cbd5e1 !important;
}

/* Хариуцлагатай дизайн */
@media (max-width: 768px) {
    .chinese-word {
        font-size: 180px;
    }
    
    .mongolian-word {
        font-size: 2.5rem !important;
    }
    
    .pinyin-container .pinyin {
        font-size: 1.8rem;
    }
    
    #prevCardBtn, #nextCardBtn {
        width: 48px;
        height: 48px;
        min-width: 48px;
        min-height: 48px;
    }
    
    .speak-btn-main {
        width: 60px !important;
        height: 60px !important;
    }
    
    .flashcard-navigation {
        padding: 18px 25px;
    }
}

@media (max-width: 576px) {
    .chinese-word {
        font-size: 140px;
    }
    
    .mongolian-word {
        font-size: 2rem !important;
    }
    
    .pinyin-container .pinyin {
        font-size: 1.5rem;
    }
    
    .nav-link {
        padding: 12px 0;
        font-size: 14px;
    }
    
    #prevCardBtn, #nextCardBtn {
        width: 42px;
        height: 42px;
        min-width: 42px;
        min-height: 42px;
    }
    
    #prevCardBtn::before, #nextCardBtn::before {
        font-size: 24px;
    }
    
    .btn-outline-secondary {
        padding: 15px 0 !important;
    }
    
    .toggle-content[data-target*="videos"],
    button[data-target*="videos"] {
        padding: 15px 0 !important;
    }
    
    .btn-outline-secondary i,
    .toggle-content[data-target*="videos"] i,
    button[data-target*="videos"] i {
        font-size: 20px;
        margin-bottom: 6px;
    }
    
    .speak-btn-main {
        width: 55px !important;
        height: 55px !important;
    }
    
    .speak-btn-main i {
        font-size: 28px !important;
    }
    
    .d-flex.justify-content-between.align-items-center.mb-4 h2 {
        font-size: 28px;
    }
    
    .content-section {
        margin: 0 15px 20px;
    }
    
    #permissionMessage {
        margin: 20px;
        padding: 20px;
    }
    
    .flashcard-navigation {
        padding: 15px 20px;
    }
}

/* Гоё анимейшнүүдийг нэмж оруулах */
@keyframes floatAnimation {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
    100% {
        transform: translateY(0);
    }
}

.chinese-word, .mongolian-word {
    animation: floatAnimation 5s ease-in-out infinite;
}

/* Хятад үг болон карт дээр тусгай эффект */
.tab-content {
    position: relative;
    overflow: hidden;
}

.tab-content::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 0;
}

.tab-content::after {
    content: '';
    position: absolute;
    bottom: -50px;
    left: -50px;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 0;
}

/* Шалгалтын хэсэг дээр тусгай эффект нэмэх */
.form-check-input.not-understood-checkbox:hover {
    transform: scale(1.1);
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Сэтгэгдэл хэсэг нэмэх */
.flashcard-footer {
    text-align: center;
    padding: 20px;
    font-size: 14px;
    color: #94a3b8;
    background: linear-gradient(to right, #f8fafc, #f1f5f9);
    border-top: 1px solid #e9ecef;
}

.flashcard-footer a {
    color: #6366f1;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.flashcard-footer a:hover {
    color: #4f46e5;
    text-decoration: underline;
}