/* Reset và cài đặt cơ bản */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #f1f1f1;
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: rgba(25, 25, 40, 0.9);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    border: 1px solid #2a2a4a;
}

/* Header */
header {
    background: linear-gradient(90deg, #0f3460 0%, #1a1a2e 100%);
    padding: 2rem;
    text-align: center;
    border-bottom: 1px solid #2a2a4a;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

header .subtitle {
    font-size: 1.1rem;
    color: #a0a0c0;
    max-width: 700px;
    margin: 0 auto;
}

/* Main converter */
.converter {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-header h2 {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.format-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: #1a1a2e;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid #2a2a4a;
}

.format-selector label {
    font-weight: 500;
}

.format-selector select {
    background-color: #0f3460;
    color: #fff;
    border: 1px solid #3a5a9c;
    border-radius: 6px;
    padding: 0.5rem;
    font-family: 'Source Code Pro', monospace;
    font-weight: 600;
    cursor: pointer;
    min-width: 180px;
}

.format-selector select:focus {
    outline: none;
    border-color: #4cc9f0;
    box-shadow: 0 0 0 2px rgba(76, 201, 240, 0.3);
}

/* Input và output containers */
.input-container, .output-container {
    background-color: #1a1a2e;
    border-radius: 10px;
    border: 1px solid #2a2a4a;
    overflow: hidden;
}

textarea {
    width: 100%;
    min-height: 180px;
    padding: 1.5rem;
    background-color: #0f172a;
    color: #f1f1f1;
    border: none;
    font-family: 'Source Code Pro', monospace;
    font-size: 1.1rem;
    resize: vertical;
    line-height: 1.5;
}

textarea:focus {
    outline: none;
    background-color: #0d1424;
}

textarea#inputValue {
    border-bottom: 1px solid #2a2a4a;
}

textarea#outputValue {
    cursor: default;
}

.input-info, .output-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1.5rem;
    background-color: #1a1a2e;
    color: #a0a0c0;
    font-size: 0.9rem;
}

/* Action section */
.action-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-primary, .btn-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0.9rem 1.8rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: linear-gradient(90deg, #4cc9f0 0%, #4361ee 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(90deg, #3db8dd 0%, #3a56d4 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(67, 97, 238, 0.4);
}

.btn-secondary {
    background-color: #2a2a4a;
    color: #f1f1f1;
    border: 1px solid #3a3a5a;
}

.btn-secondary:hover {
    background-color: #3a3a5a;
    transform: translateY(-2px);
}

.btn-icon {
    background: none;
    border: 1px solid #3a3a5a;
    color: #a0a0c0;
    border-radius: 6px;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background-color: #2a2a4a;
    color: #f1f1f1;
}

.direction-icon {
    font-size: 2rem;
    color: #4cc9f0;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
}

/* Examples section */
.examples-section {
    padding: 0 2rem 2rem;
}

.examples-section h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.example-card {
    background-color: #1a1a2e;
    border-radius: 10px;
    padding: 1.5rem;
    border: 1px solid #2a2a4a;
    transition: transform 0.3s ease;
}

.example-card:hover {
    transform: translateY(-5px);
    border-color: #3a5a9c;
}

.example-header {
    font-weight: 700;
    color: #4cc9f0;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.example-input, .example-output {
    font-family: 'Source Code Pro', monospace;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.example-input {
    color: #a0a0c0;
}

.example-output {
    color: #f72585;
    font-weight: 600;
}

.btn-example {
    width: 100%;
    margin-top: 1rem;
    padding: 0.7rem;
    background-color: #2a2a4a;
    color: #f1f1f1;
    border: 1px solid #3a3a5a;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-example:hover {
    background-color: #3a3a5a;
}

/* Info section */
.info-section {
    padding: 0 2rem 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.info-card {
    background-color: #1a1a2e;
    border-radius: 10px;
    padding: 1.5rem;
    border: 1px solid #2a2a4a;
}

.info-card h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #4cc9f0;
}

.info-card ol, .info-card ul {
    padding-left: 1.5rem;
}

.info-card li {
    margin-bottom: 0.7rem;
    color: #d1d1e0;
}

/* Footer */
footer {
    background: linear-gradient(90deg, #0f3460 0%, #1a1a2e 100%);
    padding: 1.5rem 2rem;
    text-align: center;
    border-top: 1px solid #2a2a4a;
    color: #a0a0c0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.footer-icons {
    display: flex;
    gap: 1.5rem;
    font-size: 1.5rem;
}

.footer-icons i {
    color: #a0a0c0;
    transition: color 0.3s ease;
}

.footer-icons i:hover {
    color: #4cc9f0;
}

.fa-html5:hover { color: #e34c26; }
.fa-css3-alt:hover { color: #264de4; }
.fa-js:hover { color: #f0db4f; }

/* Toast notification */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: #10b981;
    color: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    font-weight: 500;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        border-radius: 12px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .converter {
        padding: 1.5rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .format-selector {
        width: 100%;
        justify-content: space-between;
    }
    
    .format-selector select {
        flex-grow: 1;
    }
    
    .action-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-primary, .btn-secondary {
        width: 100%;
    }
    
    .examples-grid {
        grid-template-columns: 1fr;
    }
    
    .info-section {
        grid-template-columns: 1fr;
    }
    
    textarea {
        min-height: 150px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    header {
        padding: 1.5rem 1rem;
    }
    
    header h1 {
        font-size: 1.7rem;
    }
    
    .converter, .examples-section, .info-section {
        padding: 1rem;
    }
    
    .footer-icons {
        font-size: 1.2rem;
    }
}