:root {
    --primary-color: #3498db;
    --accent-color: #2ecc71;
    --dark-color: #34495e;
    --light-color: #ecf0f1;
    --error-color: #e74c3c;
    --bg-color: #f9f9f9;
    --text-color: #2c3e50;
    --card-bg: #ffffff;
    --border-color: #ddd;
    --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    --primary-color: #2980b9;
    --accent-color: #27ae60;
    --dark-color: #2c3e50;
    --light-color: #34495e;
    --bg-color: #1a1a2e;
    --text-color: #e1e1e1;
    --card-bg: #222831;
    --border-color: #444;
    --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

* {
    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: var(--bg-color);
    padding: 20px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

header h1 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

h2 {
    margin-bottom: 15px;
    font-size: 1.2rem;
    color: var(--dark-color);
}

.input-container {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.json-input, .path-input {
    flex: 1;
    min-width: 300px;
}

.input-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.button-group {
    display: flex;
    gap: 5px;
}

.action-button {
    padding: 5px 10px;
    font-size: 0.85rem;
    background-color: var(--dark-color);
}

.action-button:hover {
    background-color: #2c3e50;
}

.help-button {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    border: none;
}

textarea, input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 14px;
    transition: border 0.3s;
}

textarea {
    min-height: 400px;
    resize: vertical;
}

textarea:focus, input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
}

.input-wrapper {
    display: flex;
    gap: 10px;
}

button {
    padding: 12px 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #2980b9;
}

.examples {
    margin-top: 15px;
}

.examples p {
    margin-bottom: 5px;
    font-weight: bold;
}

.examples ul {
    list-style: none;
}

.examples li {
    margin-bottom: 5px;
}

.example-link {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s;
}

.example-link:hover {
    color: #2980b9;
    text-decoration: underline;
}

.output-container {
    background-color: var(--light-color);
    padding: 20px;
    border-radius: 4px;
    box-shadow: var(--box-shadow);
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

#copyResultsBtn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    font-size: 0.85rem;
    background-color: var(--dark-color);
}

#copyResultsBtn:hover {
    background-color: #2c3e50;
}

#copyResultsBtn svg {
    width: 14px;
    height: 14px;
}

.results-count {
    font-size: 0.9rem;
    margin-bottom: 10px;
    color: var(--dark-color);
}

#results {
    background-color: var(--card-bg);
    padding: 15px;
    border-radius: 4px;
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 14px;
    border: 1px solid var(--border-color);
}

.error-message {
    color: var(--error-color);
    margin-top: 10px;
    font-size: 14px;
}

footer {
    margin-top: auto;
    text-align: center;
    padding-top: 20px;
    color: #7f8c8d;
    font-size: 14px;
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
}

.footer-links {
    margin: 10px 0;
}

.footer-links a {
    margin: 0 10px;
    font-size: 13px;
}

.version {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

.share-link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 15px;
    border-radius: 4px;
    background-color: var(--dark-color);
    color: white;
    text-decoration: none;
    transition: background-color 0.3s;
}

.share-link:hover {
    background-color: #2c3e50;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 20px;
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 30px;
    border-radius: 6px;
    box-shadow: var(--box-shadow);
    width: 80%;
    max-width: 800px;
    position: relative;
    animation: modalopen 0.3s;
}

.close-button {
    color: #aaa;
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-button:hover {
    color: var(--dark-color);
}

.syntax-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.syntax-table th, 
.syntax-table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
}

.syntax-table th {
    background-color: var(--light-color);
    font-weight: bold;
}

.syntax-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

@keyframes modalopen {
    from {opacity: 0; transform: translateY(-10px);}
    to {opacity: 1; transform: translateY(0);}
}

/* Theme Switch */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 15px;
}

.theme-switch {
    display: inline-block;
    position: relative;
    width: 50px;
    height: 24px;
    margin-right: 10px;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .3s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(24px);
}

.slider.round {
    border-radius: 24px;
}

.slider.round:before {
    border-radius: 50%;
}

.theme-label {
    font-size: 14px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .input-container {
        flex-direction: column;
    }
    
    .json-input, .path-input {
        width: 100%;
    }
    
    textarea {
        min-height: 300px;
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
    }
}
