/* ===== MODAL CHÍNH ===== */
.hanzi-modal {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    align-items: center;
    justify-content: center;
    animation: hanziFadeIn 0.3s ease;
}

@keyframes hanziFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.hanzi-modal-content {
    background: white;
    border-radius: 16px;
    width: 95%;
    max-width: 900px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: hanziSlideUp 0.3s ease;
}

@keyframes hanziSlideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.hanzi-modal-header {
    background: linear-gradient(135deg, #FF5722, #E64A19);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e0e0e0;
}

.hanzi-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.hanzi-modal-close {
    font-size: 32px;
    cursor: pointer;
    line-height: 1;
    color: white;
    transition: color 0.2s;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.hanzi-modal-close:hover {
    color: #FFD43B;
    background: rgba(255,255,255,0.1);
}

.hanzi-modal-body {
    padding: 30px;
    overflow-y: auto;
    max-height: calc(90vh - 140px);
    background: #f8f9fa;
}

.hanzi-sentence {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    justify-content: center;
    align-items: flex-start;
}

.hanzi-char-container {
    text-align: center;
    flex: 0 0 auto;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    min-width: 150px;
}

.hanzi-char-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.hanzi-char-label {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #2c3e50;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "SimHei", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

.hanzi-box {
    width: 100px;
    height: 100px;
    border: 3px solid #FFCCBC;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    margin: 0 auto;
}

.hanzi-box:hover {
    border-color: #FF5722;
    box-shadow: 0 0 0 3px rgba(255, 87, 34, 0.1);
}

.hanzi-char-hint {
    margin-top: 10px;
    font-size: 13px;
    color: #666;
    font-style: italic;
}

.hanzi-modal-footer {
    padding: 15px 30px;
    background: #FFECB3;
    text-align: center;
    border-top: 1px solid #e0e0e0;
}

.hanzi-modal-footer small {
    color: #5D4037;
    font-size: 13px;
}

/* ===== CHỮ HÁN VỚI ICON BÚT ===== */
.hanzi-with-pen {
    display: inline-flex;
    align-items: center;
    margin: 0 2px;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 2px 6px;
    border-radius: 4px;
    vertical-align: middle;
}

.hanzi-with-pen:hover {
    background-color: rgba(255, 87, 34, 0.15);
    transform: translateY(-2px);
}

.hanzi-text {
    font-weight: bold;
    color: #2c3e50;
    transition: color 0.2s;
    font-size: 1.1em;
    font-family: "SimHei", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

.hanzi-with-pen:hover .hanzi-text {
    color: #FF5722;
}

.hanzi-pen-icon {
    font-size: 0.9em;
    margin-right: 6px;
    transition: transform 0.2s;
}

.hanzi-with-pen:hover .hanzi-pen-icon {
    transform: scale(1.2);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .hanzi-modal-content {
        width: 95%;
        margin: 10px auto;
        max-height: 95vh;
    }
    
    .hanzi-modal-body {
        padding: 20px;
        max-height: calc(95vh - 140px);
    }
    
    .hanzi-sentence {
        gap: 15px;
        justify-content: center;
    }
    
    .hanzi-char-container {
        padding: 15px;
        min-width: 130px;
    }
    
    .hanzi-box {
        width: 80px;
        height: 80px;
    }
    
    .hanzi-char-label {
        font-size: 28px;
    }
    
    .hanzi-modal-header {
        padding: 15px 20px;
    }
    
    .hanzi-modal-header h3 {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .hanzi-sentence {
        gap: 12px;
    }
    
    .hanzi-char-container {
        min-width: 110px;
        padding: 12px;
    }
    
    .hanzi-box {
        width: 70px;
        height: 70px;
    }
    
    .hanzi-char-label {
        font-size: 24px;
    }
    
    .hanzi-modal-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .hanzi-modal-header h3 {
        font-size: 16px;
        width: 100%;
    }
    
    .hanzi-text {
        font-size: 1em;
    }
}

/* ===== UTILITY ===== */
.clickable-hanzi {
    cursor: pointer;
}

/* Prevent body scroll when modal is open */
body.hanzi-modal-open {
    overflow: hidden;
}

/* Error styles */
.hanzi-error {
    color: #f44336;
    padding: 10px;
    text-align: center;
    font-size: 12px;
}

.hanzi-modal-title {
    font-weight: 600; /* hoặc 700 nếu muốn đậm hơn */
    font-size: 18px;
    color: #333;
}
