* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f5f5;
    color: #333;
}

.navbar {
    background: #2c3e50;
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: bold;
}

.nav-tabs {
    display: flex;
    list-style: none;
    gap: 0.5rem;
}

.nav-btn {
    background: transparent;
    color: white;
    border: 2px solid transparent;
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.nav-btn:hover {
    background: rgba(255,255,255,0.1);
}

.nav-btn.active {
    background: #3498db;
    border-color: #3498db;
}

.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.tool-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tool-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.tool-section h2 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

.tool-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

textarea {
    width: 100%;
    min-height: 300px;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    resize: vertical;
}

textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.output {
    background: #f9f9f9;
    padding: 1rem;
    border-radius: 4px;
    border: 1px solid #eee;
    min-height: 100px;
    margin-top: 1rem;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.error {
    color: #e74c3c;
    padding: 1rem;
    background: #fadbd8;
    border-radius: 4px;
    margin-top: 1rem;
    display: none;
}

.error.show {
    display: block;
}

.status-banner {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    display: none;
    font-weight: 500;
}

.status-banner.valid {
    display: block;
    background: #d5f4e6;
    color: #27ae60;
    border: 1px solid #27ae60;
}

.status-banner.invalid {
    display: block;
    background: #fadbd8;
    color: #e74c3c;
    border: 1px solid #e74c3c;
}

/* Syntax highlighting for code output */
.output code {
    color: #d63384;
}

.json-key {
    color: #0066cc;
    font-weight: 600;
}

.json-string {
    color: #008000;
}

.json-number {
    color: #d97706;
    font-weight: 500;
}

.json-boolean {
    color: #6f42c1;
    font-weight: 600;
}

.json-null {
    color: #999999;
    font-weight: 600;
}

.html-tag {
    color: #0066cc;
}

.html-closing-tag {
    color: #0066cc;
    font-weight: 500;
}

.html-attr {
    color: #6f42c1;
    font-weight: 500;
}

.html-string {
    color: #008000;
}

.html-comment {
    color: #999999;
    font-style: italic;
}

.html-content {
    color: #333333;
}

.btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background 0.3s ease;
    margin-top: 1rem;
}

.btn:hover {
    background: #2980b9;
}

.converter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 1rem;
    align-items: stretch;
    width: 100%;
}

.converter-grid-with-button {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 1rem;
    align-items: stretch;
    width: 100%;
}

.pane-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.pane-header h3 {
    margin: 0;
    color: #2c3e50;
    flex: 1;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    margin-top: 0;
    flex-shrink: 0;
}

.button-group {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.tool-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 1rem;
}

.converter-pane {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.converter-pane h3 {
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.converter-pane textarea {
    flex: 1;
    min-height: 300px;
    resize: none;
    width: 100%;
}

.converter-pane .output {
    flex: 1;
    min-height: 300px;
    overflow-y: auto;
    width: 100%;
}

.converter-controls {
    display: flex;
    gap: 0.5rem;
}

.converter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.converter-header .converter-controls {
    margin-bottom: 0;
}

.converter-header .btn {
    margin-top: 0;
}

.mode-btn {
    background: #ecf0f1;
    color: #2c3e50;
    border: 2px solid #bdc3c7;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.mode-btn:hover {
    background: #d5dbdb;
}

.mode-btn.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.converter-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.stat-card {
    background: #ecf0f1;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: #3498db;
}

.stat-label {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

@media (max-width: 768px) {
    .navbar-container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-tabs {
        flex-wrap: wrap;
        justify-content: center;
    }

    .converter-grid {
        grid-template-columns: 1fr;
    }

    .tool-content {
        padding: 1rem;
    }
}

.footer {
    background: #2c3e50;
    color: white;
    padding: 2rem 1rem;
    margin-top: 3rem;
    text-align: center;
    border-top: 1px solid #34495e;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
    opacity: 0.9;
}
