/* =========================================
   1. General Reset & Base Styles
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

/* =========================================
   2. Header & Navigation
   ========================================= */
header {
    background-color: #ffffff;
    padding: 0.8rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.site-logo {
    max-height: 45px;
    width: auto;
    display: block;
}

header h1 {
    font-size: 1.4rem;
    color: #2c3e50;
    font-weight: 700;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 25px;
}

nav a {
    text-decoration: none;
    color: #555;
    font-weight: 500;
    font-size: 1rem;
    transition: color 0.3s ease;
}

nav a:hover, nav a.active {
    color: #68217A;
}

/* =========================================
   3. Main Layout Containers
   ========================================= */
.container {
    max-width: 1000px;
    margin: 40px auto;
    padding: 0 20px;
    text-align: center;
    min-height: 80vh;
}

.lessons-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    text-align: left;
}

/* =========================================
   4. Home Page Styling
   ========================================= */
.hero-section {
    margin-bottom: 50px;
}

.hero-section h2 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 20px;
}

.card-grid {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    flex: 1;
    min-width: 300px;
    border-top: 5px solid #68217A;
    transition: transform 0.3s;
}

.card:hover {
    transform: translateY(-5px);
}

.dev-profile {
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    border: 1px solid #eee;
    display: block; 
    max-width: 800px; 
    margin: 20px auto; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

.avatar {
    font-size: 3rem;
    margin-bottom: 15px;
}

hr {
    border: 0;
    height: 1px;
    background: #e0e0e0;
    margin: 50px 0;
    opacity: 0.6;
}

/* =========================================
   5. Sidebar Styling
   ========================================= */
.sidebar {
    flex: 1;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    min-width: 250px;
    position: sticky;
    top: 90px;
    text-align: left;
}

.sidebar h3 {
    margin-bottom: 15px;
    color: #68217A;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.menu-category {
    font-weight: bold;
    color: #555;
    margin-top: 20px;
    margin-bottom: 8px;
    padding-left: 10px;
    font-size: 0.95rem;
    text-transform: uppercase;
    border-left: 3px solid #ddd;
}

.topic-list {
    list-style: none;
}

.topic-list li {
    padding: 10px 15px;
    font-size: 0.95rem;
    border-bottom: 1px solid #f9f9f9;
    cursor: pointer;
    transition: all 0.2s;
    color: #444;
}

.topic-list li:hover {
    background-color: #f0f0f0;
    color: #68217A;
    padding-left: 20px;
}

.topic-list li.active {
    background-color: #68217A;
    color: white;
    border-radius: 5px;
    padding-left: 15px;
}

/* =========================================
   6. Content Area & Code Blocks
   ========================================= */
.content-area {
    flex: 3;
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    min-height: 500px;
}

.lesson-content, .quiz-content {
    display: none;
    animation: fadeIn 0.4s ease-in-out;
}

.lesson-content.active-content, .quiz-content.active-content {
    display: block;
}

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

.code-block {
    background-color: #1e1e1e;
    color: #d4d4d4;
    padding: 15px;
    border-radius: 6px;
    margin: 15px 0;
    overflow-x: auto;
    font-family: 'Consolas', monospace;
    border-left: 5px solid #68217A;
    text-align: left;
}

.example-card {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    margin-bottom: 30px;
    border-left: 5px solid #2c3e50;
    text-align: left;
}

.output-box {
    background-color: #f4f4f4;
    color: #222;
    padding: 15px;
    border-radius: 5px;
    font-family: 'Consolas', monospace;
    border: 1px dashed #bbb;
    margin-top: 15px;
    text-align: left !important;
    white-space: normal;
    line-height: 1.5;
    overflow-x: auto;
}

.simple-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

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

.simple-table th {
    background-color: #68217A;
    color: white;
}

/* =========================================
   7. Quiz Styles
   ========================================= */
.question-card {
    background: #fff;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #eee;
    border-radius: 8px;
    border-left: 4px solid #68217A;
    text-align: left;
}

.options label {
    display: block;
    margin-bottom: 8px;
    padding: 10px 15px;
    background: #f9f9f9;
    border-radius: 5px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.options label:hover {
    background: #e9ecef;
}

.result-container {
    margin-top: 30px;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    font-weight: bold;
}

.result-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.result-fail {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* =========================================
   8. Buttons & Footer
   ========================================= */
.btn-primary {
    display: inline-block;
    background-color: #68217A;
    color: white;
    padding: 12px 30px;
    text-decoration: none;
    border-radius: 30px;
    font-weight: bold;
    margin-top: 15px;
    border: none;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-primary:hover {
    background-color: #50185e;
}

footer {
    text-align: center;
    padding: 25px;
    margin-top: 50px;
    background-color: #2c3e50;
    color: #ecf0f1;
    font-size: 0.9rem;
}

/* Responsive Logic */
@media (max-width: 800px) {
    .lessons-layout {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        position: relative;
        top: 0;
        margin-bottom: 20px;
    }
    header {
        flex-direction: column;
        gap: 15px;
    }
    nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }
}