.json-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.chapter-title {
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
    margin-bottom: 30px;
}

.json-section {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 25px;
    margin-bottom: 30px;
}

.json-section h2 {
    color: #2c3e50;
    border-left: 4px solid #3498db;
    padding-left: 15px;
    margin-top: 0;
}

.json-section h3 {
    color: #34495e;
    margin-top: 25px;
}

.code-block {
    background: #2d2d2d;
    color: #f8f8f2;
    border-radius: 6px;
    padding: 20px;
    margin: 15px 0;
    overflow-x: auto;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    line-height: 1.5;
}

.code-comment {
    color: #75715e;
}

.code-keyword {
    color: #66d9ef;
}

.code-string {
    color: #e6db74;
}

.code-number {
    color: #ae81ff;
}

.code-boolean {
    color: #f92672;
}

.code-function {
    color: #a6e22e;
}

.example-box {
    background: #f8f9fa;
    border-left: 4px solid #3498db;
    padding: 15px;
    margin: 15px 0;
    border-radius: 0 4px 4px 0;
}

.security-risk {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-left: 4px solid #f39c12;
    border-radius: 0 4px 4px 0;
    padding: 15px;
    margin: 15px 0;
}

.security-solution {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-left: 4px solid #28a745;
    border-radius: 0 4px 4px 0;
    padding: 15px;
    margin: 15px 0;
}

.critical-warning {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-left: 4px solid #dc3545;
    border-radius: 0 4px 4px 0;
    padding: 15px;
    margin: 15px 0;
}

.interactive-demo {
    background: #e8f4fd;
    border: 1px solid #b8daff;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.demo-area {
    display: flex;
    gap: 20px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.demo-panel {
    flex: 1;
    min-width: 300px;
}

.demo-panel textarea {
    width: 100%;
    height: 200px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    resize: vertical;
}

.demo-controls {
    display: flex;
    gap: 10px;
    margin: 15px 0;
    flex-wrap: wrap;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.demo-result {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 15px;
    margin-top: 15px;
    font-family: 'Consolas', 'Monaco', monospace;
    white-space: pre-wrap;
    min-height: 100px;
    max-height: 300px;
    overflow-y: auto;
}

.navigation-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.feature-card {
    background: white;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: #3498db;
}

.security-level {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    margin-left: 10px;
}

.level-high {
    background: #dc3545;
    color: white;
}

.level-medium {
    background: #fd7e14;
    color: white;
}

.level-low {
    background: #ffc107;
    color: black;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.comparison-table th, .comparison-table td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}

.comparison-table th {
    background-color: #f8f9fa;
    font-weight: bold;
}

.comparison-table tr:nth-child(even) {
    background-color: #f8f9fa;
}

.checklist {
    list-style: none;
    padding-left: 0;
}

.checklist li {
    padding: 8px 0;
    padding-left: 30px;
    position: relative;
}

.checklist li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #28a745;
    font-weight: bold;
}

.bad-practice {
    background: #f8d7da;
    padding: 10px;
    border-radius: 4px;
    margin: 5px 0;
}

.good-practice {
    background: #d4edda;
    padding: 10px;
    border-radius: 4px;
    margin: 5px 0;
}

@media (max-width: 768px) {
    .demo-area {
        flex-direction: column;
    }

    .demo-panel {
        min-width: 100%;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }

    .demo-controls {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}
