* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.header {
    margin-bottom: 30px;
}

.header h1 {
    color: #333;
    font-size: 2.5em;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

.header p {
    color: #666;
    font-size: 1.1em;
    line-height: 1.6;
}

.input-group {
    margin-bottom: 30px;
    text-align: left;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
    font-size: 1.1em;
}

.input-group input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: 1em;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.example {
    background: #f0f4ff;
    padding: 15px;
    border-radius: 8px;
    margin-top: 10px;
    font-size: 0.9em;
    color: #555;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.example strong {
    color: #667eea;
}



.status {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    font-weight: 500;
    display: none;
}

.status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status.loading {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.btn {
    display: inline-block;
    /* Để các nút nằm trên một hàng */
    margin: 8px;
    /* Khoảng cách giữa các nút */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 16px 40px;
    /* Padding lớn hơn */
    font-size: 1em;
    /* Kích thước font phù hợp */
    font-weight: 600;
    /* Đậm hơn */
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    /* Bóng đổ mạnh hơn khi hover */
}

.btn:hover {
    transform: translateY(-3px);
    /* Nâng lên cao hơn */
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.5);
    /* Bóng đổ rõ hơn */
}

.btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-small {
    padding: 10px 20px;
    /* Nhỏ hơn so với nút chính */
    font-size: 0.9em;
    min-width: 120px;
    /* Đảm bảo đủ rộng */
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #b3d4fc;
    border-radius: 50%;
    border-top-color: #0c5460;
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.names-list {
    margin-top: 30px;
    display: none;
}

.names-list h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.8em;
}

.name-item {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    text-align: left;
    transition: transform 0.2s ease;
}

.name-item:hover {
    transform: translateY(-2px);
}

.name-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 15px;
}

.name-title {
    font-size: 1.2em;
    font-weight: 600;
    color: #333;
}

.name-meta {
    color: #666;
    font-size: 0.9em;
}

.name-content {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    max-height: 120px;
    overflow-y: auto;
    border-left: 4px solid #667eea;
    font-family: monospace;
    font-size: 0.9em;
    color: #555;
    white-space: pre-line;
}

.name-actions {
    display: flex;
    justify-content: flex-end;
}

@media (max-width: 768px) {
    body {
        padding: 15px;
        align-items: flex-start;
        /* Để cuộn được trên màn hình nhỏ */
    }

    .container {
        padding: 25px;
        border-radius: 15px;
        margin-top: 15px;
        /* Giảm khoảng cách trên cùng */
        margin-bottom: 15px;
        /* Giảm khoảng cách dưới cùng */
    }

    .header h1 {
        font-size: 2.2em;
    }

    .btn {
        width: calc(100% - 16px);
        /* Chiếm gần hết chiều rộng */
        margin: 8px 0;
        /* Khoảng cách trên/dưới */
        padding: 14px 20px;
    }

    .name-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .name-title {
        font-size: 1.2em;
    }

    .name-meta {
        font-size: 0.9em;
    }

    .name-item {
        padding: 18px;
    }

    .name-content {
        padding: 15px;
        max-height: 100px;
        /* Giảm chiều cao trên mobile */
    }
}

/* Filter info styling */
.filter-info {
    background: #e8f5e9;
    border-left: 4px solid #4caf50;
    padding: 10px 15px;
    margin-bottom: 15px;
    border-radius: 6px;
    font-size: 0.9em;
    color: #2e7d32;
    font-weight: 500;
}

/* Secondary button styling */
.btn-secondary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 6px 20px rgba(245, 87, 108, 0.4);
}

.btn-secondary:hover {
    box-shadow: 0 10px 30px rgba(245, 87, 108, 0.5);
}

/* Name actions - cho phép wrap trên mobile */
.name-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .filter-info {
        font-size: 0.85em;
        padding: 8px 12px;
    }
    
    .name-actions {
        justify-content: stretch;
    }
    
    .name-actions .btn-small {
        flex: 1;
        min-width: calc(50% - 5px);
    }
}

/* Filter info styling */
.filter-info {
    background: #e8f5e9;
    border-left: 4px solid #4caf50;
    padding: 10px 15px;
    margin-bottom: 15px;
    border-radius: 6px;
    font-size: 0.9em;
    color: #2e7d32;
    font-weight: 500;
}

/* Secondary button styling (màu hồng - Xem bị lọc) */
.btn-secondary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 6px 20px rgba(245, 87, 108, 0.4);
}

.btn-secondary:hover {
    box-shadow: 0 10px 30px rgba(245, 87, 108, 0.5);
}

/* Tertiary button styling (màu cam - Tải gốc) */
.btn-tertiary {
    background: linear-gradient(135deg, #ffa726 0%, #fb8c00 100%);
    box-shadow: 0 6px 20px rgba(255, 167, 38, 0.4);
}

.btn-tertiary:hover {
    box-shadow: 0 10px 30px rgba(255, 167, 38, 0.5);
}

/* Name actions - cho phép wrap trên mobile */
.name-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: #fff;
    margin: 10% auto;
    width: 80%;
    max-width: 600px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    overflow: hidden;
}

.modal-header {
    background-color: #4ebcd2; /* Màu Cyan đồng nhất */
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title { font-weight: bold; font-size: 18px; }

.close-modal {
    cursor: pointer;
    font-size: 28px;
    font-weight: bold;
}

.modal-body {
    padding: 20px;
    max-height: 400px;
    overflow-y: auto; /* Cho phép cuộn nếu danh sách dài */
    white-space: pre-wrap; /* Giữ nguyên xuống dòng */
    font-family: monospace;
    font-size: 14px;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.invalid-item {
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    display: flex;
    flex-direction: column;
}

.reason-text { color: #e74c3c; font-style: italic; }

/* Mobile responsive */
@media (max-width: 768px) {
    .filter-info {
        font-size: 0.85em;
        padding: 8px 12px;
    }
    
    .name-actions {
        justify-content: stretch;
    }
    
    .name-actions .btn-small {
        flex: 1 1 auto;
        min-width: 120px;
    }
}