/* Reset và font */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    border-radius: 12px;
    color: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.header h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 2.5rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 800px;
    margin: 0 auto;
}

/* Cards */
.card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #eaeaea;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

/* Main content layout */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

@media (max-width: 1100px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

/* Form styling */
h2, h3 {
    font-family: 'Poppins', sans-serif;
    color: #2c3e50;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-group {
    margin-bottom: 22px;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: #444;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group input[type="text"],
.form-group input[type="url"],
.form-group input[type="date"],
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s;
    background-color: #f9f9f9;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.hint {
    display: block;
    font-size: 0.85rem;
    color: #666;
    margin-top: 6px;
}

/* Range slider */
.range-value {
    display: inline-block;
    margin-left: 10px;
    font-weight: 600;
    color: #3498db;
}

input[type="range"] {
    width: calc(100% - 50px);
    height: 8px;
    border-radius: 4px;
    background: #ddd;
    outline: none;
}

/* Pages list */
.pages-control {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.pages-control input {
    flex: 1;
}

.pages-list-container {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.pages-list {
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    background-color: #f9f9f9;
}

.page-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: white;
    border-radius: 6px;
    margin-bottom: 8px;
    border-left: 4px solid #3498db;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.page-item:last-child {
    margin-bottom: 0;
}

.page-url {
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
}

.remove-page {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.remove-page:hover {
    background: #c0392b;
}

.empty-list {
    text-align: center;
    color: #888;
    font-style: italic;
    padding: 20px;
}

.pages-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Buttons */
.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(to right, #3498db, #2980b9);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(to right, #2980b9, #2575fc);
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(52, 152, 219, 0.3);
}

.btn-secondary {
    background: #7f8c8d;
    color: white;
}

.btn-secondary:hover {
    background: #6c7b7d;
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(to right, #2ecc71, #27ae60);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(to right, #27ae60, #219653);
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(46, 204, 113, 0.3);
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover {
    background: #138496;
    transform: translateY(-2px);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.output-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Advanced options */
.advanced-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px dashed #ddd;
}

.advanced-toggle input {
    width: auto;
}

.advanced-options {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease;
}

.advanced-options.show {
    max-height: 800px;
    margin-top: 20px;
}

/* Output section */
.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.sitemap-preview {
    background: #2c3e50;
    color: #ecf0f1;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    min-height: 300px;
}

/* Stats */
.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #eaeaea;
}

.stat {
    text-align: center;
    padding: 10px;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 1.4rem;
    font-weight: 700;
    color: #2c3e50;
}

.status {
    color: #e74c3c;
    font-weight: 600;
}

.status.completed {
    color: #27ae60;
}

/* Features section */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.feature {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #3498db;
    transition: transform 0.3s;
}

.feature:hover {
    transform: translateY(-5px);
    background: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.feature-icon {
    font-size: 2rem;
    color: #3498db;
    margin-bottom: 10px;
}

.feature h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: #2c3e50;
}

.feature p {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.5;
}

/* Footer */
.footer {
    text-align: center;
    padding: 25px;
    margin-top: 30px;
    color: #666;
    border-top: 1px solid #eaeaea;
    background: white;
    border-radius: 12px;
}

.footer p {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.copyright {
    font-size: 0.9rem;
    color: #888;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    overflow: auto;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    width: 90%;
    max-width: 800px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: modalopen 0.4s;
}

@keyframes modalopen {
    from {opacity: 0; transform: translateY(-50px);}
    to {opacity: 1; transform: translateY(0);}
}

.modal-header {
    padding: 20px 25px;
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    color: white;
    margin: 0;
}

.close {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover {
    color: #f1f1f1;
}

.modal-body {
    padding: 25px;
    max-height: 500px;
    overflow-y: auto;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 1.8rem;
        flex-direction: column;
        gap: 10px;
    }
    
    .stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .output-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .output-actions {
        width: 100%;
        justify-content: center;
    }
    
    .btn {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .stats {
        grid-template-columns: 1fr;
    }
    
    .pages-control {
        flex-direction: column;
    }
}