/* Reset CSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #000000;
    --primary-dark: #000000;
    --primary-light: #333333;
    --accent-color: #666666;
    --accent-dark: #444444;
    --accent-light: #888888;
    --text-primary: #000000;
    --text-secondary: #333333;
    --text-white: #ffffff;
    --background-color: #f2f2f2;
    --card-color: #ffffff;
    --border-color: #000000;
    --success-color: #000000;
    --danger-color: #000000;
    --warning-color: #666666;
    --info-color: #333333;
    --section-gap: 3rem;
    --card-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    --transition-default: all 0.3s ease;
}

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--background-color);
    background-image: none;
    min-height: 100vh;
    background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAAAUVBMVEWFhYWDg4N3d3dtbW17e3t1dXWBgYGHh4d5eXlzc3OLi4ubm5uVlZWPj4+NjY19fX2JiYl/f39ra2uRkZGZmZlpaWmXl5dvb29xcXGTk5NnZ2c8TV1mAAAAG3RSTlNAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAvEOwtAAAFVklEQVR4XpWWB67c2BUFb3g557T/hRo9/WUMZHlgr4Bg8Z4qQgQJlHI4A8SzFVrapvmTF9O7dmYRFZ60YiBhJRCgh1FYhiLAmdvX0CzTOpNE77ME0Zty/nWWzchDtiqrmQDeuv3powQ5ta2eN0FY0InkqDD73lT9c9lEzwUNqgFHs9VQce3TVClFCQrSTfOiYkVJQBmpbq2L6iZavPnAPcoU0dSw0SUTqz/GtrGuXfbyyBniKykOWQWGqwwMA7QiYAxi+IlPdqo+hYHnUt5ZPfnsHJyNiDtnpJyayNBkF6cWoYGAMY92U2hXHF/C1M8uP/ZtYdiuj26UdAdQQSXQErwSOMzt/XWRWAz5GuSBIkwG1H3FabJ2OsUOUhGC6tK4EMtJO0ttC6IBD3kM0ve0tJwMdSfjZo+EEISaeTr9P3wYrGjXqyC1krcKdhMpxEnt5JetoulscpyzhXN5FRpuPHvbeQaKxFAEB6EN+cYN6xD7RYGpXpNndMmZgM5Dcs3YSNFDHUo2LGfZuukSWyUYirJAdYbF3MfqEKmjM+I2EfhA94iG3L7uKrR+GdWD73ydlIB+6hgref1QTlmgmbM3/LeX5GI1Ux1RWpgxpLuZ2+I+IjzZ8wqE4nilvQdkUdfhzI5QDWy+kw5Wgg2pGpeEVeCCA7b85BO3F9DzxB3cdqvBzWcmzbyMiqhzuYqtHRVG2y4x+KOlnyqla8AoWWpuBoYRxzXrfKuILl6SfiWCbjxoZJUaCBj1CjH7GIaDbc9kqBY3W/Rgjda1iqQcOJu2WW+76pZC9QG7M00dffe9hNnseupFL53r8F7YHSwJWUKP2q+k7RdsxyOB11n0xtOvnW4irMMFNV4H0uqwS5ExsmP9AxbDTc9JwgneAT5vTiUSm1E7BSflSt3bfa1tv8Di3R8n3Af7MNWzs49hmauE2wP+ttrq+AsWpFG2awvsuOqbipWHgtuvuaAE+A1Z/7gC9hesnr+7wqCwG8c5yAg3AL1fm8T9AZtp/bbJGwl1pNrE7RuOX7PeMRUERVaPpEs+yqeoSmuOlokqw49pgomjLeh7icHNlG19yjs6XXOMedYm5xH2YxpV2tc0Ro2jJfxC50ApuxGob7lMsxfTbeUv07TyYxpeLucEH1gNd4IKH2LAg5TdVhlCafZvpskfncCfx8pOhJzd76bJWeYFnFciwcYfubRc12Ip/ppIhA1/mSZ/RxjFDrJC5xifFjJpY2Xl5zXdguFqYyTR1zSp1Y9p+tktDYYSNflcxI0iyO4TPBdlRcpeqjK/piF5bklq77VSEaA+z8qmJTFzIWiitbnzR794USKBUaT0NTEsVjZqLaFVqJoPN9ODG70IPbfBHKK+/q/AWR0tJzYHRULOa4MP+W/HfGadZUbfw177G7j/OGbIs8TahLyynl4X4RinF793Oz+BU0saXtUHrVBFT/DnA3ctNPoGbs4hRIjTok8i+algT1lTHi4SxFvONKNrgQFAq2/gFnWMXgwffgYMJpiKYkmW3tTg3ZQ9Jq+f8XN+A5eeUKHWvJWJ2sgJ1Sop+wwhqFVijqWaJhwtD8MNlSBeWNNWTa5Z5kPZw5+LbVT99wqTdx29lMUH4OIG/D86ruKEauBjvH5xy6um/Sfj7ei6UUVk4AIl3MyD4MSSTOFgSwsH/QJWaQ5as7ZcmgBZkzjjU1UrQ74ci1gWBCSGHtuV1H2mhSnO3Wp/3fEV5a+4wz//6qy8JxjZsmxxy5+4w9CDNJY09T072iKG0EnOS0arEYgXqYnXcYHwjTtUNAcMelOd4xpkoqiTYICWFq0JSiPfPDQdnt+4/wuqcXY47QILbgAAAABJRU5ErkJggg==');
}

.page-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    width: 95%;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (max-width: 768px) {
    .container {
        width: 100%;
        padding: 0 1rem;
    }
}

/* Header Styles - Đen như trang manga */
.site-header {
    background-color: #000000;
    padding: 1rem 0;
    border-bottom: 2px solid #ffffff;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.logo {
    flex: 1;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: #ffffff;
}

.tagline {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 0.25rem;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-outline {
    background-color: transparent;
    color: #ffffff;
    border: 1px solid #ffffff;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.btn-outline:hover {
    background-color: #ffffff;
    color: #000000;
}

@media (max-width: 768px) {
    .site-header {
        padding: 0.75rem 0;
    }

    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }

    .logo h1 {
        font-size: 1.25rem;
    }

    .tagline {
        font-size: 0.8rem;
    }

    .nav-container {
        flex-direction: column;
        gap: 0.5rem;
    }

    .nav-links {
        flex-direction: row;
        justify-content: center;
        width: 100%;
        gap: 1rem;
    }

    .nav-links a {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 1.1rem;
    }

    .tagline {
        font-size: 0.75rem;
    }

    .nav-links {
        gap: 0.75rem;
    }
}

/* Intro Section */
.intro-section {
    padding: 3rem 0;
    background: linear-gradient(to right, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.7)), 
                url('images/ai-translation-bg.jpg') no-repeat center;
    background-size: cover;
    border-radius: 0;
    margin-bottom: var(--section-gap);
    box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.8);
    border: 2px solid #000;
}

.intro-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    padding: 1.5rem;
}

.intro-content h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 2.5rem;
    color: #000000;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.intro-content p {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.feature-list {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 2rem;
}

.feature-item {
    background-color: #ffffff;
    border-radius: 0;
    padding: 1.5rem;
    width: 180px;
    text-align: center;
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.8);
    transition: var(--transition-default);
    border: 2px solid #000;
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: 6px 6px 0 rgba(0, 0, 0, 1);
}

.feature-item i {
    font-size: 2rem;
    color: #000000;
    margin-bottom: 1rem;
}

.feature-item span {
    font-weight: 700;
    color: var(--text-primary);
}

/* Main content styling */
.site-main {
    flex: 1;
    padding-bottom: var(--section-gap);
}

/* App container */
.app-container {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    align-items: flex-start;
    max-width: 1500px;
    margin: 0 auto;
}

@media (max-width: 1100px) {
    .app-container {
        flex-direction: column;
    }
}

/* Settings and Translation Panels */
.settings-panel, .translation-panel {
    background-color: #ffffff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    transition: transform var(--transition-default), box-shadow var(--transition-default);
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
    width: 100%;
}

.settings-panel {
    flex: 1;
    min-width: 400px; /* Đảm bảo kích thước tối thiểu */
}

.translation-panel {
    flex: 2;
    min-width: 800px; /* Tăng kích thước tối thiểu */
}

@media (max-width: 1300px) {
    .settings-panel, .translation-panel {
        min-width: 100%;
    }
}

h2 {
    color: #000000;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    font-family: 'Montserrat', sans-serif;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #000000;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

h2 i {
    color: #000000;
}

h3 {
    color: #000000;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

h3 i {
    color: #000000;
}

.settings-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.settings-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.settings-actions {
    display: flex;
    gap: 0.8rem;
    justify-content: flex-start;
    flex-wrap: wrap;
    padding: 1.2rem;
    background-color: #f0f4f8;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Form elements styling */
input[type="text"], 
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid #000000;
    border-radius: 0;
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition-default);
    background-color: #ffffff;
}

input[type="text"]:focus, 
input[type="password"]:focus,
textarea:focus,
select:focus {
    border-color: #000000;
    outline: none;
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.2);
    background-color: #ffffff;
}

textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.5;
    margin-bottom: 1rem;
}

#source-text {
    min-height: 200px;
    font-size: 1rem;
}

.full-width {
    width: 100%;
    margin-bottom: 0.8rem;
}

/* Button styles - Góc vuông, tương phản cao kiểu manga */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 18px;
    border: 2px solid #1a1a1a;
    border-radius: 0;
    background-color: #ffffff;
    color: #1a1a1a;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    line-height: 1.5;
    gap: 10px;
    box-shadow: 3px 3px 0 #1a1a1a;
}

.btn:hover {
    background-color: #f5f5f5;
    transform: translate(-2px, -2px);
    box-shadow: 5px 5px 0 #1a1a1a;
}

.btn:active {
    transform: translate(0, 0);
    box-shadow: 1px 1px 0 #1a1a1a;
}

.btn-primary {
    background-color: #1a1a1a;
    color: #ffffff;
    border-color: #1a1a1a;
    box-shadow: 3px 3px 0 #6b6b6b;
}

.btn-primary:hover {
    background-color: #000000;
    box-shadow: 5px 5px 0 #6b6b6b;
}

.btn-primary:active {
    box-shadow: 1px 1px 0 #6b6b6b;
}

.btn-secondary {
    background-color: #ffffff;
    border-color: #1a1a1a;
    color: #1a1a1a;
}

.btn-add {
    padding: 4px 12px;
    font-size: 0.85rem;
}

.btn-warning {
    background-color: #ff4a4a;
    border-color: #d10000;
    color: #ffffff;
    box-shadow: 3px 3px 0 #801515;
}

.btn-warning:hover {
    background-color: #ff2c2c;
    box-shadow: 5px 5px 0 #801515;
}

.btn-warning:active {
    box-shadow: 1px 1px 0 #801515;
}

.btn [class*="fa-"] {
    margin-right: 5px;
}

.btn-small {
    padding: 4px 12px;
    font-size: 0.8rem;
}

/* Controls section */
.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1.5rem 0;
    background-color: #eef2f7;
    padding: 1.2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.loader {
    display: none;
    color: var(--text-secondary);
    background-color: rgba(255, 255, 255, 0.8);
    padding: 0.6rem 1.2rem;
    border-radius: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    animation: pulsate 1.5s infinite;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

@keyframes pulsate {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

/* Result box styling */
.result-box {
    background-color: #fcfcfc;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 1rem;
    font-size: 0.95rem;
    line-height: 1.6;
    min-height: 150px; /* Thêm độ cao tối thiểu */
    max-height: 500px;
    overflow-y: auto;
    white-space: pre-wrap; /* Giữ nguyên định dạng xuống dòng và khoảng trắng */
    width: 100%;
    transition: max-height 0.3s ease-in-out;
}

/* Entry rows styling */
.entry-row {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    gap: 0.8rem;
    padding: 1.2rem;
    background-color: #ffffff;
    border-radius: 0;
    flex-wrap: wrap;
    transition: var(--transition-default);
    border: 2px solid #000000;
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.8);
}

.entry-row:hover {
    background-color: #f1f1f1;
    transform: translateX(3px);
    box-shadow: 5px 5px 0 rgba(0, 0, 0, 1);
}

.pronoun-entry {
    padding: 1.2rem;
    background-color: #f5f7ff;
    flex-wrap: wrap;
}

.pronoun-entry > span {
    margin: 0 0.3rem;
    white-space: nowrap;
}

.pronoun-value, .self-pronoun-value {
    flex: 1;
    min-width: 150px;
}

.relationship-description {
    flex: 1;
}

.expression-value {
    flex: 1;
}

/* Remove button styling */
.remove-btn {
    background-color: #000000;
    color: #ffffff;
    border: 2px solid #000000;
    border-radius: 0;
    padding: 0.5rem;
    cursor: pointer;
    transition: var(--transition-default);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 35px;
    height: 35px;
}

.remove-btn:hover {
    background-color: #ffffff;
    color: #000000;
    transform: scale(1.05);
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.8);
}

/* API Provider section styling */
.api-provider-section {
    background-color: #f1f8e9;
    border-radius: 8px;
    padding: 1.2rem;
    margin-top: 1.5rem;
    margin-bottom: 2rem;
    border-left: 4px solid var(--success-color);
}

.api-provider-intro {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.api-provider-container {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

/* CSS cho phần radio button API provider */
.radio-container {
    display: flex;
    align-items: flex-start;
    margin-bottom: 8px;
    cursor: pointer;
    position: relative;
    padding-left: 25px;
}

.radio-container input[type="radio"] {
    position: absolute;
    left: 0;
    top: 3px;
    margin: 0;
    cursor: pointer;
}

.radio-container label {
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-primary);
    padding-left: 2px;
}

.api-limit-notice {
    margin-top: 0.5rem;
    color: #e57373;
    font-size: 0.85rem;
}

/* API info styling */
.api-info-section {
    margin: 1rem 0;
    padding: 10px 15px;
    background-color: #f0f4ff;
    border-radius: 6px;
    border-left: 4px solid #556cd6;
}

.api-info-text {
    color: #334155;
    font-size: 0.9rem;
    margin: 0;
    font-weight: 500;
    text-align: center;
}

/* Notice section styling */
.notice {
    background-color: #e8f5e9;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid #c8e6c9;
}

.notice-header {
    background-color: var(--success-color);
    color: white;
    padding: 0.8rem 1.2rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.notice-content {
    padding: 1.2rem;
}

.notice-content p {
    margin-bottom: 1rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

.notice-content p:last-child {
    margin-bottom: 0;
}

.notice-content a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-default);
}

.notice-content a:hover {
    text-decoration: underline;
    color: var(--primary-dark);
}

/* File upload styling */
.file-upload-container {
    margin-bottom: 1.5rem;
}

.file-upload-btn {
    display: inline-block;
    padding: 0.8rem 1.2rem;
    background-color: var(--info-color);
    color: white;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition-default);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    max-width: max-content;
}

.file-upload-btn:hover {
    background-color: #0d8aee;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

input[type="file"] {
    display: none;
}

/* Table styling */
.table-container {
    margin-bottom: 1.5rem;
    overflow-x: auto;
    background-color: white;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    width: 100%;
}

.text-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    table-layout: fixed;
}

.text-table th,
.text-table td {
    padding: 0.8rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
    word-wrap: break-word; /* Cho phép văn bản dài tự động xuống dòng */
}

.text-table th {
    background-color: #f3f6f9;
    color: var(--text-secondary);
    font-weight: 500;
    white-space: normal; /* Cho phép xuống dòng */
    word-wrap: break-word; /* Cho phép ngắt từ */
    word-break: break-word; /* Ngắt từ khi cần thiết */
    height: auto; /* Chiều cao tự động theo nội dung */
    min-height: 40px; /* Chiều cao tối thiểu */
    vertical-align: middle; /* Căn giữa theo chiều dọc */
    line-height: 1.2; /* Giảm line-height để tiết kiệm không gian */
    padding: 6px 4px; /* Giảm padding trên dưới, giữ nguyên padding hai bên */
}

.text-table tr:hover {
    background-color: #f8f9fc;
}

.text-table select,
.text-table input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.9rem;
}

/* Thiết lập độ rộng cột cho bảng, bao gồm cột "Đang nói với ai" */
.text-table th:first-child,
.text-table td:first-child {
    width: 50px;
    text-align: center;
}

.text-table th:nth-child(2),
.text-table td:nth-child(2),
.text-table th:nth-child(3),
.text-table td:nth-child(3),
.text-table th:nth-child(4),
.text-table td:nth-child(4) {
    width: 150px;
}

.text-table th:last-child,
.text-table td:last-child {
    width: auto;
    min-width: 300px;
}

/* Select của các cột nhân vật, đang nói với ai, biểu hiện */
.character-select, .talking-to-select, .expression-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--input-bg);
    font-size: 14px;
    color: var(--text-color);
    transition: all 0.3s ease;
}

.character-select:focus, .talking-to-select:focus, .expression-select:focus {
    border-color: var(--accent-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(88, 101, 242, 0.2);
}

.character-select option, .talking-to-select option, .expression-select option {
    background-color: var(--input-bg);
    color: var(--text-color);
}

/* Result actions */
.result-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    justify-content: flex-end;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Translation progress styling - Đen trắng, góc vuông */
.translation-progress {
    margin: 15px 0;
    padding: 10px;
    background-color: #ffffff;
    border-radius: 0;
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 2px solid #000000;
}

.progress-step {
    flex: 1;
    text-align: center;
    padding: 10px;
    position: relative;
    font-weight: 700;
    color: #666;
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.progress-step:not(:last-child):after {
    content: "";
    position: absolute;
    top: 50%;
    right: 0;
    width: 20px;
    height: 2px;
    background-color: #000000;
    transform: translateY(-50%);
}

.progress-step.step-active {
    color: #000000;
    font-weight: 700;
    background-color: rgba(0, 0, 0, 0.1);
}

.progress-step.step-completed {
    color: #000000;
    background-color: #f0f0f0;
}

.progress-step.step-completed:before {
    content: "✓";
    margin-right: 5px;
}

/* Error message styling */
.error-message {
    background-color: #ffebee;
    color: #d32f2f;
    padding: 16px;
    border-radius: 5px;
    border-left: 4px solid #d32f2f;
    margin-bottom: 20px;
    font-weight: 500;
}

/* FAQ Section */
.faq-section {
    background-color: #ffffff;
    padding: 3rem 0;
    margin-top: 2rem;
    box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.8);
    border: 2px solid #000000;
}

.faq-section h2 {
    text-align: center;
    margin-bottom: 2.5rem;
    color: #000000;
    border-bottom: 2px solid #000000;
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

.faq-item {
    background-color: #f8f9fa;
    border-radius: 0;
    padding: 1.5rem;
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.8);
    transition: var(--transition-default);
    border: 2px solid #000000;
}

.faq-item:hover {
    transform: translateY(-5px);
    box-shadow: 6px 6px 0 rgba(0, 0, 0, 1);
}

.faq-item h3 {
    color: #000000;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
    border-bottom: 1px solid #cccccc;
    padding-bottom: 0.5rem;
}

.faq-item p {
    color: #333333;
    font-size: 0.95rem;
    line-height: 1.6;
}

.faq-item a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.faq-item a:hover {
    text-decoration: underline;
}

/* Footer Styles */
.site-footer {
    background-color: #000000;
    color: #ffffff;
    padding: 2rem 0;
    margin-top: 3rem;
    border-top: 2px solid #ffffff;
}

.footer-content {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 1.5rem;
}

.footer-column {
    min-width: 250px;
}

.footer-column h3 {
    color: #ffffff;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    position: relative;
    padding-bottom: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-column h3:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 2px;
    background-color: #ffffff;
}

.footer-column ul {
    list-style: none;
    padding: 0;
}

.footer-column ul li {
    margin-bottom: 0.5rem;
}

.footer-column ul li a {
    color: #cccccc;
    text-decoration: none;
    transition: var(--transition-default);
    display: inline-flex;
    align-items: center;
}

.footer-column ul li a:hover {
    color: #ffffff;
    transform: translateX(5px);
}

.copyright {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #eaeaea;
    text-align: left;
}

@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
    
    .footer-column h3:after {
        left: 0;
        transform: none;
    }
    
    .footer-column ul li a:hover {
        transform: translateX(5px);
    }
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .intro-content h2 {
        font-size: 2rem;
    }
    
    .feature-list {
        gap: 1rem;
    }
    
    .feature-item {
        width: 150px;
        padding: 1.2rem;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
        text-align: center;
    }
    
    .feature-list {
        justify-content: center;
    }
    
    .feature-item {
        width: 130px;
        padding: 1rem;
    }
    
    .faq-grid {
        grid-template-columns: 1fr;
    }
    
    .controls {
        flex-direction: column;
        gap: 1rem;
    }
    
    .translate-btn {
        width: 100%;
    }
    
    .settings-section h3 {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .pronoun-entry {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .pronoun-entry > span {
        margin: 0.5rem 0;
    }
    
    .pronoun-from, .pronoun-to, .pronoun-value, .self-pronoun-value {
        width: 100%;
    }
    
    .remove-btn {
        margin-top: 0.5rem;
        align-self: flex-end;
    }
    
    .settings-actions {
        justify-content: center;
    }
    
    /* Cải thiện hiển thị bảng trên thiết bị di động */
    .text-table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .text-table th,
    .text-table td {
        white-space: nowrap;
    }
    
    /* Chiều cao tối thiểu cho kết quả dịch */
    .result-box {
        min-height: 200px;
    }
}

@media (max-width: 576px) {
    .container, .main-container {
        width: 98% !important;
        max-width: 100% !important;
        margin: 0 auto !important;
        padding: 10px 5px !important;
    }
    
    .feature-item {
        width: 100% !important;
    }
    
    .settings-panel, .translation-panel {
        width: 100% !important;
        padding: 10px !important;
    }
    
    .table-container {
        overflow-x: auto !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .text-table {
        table-layout: fixed !important;
        width: 700px !important; /* Set minimum width for horizontal scroll */
    }
    
    .text-table th {
        white-space: normal !important;
        word-wrap: break-word !important;
        word-break: break-word !important;
        height: auto !important;
        min-height: 40px !important;
        vertical-align: middle !important;
        padding: 5px !important;
        font-size: 13px !important;
    }
    
    .text-table td {
        padding: 5px !important;
        font-size: 13px !important;
        word-break: break-word !important;
    }
    
    /* Cột Thứ tự - độ rộng cố định */
    .text-table th:first-child,
    .text-table td:first-child {
        width: 40px !important;
        min-width: 40px !important;
        max-width: 40px !important;
    }
    
    /* Cột Nhân vật - độ rộng cố định */
    .text-table th:nth-child(2),
    .text-table td:nth-child(2) {
        width: 90px !important;
        min-width: 90px !important;
        max-width: 90px !important;
    }
    
    /* Cột Đang nói với ai - độ rộng cố định */
    .text-table th:nth-child(3),
    .text-table td:nth-child(3) {
        width: 90px !important;
        min-width: 90px !important;
        max-width: 90px !important;
    }
    
    /* Cột Biểu hiện/dạng thoại - độ rộng cố định */
    .text-table th:nth-child(4),
    .text-table td:nth-child(4) {
        width: 110px !important;
        min-width: 110px !important;
        max-width: 110px !important;
    }
    
    /* Cột Văn bản gốc - tự động điều chỉnh */
    .text-table th:nth-child(5),
    .text-table td:nth-child(5) {
        width: auto !important;
        min-width: 150px !important;
    }
    
    /* Cải thiện các select box */
    select, button, input[type="text"] {
        font-size: 14px !important;
        padding: 4px !important;
        height: auto !important;
    }
    
    /* Cải thiện nút */
    .action-btn, .btn {
        padding: 8px 12px !important;
        font-size: 14px !important;
        margin: 5px 2px !important;
    }
    
    /* Cải thiện bố cục dọc */
    .faq-section, .feature-section {
        margin-top: 20px !important;
    }
    
    /* Cải thiện footer */
    .footer {
        padding: 10px 0 !important;
        margin-top: 20px !important;
    }
    
    /* Thêm style cho mobile */
    .mobile-view .text-table select {
        max-width: 100% !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    
    /* Cải thiện cách hiển thị popup */
    .content-popup {
        max-width: 90% !important;
    }
}

/* Điều chỉnh cho màn hình nhỏ hơn */
@media (max-width: 375px) {
    .container, .main-container {
        padding: 8px 4px !important;
    }
    
    .text-table {
        width: 650px !important;
    }
    
    .text-table th, .text-table td {
        font-size: 12px !important;
        padding: 4px !important;
    }
    
    /* Điều chỉnh độ rộng cột khi màn hình nhỏ hơn */
    .text-table th:nth-child(2),
    .text-table td:nth-child(2),
    .text-table th:nth-child(3),
    .text-table td:nth-child(3) {
        width: 80px !important;
        min-width: 80px !important;
        max-width: 80px !important;
    }
    
    .text-table th:nth-child(4),
    .text-table td:nth-child(4) {
        width: 100px !important;
        min-width: 100px !important;
        max-width: 100px !important;
    }
}

/* Điều chỉnh cho màn hình cực nhỏ */
@media (max-width: 320px) {
    .text-table {
        width: 600px !important;
    }
    
    .text-table th:nth-child(2),
    .text-table td:nth-child(2),
    .text-table th:nth-child(3),
    .text-table td:nth-child(3) {
        width: 70px !important;
        min-width: 70px !important;
        max-width: 70px !important;
    }
    
    .text-table th:nth-child(4),
    .text-table td:nth-child(4) {
        width: 90px !important;
        min-width: 90px !important;
        max-width: 90px !important;
    }
}

/* Main Navigation Styles */
.main-nav {
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid #333;
    background-color: #000000;
}

.main-nav::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: repeating-linear-gradient(90deg, #333, #333 5px, transparent 5px, transparent 10px);
}

.nav-container {
    display: flex;
    justify-content: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
}

.main-nav .logo {
    display: flex;
    align-items: center;
}

.main-nav .logo a {
    display: flex;
    align-items: center;
    color: var(--text-white);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.5rem;
    gap: 0.5rem;
}

.main-nav .logo i {
    font-size: 1.8rem;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-links a {
    color: #ffffff;
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.nav-links a.active::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #ffffff;
}

.nav-links a:hover {
    color: rgba(255, 255, 255, 0.8);
}

/* Step Guide Enhancements for Tutorial Page */
.step-guide {
    background-color: white;
    border-radius: 10px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    border-left: 5px solid var(--primary-color);
}

.step-guide:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.15);
}

.step-guide h2, .step-guide h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #eee;
}

.step-guide h2 {
    font-size: 1.8rem;
}

.step-guide h3 {
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.step-guide p {
    margin-bottom: 1.2rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.step-guide ol, .step-guide ul {
    padding-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.step-guide li {
    margin-bottom: 0.8rem;
}

.step-guide pre {
    background-color: #f5f7fa;
    border-radius: 6px;
    padding: 1rem;
    overflow-x: auto;
    margin: 1rem 0;
    border: 1px solid #e0e4e8;
}

.example, .note, .tip, .warning {
    padding: 1.2rem;
    margin: 1.5rem 0;
    border-radius: 6px;
    position: relative;
    padding-left: 3rem;
}

.example::before, .note::before, .tip::before, .warning::before {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    left: 1rem;
    top: 1.2rem;
    font-size: 1.2rem;
}

.example {
    background-color: #f0f7ff;
    border-left: 4px solid #2196f3;
}

.example::before {
    content: "\f121"; /* Code icon */
    color: #2196f3;
}

.note {
    background-color: #fff8e1;
    border-left: 4px solid #ffc107;
}

.note::before {
    content: "\f05a"; /* Info icon */
    color: #ffc107;
}

.tip {
    background-color: #e8f5e9;
    border-left: 4px solid #4caf50;
}

.tip::before {
    content: "\f0eb"; /* Lightbulb icon */
    color: #4caf50;
}

.warning {
    background-color: #ffebee;
    border-left: 4px solid #f44336;
}

.warning::before {
    content: "\f071"; /* Warning icon */
    color: #f44336;
}

/* Table of Contents for Tutorial Page */
.table-of-contents {
    background-color: #f8f9fa;
    border-radius: 10px;
    padding: 1.5rem 2rem;
    margin-bottom: 2.5rem;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    border: 1px solid #e0e4e8;
    position: relative;
}

.table-of-contents h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-light);
    padding-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.table-of-contents h2::before {
    content: "\f02e";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    color: var(--primary-color);
}

.table-of-contents ul {
    list-style-type: none;
    padding-left: 0.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 0.75rem 1.5rem;
}

.table-of-contents li {
    margin-bottom: 0.5rem;
    position: relative;
    padding-left: 1.5rem;
}

.table-of-contents li::before {
    content: "\f054";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    left: 0;
    color: var(--primary-light);
    font-size: 0.8rem;
}

.table-of-contents a {
    text-decoration: none;
    color: var(--primary-color);
    transition: all 0.3s ease;
    font-weight: 500;
}

.table-of-contents a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

/* Responsive Improvements */
@media (max-width: 768px) {
    .table-of-contents ul {
        grid-template-columns: 1fr;
    }
    
    .step-guide {
        padding: 1.5rem;
    }
    
    .step-guide h2 {
        font-size: 1.5rem;
    }
    
    .step-guide h3 {
        font-size: 1.2rem;
    }
    
    .main-nav {
        flex-direction: column;
        padding: 0.5rem 0;
    }
    
    .nav-links {
        margin-top: 0.5rem;
    }
}

/* Hero Section Improvements for Tutorial Page */
.hero {
    text-align: center;
    padding: 3rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 0 0 10px 10px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero p {
    font-size: 1.2rem;
    max-width: 800px;
    margin: 0 auto;
    opacity: 0.9;
}

/* Mobile navigation improvements */
@media (max-width: 600px) {
    .nav-links {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
    }
    
    .nav-links li {
        width: 100%;
    }
    
    .nav-links li a {
        display: block;
        padding: 0.75rem 1rem;
        text-align: center;
    }
}

/* Step Box - hướng dẫn từng bước */
.step-box {
    display: flex;
    margin-bottom: 1.5rem;
    background-color: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.step-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    font-weight: bold;
    font-size: 1.2rem;
    margin-right: 1rem;
    flex-shrink: 0;
}

.step-content {
    flex-grow: 1;
}

.step-content h4 {
    margin: 0 0 0.5rem 0;
    color: var(--primary-color);
    font-size: 1.1rem;
}

/* Pagination Navigation */
.pagination-nav {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
}

.btn-next {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: 30px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.btn-next:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0,0,0,0.15);
}

/* Tip Grid and Cards */
.tip-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.tip-card {
    background-color: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.tip-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.tip-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background-color: #f5f5f5;
    border-radius: 50%;
    margin-bottom: 1rem;
}

.tip-icon i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.tip-card h4 {
    margin: 0 0 0.75rem 0;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.tip-card p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Quick Navigation */
.quick-nav {
    background-color: #f8f9fa;
    border-radius: 10px;
    padding: 1.5rem;
    margin: 3rem 0 1rem;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

.quick-nav h3 {
    margin-top: 0;
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.btn-sm {
    background-color: white;
    color: var(--primary-color);
    border: 1px solid #e0e4e8;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-sm:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Tutorial Image */
.tutorial-img {
    max-width: 100%;
    border-radius: 8px;
    border: 1px solid #e0e4e8;
    margin: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Responsive Fixes */
@media (max-width: 768px) {
    .tip-grid {
        grid-template-columns: 1fr;
    }
    
    .quick-links {
        justify-content: center;
    }
    
    .step-box {
        flex-direction: column;
    }
    
    .step-number {
        margin-bottom: 0.5rem;
    }
}

/* Sửa lỗi icons trong các heading và elements */
.step-guide h2 i, 
.step-guide h3 i,
.table-of-contents h2 i,
.quick-nav h3 i,
.note::before,
.tip::before,
.warning::before,
.example::before {
    margin-right: 10px;
    min-width: 20px;
    text-align: center;
}

.step-guide h2, 
.step-guide h3 {
    display: flex;
    align-items: center;
}

.example, .note, .tip, .warning {
    position: relative;
    padding-left: 3rem;
}

.example::before, 
.note::before, 
.tip::before, 
.warning::before {
    position: absolute;
    left: 1rem;
    top: 1.2rem;
}

.quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

/* Điều chỉnh padding cho mobile */
@media (max-width: 768px) {
    .step-guide {
        padding: 1.5rem;
    }
    
    .step-box {
        flex-direction: column;
    }
    
    .step-number {
        margin-right: 0;
        margin-bottom: 0.8rem;
    }
}

/* Editable text cell styling */
.editable-text {
    cursor: pointer;
    position: relative;
    padding-right: 10px; /* Giảm padding vì nút sẽ hiển thị ở trên */
    padding-top: 25px; /* Thêm padding phía trên để có chỗ hiển thị nút */
}

.editable-text:hover {
    background-color: #f5f7ff;
}

.editable-text:hover::after {
    display: none; /* Ẩn biểu tượng sửa mặc định */
}

.editable-text:hover .table-row-actions {
    display: flex;
}

.inline-edit-textarea {
    width: 100%;
    min-height: 60px;
    padding: 8px;
    border: 2px solid #1a1a1a;
    border-radius: 0;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.2);
}

.inline-edit-textarea:focus {
    outline: none;
    border-color: #000000;
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.3);
}

/* Table controls */
.table-controls {
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.table-controls-bottom {
    margin-top: 1rem;
    margin-bottom: 2rem;
    justify-content: flex-end;
}

.table-controls-bottom .btn-add {
    font-size: 1rem;
    padding: 8px 16px;
}

/* Add rows styling */
.table-row-actions {
    position: absolute;
    top: 2px;
    right: 2px;
    display: none; /* Mặc định ẩn */
    flex-direction: row; /* Hiển thị các nút theo chiều ngang */
    gap: 3px; /* Khoảng cách giữa các nút */
    z-index: 10;
    padding: 3px;
    justify-content: flex-end;
    background-color: rgba(255, 255, 255, 0.98);
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    border: 1px solid #eee;
}

.editable-text:hover .table-row-actions {
    display: flex; /* Hiển thị khi hover */
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Đảm bảo responsive cho ô editable-text và nút */
@media (max-width: 768px) {
    .table-row-actions {
        opacity: 0;
        visibility: hidden;
        top: 1px;
        right: 1px;
        z-index: 100 !important; /* Đảm bảo z-index cao */
    }
    
    .action-btn {
        width: 24px; /* Làm nút to hơn trên thiết bị di động để dễ nhấn */
        height: 24px;
    }
    
    .action-btn i {
        font-size: 12px;
    }
    
    .editable-text {
        padding-top: 28px; /* Tăng padding trên điện thoại để có không gian cho các nút */
        position: relative !important; /* Đảm bảo position được áp dụng */
    }
    
    /* Vô hiệu hóa hiển thị khi hover trên thiết bị di động */
    .editable-text:hover .table-row-actions {
        display: none !important;
    }
    
    /* Hiển thị nút hành động khi có class 'active' được thêm bởi JavaScript */
    .editable-text.active .table-row-actions {
        opacity: 1 !important;
        visibility: visible !important;
        display: flex !important;
        animation: fadeIn 0.2s ease;
        z-index: 100 !important;
    }
    
    /* Hiệu ứng khi nhấn giữ */
    .editable-text.active {
        background-color: #f0f8ff !important; /* Nền màu nhẹ khi active */
        box-shadow: inset 0 0 0 1px #007bff !important; /* Viền màu xanh */
    }
    
    /* Hiển thị gợi ý */
    .text-table::before {
        content: "Nhấn giữ vào dòng văn bản để hiện tùy chọn";
        display: block !important;
        text-align: center !important;
        padding: 8px 10px !important;
        background-color: #f5f7fa !important;
        color: #505a66 !important;
        font-size: 0.9rem !important;
        margin: 0 0 10px 0 !important;
        border-radius: 4px !important;
        border-left: 3px solid #007bff !important;
        box-shadow: 0 1px 3px rgba(0,0,0,0.08) !important;
    }
    
    /* Đảm bảo thông báo không bị che */
    .toastify {
        top: auto !important;
        bottom: 20px !important;
        left: 10px !important;
        right: 10px !important;
        width: calc(100% - 20px) !important;
        max-width: none !important;
        transform: none !important;
        margin: 0 !important;
        padding: 12px 15px !important;
        font-size: 14px !important;
        text-align: center !important;
        z-index: 1000 !important;
    }
    
    /* Cải thiện khoảng trống cho giao diện điện thoại */
    .app-container {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
        padding-bottom: 10px !important;
    }
    
    /* Điều chỉnh thanh title và điều khiển */
    .section-title {
        margin-top: 15px !important;
        margin-bottom: 10px !important;
    }
}

.action-btn {
    background: #f5f5f5;
    border: 1px solid #ddd;
    cursor: pointer;
    padding: 2px;
    opacity: 0.9;
    transition: all 0.2s ease;
    color: #444;
    width: 22px;
    height: 22px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 3px;
    box-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.action-btn:hover {
    opacity: 1;
    transform: scale(1.1);
    background-color: white;
    border-color: #aaa;
    box-shadow: 2px 2px 3px rgba(0,0,0,0.15);
}

.action-btn i {
    color: #666;
    font-size: 12px;
    opacity: 0.9;
}

.action-btn:hover i {
    color: #000;
}

.copy-from-above-btn {
    background-color: #f0fff8;
}

.copy-from-above-btn:hover {
    background-color: #e8f9f5;
}

.copy-from-above-btn:hover i {
    color: #00b894;
}

.swap-dialogue-btn {
    background-color: #fff8f0;
}

.swap-dialogue-btn:hover {
    background-color: #ffeee3;
}

.swap-dialogue-btn:hover i {
    color: #ff7675;
}

/* Container cho select với nút copy */
.select-with-copy {
    display: flex;
    align-items: center;
    gap: 5px;
}

.select-with-copy select {
    flex: 1;
}

/* Nút copy mini bên cạnh select */
.mini-copy-btn {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 3px;
    padding: 3px 6px;
    font-size: 0.8rem;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mini-copy-btn:hover {
    background-color: #e8f9f5;
    border-color: #00b894;
    color: #00b894;
    transform: scale(1.05);
}

.mini-copy-btn i {
    font-size: 0.75rem;
}

.move-up-btn {
    background-color: #f0f8ff;
}

.move-up-btn:hover {
    background-color: #e3f2fd;
}

.move-up-btn:hover i {
    color: #2196f3;
}

.move-down-btn {
    background-color: #f0f8ff;
}

.move-down-btn:hover {
    background-color: #e3f2fd;
}

.move-down-btn:hover i {
    color: #2196f3;
}

.edit-row-btn {
    background-color: #fafff0;
}

.edit-row-btn:hover {
    background-color: #f0ffe3;
}

.edit-row-btn:hover i {
    color: #4caf50;
}

.delete-row-btn {
    background-color: #fff0f0;
}

.delete-row-btn:hover {
    background-color: #ffebee;
}

.delete-row-btn:hover i {
    color: #e74c3c;
}

/* Row hover effect */
.text-table tr:hover {
    background-color: #f0f5ff;
}

/* Toast notification overrides */
.toastify {
    padding: 12px 20px;
    border-radius: 4px;
    box-shadow: none;
    font-family: inherit;
    font-size: 0.95rem;
}

.toastify .toast-close {
    color: rgba(255, 255, 255, 0.8);
    opacity: 0.8;
}

.toastify .toast-close:hover {
    color: #fff;
    opacity: 1;
}

/* Hiệu ứng khi focus vào ô đang edit */
.editable-text.being-edited {
    background-color: #f8f8f8;
    outline: 2px solid #4caf50;
}

/* Phần Model AI */
.model-section {
    background-color: #f1f8e9;
    border-radius: 8px;
    padding: 1.2rem;
    margin-top: 1.5rem;
    margin-bottom: 2rem;
    border-left: 4px solid var(--success-color);
}

.model-intro {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.model-container {
    position: relative;
    margin-bottom: 0.8rem;
}

.model-notice {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    font-style: italic;
}

/* Xóa styles cho ai-model dropdown - không cần thiết nữa
#ai-model {
    width: 100%;
    padding: 0.7rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 0.95rem;
    color: var(--text-primary);
    background-color: #fff;
}
*/

/* Kết thúc CSS */
.api-key-container {
    position: relative;
    margin-bottom: 0.8rem;
    width: 100%;
}

.api-key-container input[type="password"],
.api-key-container input[type="text"] {
    width: 100%;
    padding-right: 40px;
}

.toggle-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 1.2rem;
    padding: 6px;
    transition: var(--transition-default);
    z-index: 5;
    height: 36px;
    width: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-btn:hover {
    color: var(--primary-color);
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 50%;
}

/* API Key Section Styling */
.api-key-section {
    background-color: rgba(241, 248, 233, 0.8);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--success-color);
}

.api-key-intro {
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.api-key-intro a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.api-key-intro a:hover {
    text-decoration: underline;
    color: var(--primary-dark);
}

.api-key-notice {
    margin-top: 0.8rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* Kết thúc CSS */

/* Thêm class cho container chính và bảng rộng */
.main-container {
    max-width: 1600px; /* Tăng kích thước tối đa của container chính */
    width: 95%;
    margin: 0 auto;
}

.wide-table {
    min-width: 100%;
    overflow-x: auto;
}

/* Thêm style cho giao diện mobile đặc biệt */
.mobile-view .text-table {
    border-collapse: collapse;
}

.mobile-view .text-table td,
.mobile-view .text-table th {
    border: 1px solid #ddd;
}

/* Style cho nút mở rộng kết quả */
.toggle-result-btn {
    display: block;
    width: 100%;
    padding: 8px;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    margin-top: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.2s;
}

.toggle-result-btn:hover,
.toggle-result-btn:active {
    background-color: #e5e5e5;
}

/* Style cho hint cuộn ngang */
.scroll-hint {
    text-align: center;
    color: #666;
    padding: 5px;
    font-size: 12px;
    background: #f9f9f9;
    margin-bottom: 5px;
    border-radius: 4px;
    border: 1px dashed #ccc;
    opacity: 1;
    transition: opacity 0.5s ease;
}

/* Điều chỉnh cho điện thoại cực nhỏ */
@media (max-width: 320px) {
    .text-table {
        min-width: 320px; /* Giảm thêm cho điện thoại cực nhỏ */
    }
    
    .text-table th:first-child,
    .text-table td:first-child {
        width: 20px;
        min-width: 20px;
        max-width: 20px;
    }
    
    .text-table th:nth-child(2),
    .text-table td:nth-child(2),
    .text-table th:nth-child(3),
    .text-table td:nth-child(3),
    .text-table th:nth-child(4),
    .text-table td:nth-child(4) {
        width: 60px;
        min-width: 60px;
        max-width: 60px;
    }
    
    .text-table th:last-child,
    .text-table td:last-child {
        min-width: 100px;
    }
    
    .character-select, .talking-to-select, .expression-select {
        font-size: 10px;
        padding: 2px 4px;
        height: 28px;
    }
}

/* Đồng bộ navigation trên tất cả các trang */
.nav-container {
    display: flex;
    justify-content: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
}

.nav-links {
    display: flex;
    padding: 0;
    margin: 0;
    list-style: none;
}

.nav-links li {
    margin: 0;
}

.nav-links li a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 15px;
    color: #fff;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    font-size: 1rem;
}

.nav-links li a.active::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #fff;
}

/* Menu di động */
@media (max-width: 768px) {
    .nav-container {
        justify-content: center;
        padding: 0;
    }
    
    .nav-links {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
        padding: 5px 0;
        justify-content: center;
    }
    
    .nav-links::-webkit-scrollbar {
        display: none; /* Chrome, Safari */
    }
    
    .nav-links li a {
        padding: 10px 12px;
        font-size: 0.9rem;
        white-space: nowrap;
    }
}

/* Nút chuyển đổi sang Google AI Studio */
#switch-to-google-btn {
    display: block;
    width: 100%;
    margin-top: 15px;
    padding: 10px 15px;
    background-color: #4285f4;
    color: white;
    border: none;
    border-radius: 5px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

#switch-to-google-btn:hover {
    background-color: #3367d6;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

#switch-to-google-btn i {
    margin-right: 8px;
}

#switch-to-google-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
}

/* Nhấn mạnh cho phần Google AI Studio khi được làm nổi bật */
label[for="google-radio"].highlight {
    background-color: rgba(66, 133, 244, 0.2);
    border-radius: 4px;
    padding: 5px;
    transition: background-color 0.5s ease;
}

/* Styles cho trang phân tích chương truyện - Phiên bản cải tiến */
.file-info {
    margin-top: 15px;
    padding: 12px 15px;
    background-color: #f8f9fc;
    border-radius: 8px;
    font-size: 0.95rem;
    border-left: 4px solid #1a1a1a;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.file-info:hover {
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.file-info-item {
    margin-bottom: 6px;
    padding: 3px 0;
    display: flex;
    align-items: center;
}

.file-info-item strong {
    margin-right: 6px;
    color: #000;
}

.error-message {
    color: #dc3545;
    font-weight: 500;
    padding: 10px;
    background-color: rgba(220, 53, 69, 0.1);
    border-radius: 4px;
    margin-top: 10px;
}

/* Preview section enhancements */
.images-preview {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 15px;
    min-height: 250px;
    border-radius: 8px;
    border: 2px solid #eee;
    background-color: #f9f9f9;
    padding: 15px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.images-preview img {
    border-radius: 4px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
}

.images-preview img:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 15px rgba(0,0,0,0.2);
}

.preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 250px;
    width: 100%;
    color: #888;
    text-align: center;
    padding: 20px;
}

.preview-placeholder i {
    font-size: 3rem;
    margin-bottom: 15px;
    color: #ccc;
}

.preview-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding: 10px 15px;
    background-color: #f0f4f8;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.preview-buttons {
    display: flex;
    gap: 12px;
}

#image-count-display {
    font-size: 0.95rem;
    color: #333;
    font-weight: 500;
    background: rgba(0,0,0,0.05);
    padding: 5px 10px;
    border-radius: 20px;
}

/* Analysis Results improvements */
.analysis-results {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
    margin-top: 20px;
}

.analysis-card {
    background-color: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e4e8;
    transition: all 0.3s ease;
}

.analysis-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.analysis-card-header {
    background-color: #1a1a1a;
    color: white;
    padding: 14px 15px;
    font-weight: 600;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 3px solid #000;
}

.analysis-card-header i {
    font-size: 1.2rem;
}

.analysis-card-body {
    padding: 18px;
}

/* Markdown styles for result boxes */
.analysis-card .result-box {
    background-color: #fafbfc;
    border: 1px solid #e9ecef;
    padding: 18px;
    border-radius: 6px;
    font-size: 0.95rem;
    margin-bottom: 12px;
    min-height: 150px;
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    line-height: 1.6;
    color: #333;
    transition: all 0.3s ease;
}

.analysis-card .result-box:hover {
    border-color: #ccc;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.05);
}

/* Markdown styles */
.result-box h1, .result-box h2, .result-box h3, 
.result-box h4, .result-box h5, .result-box h6 {
    margin-top: 1em;
    margin-bottom: 0.5em;
    font-weight: 600;
    line-height: 1.3;
    color: #000;
}

.result-box h1 { font-size: 1.6rem; border-bottom: 1px solid #eee; padding-bottom: 0.3em; }
.result-box h2 { font-size: 1.4rem; border-bottom: 1px solid #eee; padding-bottom: 0.3em; }
.result-box h3 { font-size: 1.2rem; }
.result-box h4 { font-size: 1.1rem; }
.result-box h5 { font-size: 1rem; }
.result-box h6 { font-size: 0.9rem; }

.result-box p {
    margin-bottom: 1em;
}

.result-box ul, .result-box ol {
    margin-bottom: 1em;
    padding-left: 2em;
}

.result-box li {
    margin-bottom: 0.3em;
}

.result-box a {
    color: #0366d6;
    text-decoration: none;
}

.result-box a:hover {
    text-decoration: underline;
}

.result-box code {
    background-color: rgba(27, 31, 35, 0.05);
    border-radius: 3px;
    font-family: monospace;
    padding: 0.2em 0.4em;
    font-size: 0.9em;
}

.result-box pre {
    background-color: #f6f8fa;
    border-radius: 3px;
    padding: 16px;
    overflow: auto;
    margin-bottom: 1em;
}

.result-box blockquote {
    border-left: 4px solid #dfe2e5;
    color: #6a737d;
    padding: 0 1em;
    margin: 0 0 1em 0;
}

.result-box table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 1em;
}

.result-box table th, .result-box table td {
    border: 1px solid #dfe2e5;
    padding: 6px 13px;
}

.result-box table th {
    background-color: #f6f8fa;
    font-weight: 600;
}

.result-box table tr:nth-child(2n) {
    background-color: #f6f8fa;
}

/* Enhanced button styles */
.btn:disabled, .btn[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Progress steps enhancements */
.translation-progress {
    margin: 20px 0 25px 0;
    display: flex;
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    overflow: hidden;
}

.progress-step {
    flex: 1;
    padding: 12px 8px;
    text-align: center;
    font-weight: 500;
    font-size: 0.9rem;
    position: relative;
    transition: all 0.3s ease;
}

.progress-step:not(:last-child):after {
    content: '';
    position: absolute;
    top: 50%;
    right: 0;
    width: 20px;
    height: 2px;
    background-color: #ddd;
    transform: translateY(-50%);
    z-index: 1;
}

.progress-step span {
    position: relative;
    z-index: 2;
}

.progress-step.step-active {
    background-color: rgba(0, 0, 0, 0.1);
    color: #000;
    font-weight: 700;
    border-radius: 6px;
}

.progress-step.step-completed {
    color: #28a745;
    background-color: rgba(40, 167, 69, 0.1);
}

.progress-step.step-completed:before {
    content: "✓";
    margin-right: 5px;
    font-weight: bold;
}

/* Loading indicator enhancement */
.loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 16px;
    background-color: #1a1a1a;
    color: white;
    border-radius: 30px;
    font-weight: 500;
    font-size: 0.9rem;
    animation: pulse 1.5s infinite ease-in-out;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

@keyframes pulse {
    0% { opacity: 0.7; transform: scale(0.98); }
    50% { opacity: 1; transform: scale(1); }
    100% { opacity: 0.7; transform: scale(0.98); }
}

.loading-indicator i {
    color: #fff;
    font-size: 1.1rem;
}

/* Progress container enhancement */
.progress-container {
    margin: 15px 0;
    padding: 16px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.progress-bar {
    height: 10px;
    background-color: #e9ecef;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, #1a1a1a, #444);
    border-radius: 5px;
    transition: width 0.3s ease;
}

.progress-status {
    font-size: 0.9rem;
    color: #666;
    text-align: center;
}

/* Responsive adjustments */
@media (min-width: 992px) {
    .analysis-results {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .analysis-card-header {
        font-size: 0.95rem;
        padding: 10px 12px;
    }
    
    .analysis-card .result-box {
        padding: 12px;
        font-size: 0.9rem;
        min-height: 120px;
        max-height: 250px;
    }
    
    .preview-controls {
        flex-direction: column;
        gap: 8px;
        padding: 8px;
    }
    
    .progress-step {
        padding: 8px 5px;
        font-size: 0.8rem;
    }
    
    .progress-step span {
        display: block;
    }
}