/* Reset và thiết lập cơ bản */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: white;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

/* Header */
header {
    background: linear-gradient(to right, #2c3e50, #4a6491);
    color: white;
    padding: 24px 32px 0;
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.logo i {
    font-size: 2.5rem;
    color: #4dc0b5;
}

.logo h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.tagline p {
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Tabs */
.tabs {
    display: flex;
    justify-content: center;
    gap: 4px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 12px 12px 0 0;
    padding: 4px;
    overflow: hidden;
}

.tab {
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    border: none;
    padding: 14px 24px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.tab:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.15);
}

.tab.active {
    color: #2c3e50;
    background-color: white;
}

/* Main content */
main {
    padding: 32px;
}

.editor-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.input-section, .output-section {
    border: 1px solid #e1e5eb;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e1e5eb;
}

.section-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
}

.actions {
    display: flex;
    gap: 10px;
}

.editor-wrapper {
    position: relative;
}

textarea {
    width: 100%;
    height: 300px;
    padding: 20px;
    border: none;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    outline: none;
    background-color: #fcfcfc;
}

textarea:focus {
    background-color: #fff;
}

#inputCode {
    color: #2c3e50;
}

#outputCode {
    color: #4a6491;
    background-color: #f8fafc;
}

.char-count {
    position: absolute;
    bottom: 10px;
    right: 15px;
    font-size: 0.85rem;
    color: #6c757d;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 2px 8px;
    border-radius: 10px;
}

/* Controls */
.controls {
    background-color: #f8f9fa;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #e1e5eb;
}

.compression-options {
    margin-bottom: 24px;
}

.compression-options h3 {
    font-size: 1.1rem;
    margin-bottom: 16px;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 8px;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.95rem;
    color: #495057;
}

.checkbox input {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #adb5bd;
    border-radius: 4px;
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.checkbox input:checked + .checkmark {
    background-color: #4a6491;
    border-color: #4a6491;
}

.checkbox input:checked + .checkmark::after {
    content: "✓";
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.action-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.stats {
    display: flex;
    gap: 25px;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-label {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #2c3e50;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn.primary {
    background: linear-gradient(to right, #4a6491, #2c3e50);
    color: white;
    box-shadow: 0 4px 12px rgba(42, 84, 141, 0.3);
}

.btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(42, 84, 141, 0.4);
}

.btn.secondary {
    background-color: white;
    color: #4a6491;
    border: 1px solid #adb5bd;
}

.btn.secondary:hover {
    background-color: #f8f9fa;
    border-color: #4a6491;
}

.home-btn {
    background-color: #4dc0b5;
    color: white;
    text-decoration: none;
}

.home-btn:hover {
    background-color: #3aa99f;
    color: white;
}

/* Info panel */
.info-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 40px;
}

.info-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    border-left: 4px solid #4a6491;
    transition: transform 0.3s ease;
}

.info-card:hover {
    transform: translateY(-5px);
}

.info-card i {
    font-size: 2.5rem;
    color: #4a6491;
    margin-bottom: 16px;
}

.info-card h3 {
    font-size: 1.2rem;
    margin-bottom: 12px;
    color: #2c3e50;
}

.info-card p {
    font-size: 0.95rem;
    color: #6c757d;
    line-height: 1.5;
}

/* Footer */
footer {
    background-color: #2c3e50;
    color: #dee2e6;
    padding: 32px;
    margin-top: 40px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 24px;
}

.copyright {
    font-size: 0.95rem;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-link {
    color: #adb5bd;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.footer-link:hover {
    color: white;
}

.footer-note {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 16px 20px;
    font-size: 0.9rem;
    border-left: 4px solid #4dc0b5;
}

.footer-note i {
    color: #4dc0b5;
    margin-right: 8px;
}

/* Notification */
.notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 16px 24px;
    background-color: #4a6491;
    color: white;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s, transform 0.3s;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 350px;
}

.notification.show {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 992px) {
    .options-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .stats {
        align-self: center;
    }
}

@media (max-width: 768px) {
    .container {
        border-radius: 12px;
    }
    
    header, main, footer {
        padding: 20px;
    }
    
    .tabs {
        flex-wrap: wrap;
    }
    
    .tab {
        flex: 1;
        min-width: 120px;
        justify-content: center;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .actions {
        align-self: flex-end;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .info-panel {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    body {
        padding: 10px;
    }
    
    .logo h1 {
        font-size: 1.7rem;
    }
    
    .tab {
        padding: 12px 16px;
        font-size: 0.9rem;
    }
    
    .options-grid {
        grid-template-columns: 1fr;
    }
    
    .stats {
        flex-direction: column;
        gap: 15px;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 15px;
    }
    
    .notification {
        left: 20px;
        right: 20px;
        max-width: none;
    }
}