/* Reset và base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

/* Navigation Bar Styles */
.navbar {
    background: linear-gradient(135deg, #2c3e50, #3498db);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    margin-bottom: 30px;
    border-radius: 0 0 15px 15px;
    overflow: hidden;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    font-size: 1.4rem;
    font-weight: 600;
    text-decoration: none;
}

.nav-brand i {
    font-size: 1.8rem;
    color: #fff;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.nav-link.home-link {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    border: none;
}

.nav-link.home-link:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.nav-link i {
    font-size: 1.1rem;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    padding: 30px;
}

/* Header styles */
header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eaeaea;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.logo i {
    font-size: 2.8rem;
    color: #3498db;
    background: linear-gradient(135deg, #3498db, #2c3e50);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #3498db, #2c3e50);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.tagline {
    font-size: 1.1rem;
    color: #7f8c8d;
    font-weight: 400;
}

/* Main tool container */
.tool-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

@media (min-width: 992px) {
    .tool-container {
        grid-template-columns: 1fr 1fr;
    }
}

/* Editor section */
.editor-section {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.input-section, .preview-section {
    background-color: #fff;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid #eee;
}

h2 {
    font-size: 1.4rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

h2 i {
    color: #3498db;
}

textarea {
    width: 100%;
    height: 150px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    resize: vertical;
    transition: border 0.3s;
}

textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.input-controls {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

/* Preview section */
.preview-box {
    min-height: 200px;
    max-height: 300px;
    overflow-y: auto;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 10px;
    background-color: #fff;
    transition: all 0.3s;
    font-size: 18px;
    line-height: 1.5;
}

.preview-box.mobile-preview {
    max-width: 375px;
    margin: 0 auto;
    border: 1px solid #ccc;
    border-radius: 20px;
    padding: 30px 20px;
    position: relative;
    overflow: hidden;
}

.preview-box.mobile-preview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40%;
    height: 20px;
    background: #333;
    border-radius: 0 0 10px 10px;
}

.preview-box.tablet-preview {
    max-width: 768px;
    margin: 0 auto;
    border: 1px solid #ccc;
    border-radius: 15px;
    padding: 30px;
}

.preview-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    flex-wrap: wrap;
    gap: 15px;
}

.preview-size {
    display: flex;
    align-items: center;
    gap: 10px;
}

select {
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    background-color: white;
    cursor: pointer;
}

/* Controls section */
.controls-section {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.font-controls, .css-output {
    background-color: #fff;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid #eee;
}

.control-group {
    margin-bottom: 20px;
}

.control-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c3e50;
}

.select-wrapper {
    position: relative;
}

.select-wrapper::after {
    content: '\f078';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #7f8c8d;
}

.select-wrapper select {
    width: 100%;
    appearance: none;
    padding-right: 40px;
}

input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

input[type="range"]::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.color-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

input[type="color"] {
    width: 100%;
    height: 40px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    padding: 0;
}

.style-controls {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.text-align-controls {
    margin-bottom: 25px;
}

.align-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.align-btn {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    background-color: #f9f9f9;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
}

.align-btn:hover {
    background-color: #eee;
}

.align-btn.active {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

.action-buttons {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

/* Button styles */
.btn-primary, .btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    flex: 1;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2980b9, #1f639e);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

.btn-secondary {
    background-color: #f8f9fa;
    color: #333;
    border: 1px solid #ddd;
}

.btn-secondary:hover {
    background-color: #e9ecef;
    transform: translateY(-2px);
}

/* CSS Output */
.css-code-container {
    background-color: #2c3e50;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    max-height: 200px;
    overflow-y: auto;
}

#css-output {
    color: #ecf0f1;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-all;
}

.css-actions {
    display: flex;
    gap: 15px;
}

/* Presets section */
.presets-section {
    background-color: #fff;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid #eee;
    margin-bottom: 30px;
}

.presets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.preset-card {
    background-color: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.preset-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    border-color: #3498db;
}

.preset-preview {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 10px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preset-name {
    font-size: 14px;
    color: #7f8c8d;
}

/* Footer */
footer {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #eaeaea;
    color: #7f8c8d;
    font-size: 14px;
}

.footer-note {
    margin-top: 5px;
    font-size: 13px;
}

.footer-note i {
    color: #e74c3c;
}

/* Notification */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #2ecc71;
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s;
    z-index: 1000;
}

.notification.show {
    transform: translateY(0);
    opacity: 1;
}

/* Responsive design */
@media (max-width: 768px) {
    .navbar {
        margin-bottom: 20px;
    }
    
    .nav-container {
        padding: 0 15px;
        height: 60px;
    }
    
    .nav-brand {
        font-size: 1.2rem;
    }
    
    .nav-brand i {
        font-size: 1.5rem;
    }
    
    .nav-menu {
        gap: 10px;
    }
    
    .nav-link {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
    
    .nav-link span {
        display: none;
    }
    
    .nav-link i {
        font-size: 1.2rem;
        margin: 0;
    }
    
    .container {
        padding: 15px;
    }
    
    .logo h1 {
        font-size: 1.8rem;
    }
    
    .tool-container {
        grid-template-columns: 1fr;
    }
    
    .color-controls {
        grid-template-columns: 1fr;
    }
    
    .presets-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .action-buttons, .css-actions {
        flex-direction: column;
    }
    
    .preview-controls {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .nav-link span {
        font-size: 0.9rem;
    }
    
    .nav-link {
        padding: 10px 15px;
    }
}