 * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    --primary-color: #4361ee;
    --secondary-color: #3a0ca3;
    --accent-color: #4895ef;
    --success-color: #2ec4b6;
    --warning-color: #ff9f1c;
    --error-color: #e71d36;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --gray-color: #6c757d;
    --border-color: #dee2e6;
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
--border-radius: 12px;
}

body {
    background: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    padding: 10px; /* Giảm padding cho mobile */
    font-size: 16px; /* Kích thước chữ cơ bản cho mobile */
}

/* New Writing Practice Section */
        .writing-section {
            background-color: var(--writing-section-bg);
            border-radius: var(--border-radius);
            padding: 25px;
            margin-top: 35px;
            box-shadow: var(--card-shadow);
            border: 1px solid #eaeaea;
            transition: all 0.3s ease;
        }
        
        .writing-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            cursor: pointer;
            padding-bottom: 15px;
            margin-bottom: 20px;
            border-bottom: 2px solid var(--accent-color);
        }
        
        .writing-title {
            font-size: 1.5rem;
            font-weight: 700;
            color: var(--primary-color);
            display: flex;
            align-items: center;
            gap: 12px;
        }
        
        .writing-content {
            display: none;
            padding-top: 20px;
        }
        
        .writing-container {
            display: flex;
            flex-direction: column;
            gap: 20px;
        }
        
        .writing-practice-card {
            background: white;
            border-radius: var(--border-radius);
            padding: 25px;
            box-shadow: var(--card-shadow);
            border: 1px solid var(--border-color);
            margin-bottom: 20px;
        }
        
        .writing-prompt {
            font-size: 1.2rem;
            margin-bottom: 25px;
            text-align: center;
        }
        
        .highlight-word {
            background-color: #fffacd;
            padding: 3px 8px;
            border-radius: 5px;
            font-weight: bold;
            color: var(--primary-color);
        }
        
        .writing-input {
            width: 100%;
            min-height: 150px;
            padding: 15px;
            border-radius: var(--border-radius);
            border: 1px solid var(--border-color);
            font-size: 1.1rem;
            resize: vertical;
            transition: border-color 0.3s;
        }
        
        .writing-input:focus {
            outline: none;
            border-color: var(--accent-color);
            box-shadow: 0 0 0 4px rgba(74, 105, 189, 0.2);
        }
        
        .key-hint {
            font-size: 0.9rem;
            color: var(--text-secondary);
            margin-top: 5px;
            text-align: right;
        }
        
        .writing-buttons {
            display: flex;
            gap: 15px;
            flex-wrap: wrap;
            margin-top: 15px;
        }
        
        .writing-btn {
            flex: 1;
            min-width: 150px;
            padding: 12px 20px;
            border-radius: 8px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            border: none;
            font-size: 1.05rem;
        }
        
        .writing-btn.new-word {
            background: linear-gradient(to right, var(--accent-color), #6c8af0);
            color: white;
        }
        
        .writing-btn.new-word:hover {
            background: linear-gradient(to right, #3a5bbd, #5b79e0);
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(74, 105, 189, 0.3);
        }
        
        .writing-btn.reset {
            background: #f0f2f5;
            border: 1px solid #ddd;
            color: var(--text-primary);
        }
        
        .writing-btn.reset:hover {
            background: #e4e7eb;
            border-color: #ccc;
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        }
        
        .writing-btn.submit {
            background: linear-gradient(to right, var(--success-color), #219653);
            color: white;
        }
        
        .writing-btn.submit:hover {
            background: linear-gradient(to right, #219653, #1e8449);
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(39, 174, 96, 0.3);
        }
        
        .ai-feedback {
            background: white;
            border-radius: var(--border-radius);
            padding: 25px;
            margin-top: 25px;
            box-shadow: var(--card-shadow);
            border: 1px solid #eaeaea;
            display: none;
        }
        
        .feedback-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            padding-bottom: 15px;
            border-bottom: 1px solid var(--border-color);
        }
        
        .feedback-title {
            font-size: 1.5rem;
            font-weight: 700;
            color: var(--primary-color);
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        .feedback-content {
            padding: 15px;
            background: rgba(74, 105, 189, 0.05);
            border-radius: 8px;
            border-left: 3px solid var(--accent-color);
            line-height: 1.7;
            font-size: 1.1rem;
        }
        
        .feedback-content h3, .feedback-content h4 {
            color: var(--primary-color);
            margin-top: 15px;
            margin-bottom: 10px;
        }
        
        .feedback-content ul {
            padding-left: 25px;
            margin-bottom: 15px;
        }
        
        .feedback-content li {
            margin-bottom: 8px;
        }
        
        .feedback-content .correct {
            color: var(--success-color);
            font-weight: 600;
        }
        
        .feedback-content .suggestion {
            background-color: #e8f5e9;
            padding: 15px;
            border-radius: 8px;
            margin-top: 15px;
            border-left: 3px solid var(--success-color);
        }
        
        .loading {
            text-align: center;
            padding: 30px;
            display: none;
        }
        
        .loading-spinner {
            border: 5px solid rgba(74, 105, 189, 0.2);
            border-radius: 50%;
            border-top: 5px solid var(--accent-color);
            width: 50px;
            height: 50px;
            animation: spin 1s linear infinite;
            margin: 0 auto 20px;
        }
        
        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }
      

  .container {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    padding: 15px; /* Giảm padding cho mobile */
}

header {
    background: linear-gradient(to right, #3498db, #2c3e50);
    color: white;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 20px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Cho phép wrap trên mobile */
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem; /* Giảm kích thước chữ cho mobile */
    font-weight: 700;
}

.logo i {
    font-size: 1.8rem;
}

.nav-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap; /* Cho phép wrap trên mobile */
    justify-content: center;
}

.nav-links a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    padding: 0.5rem 0.8rem;
    border-radius: 25px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem; /* Giảm kích thước chữ cho mobile */
}

.nav-links a:hover,
.nav-links a.active {
    color: white;
    background: rgba(255, 255, 255, 0.15);
}

.subtitle {
    font-size: 0.95rem; /* Giảm kích thước chữ cho mobile */
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}


        .container-main {
            max-width: 1200px;
            margin: 0 auto;
            padding: 0 1.5rem;
        }

        .vocab-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
            gap: 30px;
            margin-top: 2rem;
        }

        .vocab-card {
            background: white;
            border-radius: var(--border-radius);
            box-shadow: var(--card-shadow);
            overflow: hidden;
            transition: all 0.3s ease;
            border: 1px solid var(--border-color);
            display: flex;
            flex-direction: column;
            height: 100%;
            position: relative;
            background: linear-gradient(to bottom right, white, #f8f9ff);
        }

        .vocab-card.duplicate {
            border: 2px solid var(--duplicate-color);
            box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.2);
        }

        .vocab-card:hover {
            transform: translateY(-8px);
            box-shadow: var(--card-hover-shadow);
        }

        .vocab-header {
            padding: 20px;
            background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
            color: white;
            border-bottom: 1px solid rgba(255, 255, 255, 0.2);
            position: relative;
        }

        .vocab-header::after {
            content: "";
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            height: 3px;
            background: var(--accent-color);
        }

        .vocab-word {
            font-size: 1.8rem;
            font-weight: 700;
            margin: 0 0 5px 0;
            color: white;
        }

        .vocab-phonetic {
            color: rgba(255, 255, 255, 0.85);
            font-style: italic;
            margin: 0 0 12px 0;
            font-size: 1.2rem;
        }

        .vocab-pos {
            display: inline-block;
            background-color: var(--accent-color);
            color: white;
            padding: 5px 16px;
            border-radius: 20px;
            font-size: 1rem;
            font-weight: 500;
        }

        .vocab-body {
            padding: 25px;
            flex-grow: 1;
        }

        .vocab-meaning {
            margin: 0 0 20px 0;
            line-height: 1.7;
            font-size: 1.15rem;
            border-left: 3px solid var(--accent-color);
            padding-left: 15px;
        }

        .vocab-example, .vocab-translation {
            margin: 15px 0;
            padding: 15px;
            background: rgba(74, 105, 189, 0.05);
            border-radius: 8px;
            border-left: 3px solid var(--accent-color);
        }

        .vocab-example strong, .vocab-translation strong {
            display: block;
            margin-bottom: 8px;
            color: var(--primary-color);
        }

        .vocab-footer {
            padding: 18px 25px;
            border-top: 1px solid var(--border-color);
            display: flex;
            justify-content: space-between;
            background-color: rgba(74, 105, 189, 0.05);
            font-size: 1rem;
        }

        .vocab-footer div {
            flex: 1;
        }

        .vocab-footer strong {
            display: block;
            margin-bottom: 5px;
            color: var(--primary-color);
        }

        .btn-action {
            padding: 10px 18px;
            border-radius: 8px;
            font-size: 1.05rem;
            display: inline-flex;
            align-items: center;
            gap: 8px;
            cursor: pointer;
            transition: all 0.2s ease;
            border: none;
            background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
            color: white;
            text-decoration: none;
            font-weight: 600;
        }

        .btn-action:hover {
            background: linear-gradient(to right, #0a1e4f, #1a317d);
            color: white;
            text-decoration: none;
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(12, 36, 97, 0.2);
        }

        .btn-action.btn-danger {
            background: linear-gradient(to right, #e74c3c, #c0392b);
            color: white;
        }

        .btn-action.btn-danger:hover {
            background: linear-gradient(to right, #c0392b, #a23526);
            box-shadow: 0 4px 8px rgba(231, 76, 60, 0.2);
        }

        .btn-action.btn-warning {
            background: linear-gradient(to right, #f39c12, #e67e22);
            color: white;
        }

        .btn-action.btn-warning:hover {
            background: linear-gradient(to right, #e67e22, #d35400);
            box-shadow: 0 4px 8px rgba(243, 156, 18, 0.2);
        }

        .notification {
            position: fixed;
            top: 24px;
            right: 24px;
            padding: 18px 26px;
            background: white;
            border-radius: 12px;
            box-shadow: 0 12px 20px rgba(0, 0, 0, 0.15);
            display: flex;
            align-items: center;
            gap: 14px;
            z-index: 1000;
            animation: notificationSlideIn 0.3s ease;
            border-left: 4px solid var(--success-color);
        }

        .notification.error {
            border-left-color: var(--error-color);
        }

        .notification.warning {
            border-left-color: var(--warning-color);
        }

        .progress-container {
            margin: 25px 0;
            background-color: #f0f0f0;
            border-radius: 8px;
            height: 22px;
            overflow: hidden;
            border: 1px solid #ddd;
        }

        .progress-bar {
            height: 100%;
            background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
            width: 0%;
            transition: width 0.3s ease;
        }

        .stats-container {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
            gap: 25px;
            margin-bottom: 35px;
        }

        .stat-box {
            background: white;
            border-radius: var(--border-radius);
            padding: 25px;
            box-shadow: var(--card-shadow);
            text-align: center;
            position: relative;
            overflow: hidden;
            border: 1px solid #eaeaea;
            transition: all 0.3s ease;
        }

        .stat-box:hover {
            transform: translateY(-5px);
            box-shadow: 0 12px 20px rgba(0,0,0,0.1);
        }

        .stat-box::before {
            content: "";
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 5px;
            background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
        }

        .stat-value {
            font-size: 2rem;
            font-weight: bold;
            color: var(--primary-color);
            margin: 15px 0;
        }

        .stat-label {
            font-size: 1.1rem;
            color: var(--text-secondary);
            font-weight: 500;
        }

        .error-words {
            margin-top: 35px;
            background-color: #fff6f6;
            border-radius: var(--border-radius);
            padding: 25px;
            border: 1px solid #ffebee;
            position: relative;
            box-shadow: var(--card-shadow);
        }

        .error-words::before {
            content: "";
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 5px;
            background: linear-gradient(to right, var(--error-color), #ff9e9e);
            border-radius: var(--border-radius) var(--border-radius) 0 0;
        }

        .export-options {
            background: white;
            border-radius: var(--border-radius);
            padding: 30px;
            box-shadow: var(--card-shadow);
            margin-top: 35px;
            border: 1px solid #eaeaea;
        }

        .checkbox-group {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
            gap: 18px;
            margin-top: 25px;
        }

        .checkbox-item {
            display: flex;
            align-items: center;
            background: rgba(74, 105, 189, 0.05);
            padding: 12px 18px;
            border-radius: 8px;
            transition: all 0.2s ease;
        }

        .checkbox-item:hover {
            background: rgba(74, 105, 189, 0.1);
            transform: translateY(-2px);
        }

        .checkbox-item input {
            margin-right: 12px;
            cursor: pointer;
        }
        
        .checkbox-item label {
            cursor: pointer;
            font-weight: 500;
            font-size: 1.05rem;
        }
        
        .toggle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 10px 20px; /* giảm padding cho gọn */
    background-color: #dde0f2; /* nền mịn nhẹ */
    border-radius: 10px; /* bo góc nhẹ */
    margin-bottom: 20px;
    border: none; /* hoặc border rất nhẹ */
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: background-color 0.2s ease;
}
        
        .toggle-header:hover {
            background: linear-gradient(to right, rgba(12, 36, 97, 0.15), rgba(30, 55, 153, 0.15));
            transform: translateY(-2px);
        }
        
        .toggle-content {
            padding: 25px;
            background-color: white;
            border-radius: var(--border-radius);
            box-shadow: 0 4px 12px rgba(0,0,0,0.08);
            border: 1px solid #eaeaea;
            margin-bottom: 30px;
        }
        
        .card-actions {
            position: absolute;
            top: 18px;
            right: 18px;
            display: flex;
            gap: 12px;
            z-index: 10;
        }
        
        .card-btn {
            width: 38px;
            height: 38px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            background: rgba(255,255,255,0.9);
            box-shadow: 0 4px 8px rgba(0,0,0,0.1);
            cursor: pointer;
            border: 1px solid rgba(255,255,255,0.5);
            transition: all 0.2s ease;
        }
        
        .card-btn:hover {
            transform: scale(1.15);
            box-shadow: 0 6px 12px rgba(0,0,0,0.15);
        }
        
        .card-btn.remake {
            color: var(--remake-color);
        }
        
        .card-btn.edit {
            color: var(--accent-color);
        }
        
        .card-btn.delete {
            color: var(--error-color);
        }
        
        .edit-modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.7);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 2000;
            display: none;
        }
        
        .edit-modal-content {
            background: white;
            border-radius: var(--border-radius);
            width: 90%;
            max-width: 650px;
            max-height: 90vh;
            overflow-y: auto;
            padding: 35px;
            box-shadow: 0 25px 50px rgba(0,0,0,0.25);
            border: 1px solid #eaeaea;
            position: relative;
        }
        
        .form-row {
            margin-bottom: 25px;
        }
        
        .form-row label {
            display: block;
            margin-bottom: 10px;
            font-weight: 600;
            color: var(--primary-color);
            font-size: 1.1rem;
        }
        
        .form-row input, 
        .form-row textarea {
            width: 100%;
            padding: 14px 18px;
            border: 1px solid #ddd;
            border-radius: 8px;
            font-family: inherit;
            font-size: 1.05rem;
            transition: all 0.2s ease;
        }
        
        .form-row input:focus, 
        .form-row textarea:focus {
            outline: none;
            border-color: var(--accent-color);
            box-shadow: 0 0 0 4px rgba(74, 105, 189, 0.2);
        }
        
        .form-row textarea {
            min-height: 120px;
            resize: vertical;
        }
        
        .modal-buttons {
            display: flex;
            justify-content: flex-end;
            gap: 18px;
            margin-top: 35px;
        }
        
        .batch-controls {
            display: flex;
            gap: 18px;
            margin: 25px 0;
        }
        
        .btn {
            border-radius: 10px;
            padding: 14px 28px;
            font-weight: 600;
            transition: all 0.3s ease;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 12px;
            border: none;
            font-size: 1.05rem;
        }
        
        .btn-primary {
            background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
            color: white;
        }
        
        .btn-primary:hover {
            background: linear-gradient(to right, #0a1e4f, #1a317d);
            transform: translateY(-3px);
            box-shadow: 0 8px 15px rgba(12, 36, 97, 0.3);
        }
        
        .btn-secondary {
            background: #f0f2f5;
            border: 1px solid #ddd;
            color: var(--text-primary);
        }
        
        .btn-secondary:hover {
            background: #e4e7eb;
            border-color: #ccc;
            transform: translateY(-3px);
            box-shadow: 0 6px 12px rgba(0,0,0,0.1);
        }
        
        .btn-success {
            background: linear-gradient(to right, var(--success-color), #219653);
            color: white;
        }
        
        .btn-success:hover {
            background: linear-gradient(to right, #219653, #1e8449);
            transform: translateY(-3px);
            box-shadow: 0 8px 15px rgba(39, 174, 96, 0.3);
        }
        
        .btn-warning {
            background: linear-gradient(to right, var(--warning-color), #e67e22);
            color: white;
        }
        
        .btn-warning:hover {
            background: linear-gradient(to right, #e67e22, #d35400);
            transform: translateY(-3px);
            box-shadow: 0 8px 15px rgba(243, 156, 18, 0.3);
        }
        
        .section-title {
            position: relative;
            padding-bottom: 18px;
            margin-bottom: 30px;
            font-weight: 700;
            color: var(--primary-color);
            font-size: 1.8rem;
        }
        
        .section-title::after {
            content: "";
            position: absolute;
            bottom: 0;
            left: 0;
            width: 70px;
            height: 5px;
            background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
            border-radius: 5px;
        }
        
        .card {
            border-radius: var(--border-radius);
            border: none;
            box-shadow: var(--card-shadow);
            overflow: hidden;
            margin-bottom: 35px;
        }
        
        .card-body {
            padding: 30px;
        }
        
        .form-control, .form-select {
            border-radius: 8px;
            padding: 14px 18px;
            border: 1px solid #ddd;
            transition: all 0.2s ease;
            font-size: 1.05rem;
        }
        
        .form-control:focus, .form-select:focus {
            border-color: var(--accent-color);
            box-shadow: 0 0 0 4px rgba(74, 105, 189, 0.2);
        }
        
        @keyframes notificationSlideIn {
            from {
                transform: translateX(100%);
                opacity: 0;
            }
            to {
                transform: translateX(0);
                opacity: 1;
            }
        }
        
        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }
        
        .remake-loading {
            animation: spin 1s linear infinite;
        }

        @media (max-width: 768px) {
            .vocab-grid {
                grid-template-columns: 1fr;
            }
            
            .checkbox-group {
                grid-template-columns: 1fr 1fr;
            }
            
            .batch-controls {
                flex-direction: column;
            }
            
            .header h1 {
                font-size: 1.8rem;
            }
            
            .header p {
                font-size: 1.15rem;
            }
            
            .card-actions {
                top: 12px;
                right: 12px;
            }
        }
