/* Base Styles */
:root {
    --primary-color: #3498db;
    --secondary-color: #2ecc71;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --success-color: #2ecc71;
    --text-color: #333;
    --text-light: #7f8c8d;
    --border-color: #ddd;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    --max-width: 1200px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #f5f7fa;
}

.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
header {
    background-color: var(--dark-color);
    color: white;
    padding: 1rem 0;
    text-align: center;
    margin-bottom: 0rem;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Tool Section */
.tool-section {
    background-color: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 2rem;
}

.converter-container {
    display: flex;
    flex-direction: column;
}

@media (min-width: 992px) {
    .converter-container {
        flex-direction: row;
    }
}

.input-section, .output-section {
    flex: 1;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

@media (min-width: 992px) {
    .input-section, .output-section {
        border-bottom: none;
        border-right: 1px solid var(--border-color);
    }
    
    .output-section {
        border-right: none;
    }
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-header h2 {
    font-size: 1.3rem;
    color: var(--dark-color);
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

/* Textarea and Preview */
textarea, .html-preview {
    width: 100%;
    min-height: 300px;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    resize: vertical;
    background-color: #f9f9f9;
}

.html-preview {
    overflow-y: auto;
    white-space: pre-wrap;
    color: #333;
}

/* Preview Section */
.preview-section {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.preview-content {
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    min-height: 200px;
    background-color: white;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
}

.btn:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

.btn i {
    font-size: 0.9rem;
}

#clear-btn {
    background-color: var(--danger-color);
}

#clear-btn:hover {
    background-color: #c0392b;
}

#copy-btn {
    background-color: var(--warning-color);
}

#copy-btn:hover {
    background-color: #d35400;
}

#download-btn {
    background-color: var(--success-color);
}

#download-btn:hover {
    background-color: #27ae60;
}

/* Info Section */
.info-section {
    background-color: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 2rem;
    margin-bottom: 2rem;
}

.info-section h2 {
    color: var(--dark-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.info-section h3 {
    color: var(--dark-color);
    margin: 1.5rem 0 1rem;
    font-size: 1.2rem;
}

.info-section p, .info-section ul, .info-section ol {
    margin-bottom: 1rem;
}

.info-section ul, .info-section ol {
    padding-left: 2rem;
}

.info-section li {
    margin-bottom: 0.5rem;
}

/* Benefits Grid */
.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.benefit-card {
    background-color: var(--light-color);
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    transition: var(--transition);
}

.benefit-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.benefit-card i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.benefit-card h4 {
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

/* Example Container */
.example-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin: 2rem 0;
}

@media (min-width: 768px) {
    .example-container {
        flex-direction: row;
    }
}

.example-column {
    flex: 1;
}

.example-column h4 {
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.example-column pre {
    background-color: #f5f5f5;
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
}

.example-column code {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.85rem;
    color: #333;
}

/* Ad Styles */
.ad-container {
    margin: 2rem 0;
}

.ad-banner {
    background-color: #f1f1f1;
    color: var(--text-light);
    text-align: center;
    padding: 1.5rem;
    border-radius: 4px;
    font-weight: bold;
}

.top-ad {
    margin-bottom: 2rem;
}

.inline-ad {
    margin: 2rem 0;
}

.sidebar-ad {
    display: none;
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 160px;
}

@media (min-width: 1200px) {
    .sidebar-ad {
        display: block;
    }
}

/* Footer */
footer {
    background-color: var(--dark-color);
    color: white;
    padding: 2rem 0;
    text-align: center;
    margin-top: 3rem;
}

footer p {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: white;
    text-decoration: none;
    margin: 0 0.5rem;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--success-color);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 4px;
    box-shadow: var(--shadow);
    transform: translateY(100px);
    opacity: 0;
    transition: var(--transition);
    z-index: 1000;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}