/* Content Page Styles for Web Development Learning Hub */

/* Content Page Layout */
.content-page {
    background-color: #f8f9fa;
}

.content-page header {
    padding: 3rem 2rem;
}

.content-page nav {
    background-color: var(--dark-bg);
    border-radius: var(--border-radius);
    margin: 2rem 0 0;
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.content-page nav ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

.content-page nav a {
    padding: 0.8rem 1.2rem;
    font-size: 1.4rem;
}

.content {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    padding: 3rem;
    margin-bottom: 3rem;
}

.content-section {
    margin-bottom: 5rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid #eee;
}

.content-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

/* Code Examples */
.code-example {
    background-color: #f5f7fa;
    border-radius: var(--border-radius);
    padding: 2rem;
    margin: 2rem 0;
    overflow-x: auto;
}

.code-example h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

.code-example pre {
    margin: 0;
    padding: 0;
    background-color: transparent;
}

.code-example code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.4rem;
    line-height: 1.5;
    color: #333;
}

/* Info Boxes */
.info-box {
    background-color: #e8f4fd;
    border-left: 5px solid var(--accent-color);
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    padding: 2rem;
    margin: 2rem 0;
}

.info-box h3 {
    margin-top: 0;
    color: var(--secondary-color);
}

.info-box ul {
    margin-bottom: 0;
}

/* Example Containers */
.example-container {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin: 2rem 0;
    border: 1px solid #eee;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.example-code {
    flex: 1 1 400px;
    background-color: #f5f7fa;
    padding: 2rem;
    border-right: 1px solid #eee;
}

.example-output {
    flex: 1 1 400px;
    padding: 2rem;
    background-color: white;
}

.example-code pre {
    margin: 0;
    padding: 0;
    background-color: transparent;
}

.example-code code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.4rem;
    line-height: 1.5;
    color: #333;
}

/* Tables */
.content-table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
}

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

.content-table th {
    background-color: var(--primary-color);
    color: white;
    font-weight: bold;
}

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

.content-table tr:hover {
    background-color: #f1f1f1;
}

/* Exercise Sections */
.exercise {
    background-color: #f0f7f4;
    border-left: 5px solid #4caf50;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    padding: 2rem;
    margin: 2rem 0;
}

.exercise h3 {
    margin-top: 0;
    color: #2e7d32;
}

.next-steps {
    background-color: #fff8e1;
    border-left: 5px solid #ffc107;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    padding: 2rem;
    margin: 2rem 0;
}

.next-steps h3 {
    margin-top: 0;
    color: #ff8f00;
}

/* Syntax Highlighting for Code */
.keyword {
    color: #0066cc;
    font-weight: bold;
}

.string {
    color: #008000;
}

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

.tag {
    color: #800000;
}

.attribute {
    color: #ff6600;
}

.value {
    color: #0000ff;
}

/* Responsive Design for Content Pages */
@media (max-width: 768px) {
    .content {
        padding: 2rem;
    }
    
    .content-page nav {
        overflow-x: auto;
        white-space: nowrap;
        padding: 0.5rem;
    }
    
    .content-page nav ul {
        flex-wrap: nowrap;
        justify-content: flex-start;
    }
    
    .content-page nav a {
        padding: 0.6rem 1rem;
        font-size: 1.3rem;
    }
    
    .example-container {
        flex-direction: column;
    }
    
    .example-code {
        border-right: none;
        border-bottom: 1px solid #eee;
    }
}

@media (max-width: 480px) {
    .content {
        padding: 1.5rem;
    }
    
    .code-example,
    .info-box,
    .exercise,
    .next-steps {
        padding: 1.5rem;
    }
    
    .content-table th,
    .content-table td {
        padding: 0.8rem;
        font-size: 1.4rem;
    }
}

/* Print Styles */
@media print {
    .content-page nav {
        display: none;
    }
    
    .content {
        box-shadow: none;
    }
    
    .code-example,
    .info-box,
    .example-container,
    .exercise,
    .next-steps {
        break-inside: avoid;
    }
}