/* Python 3.10+ E-Book Stylesheet */

/* CSS Variables */
:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --accent-color: #3b82f6;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --dark-bg: #1e293b;
    --light-bg: #f8fafc;
    --text-dark: #0f172a;
    --text-light: #ffffff;
    --border-color: #cbd5e1;
    --code-bg: #282c34;
    --table-header-bg: #3b82f6;
    --table-row-hover: #dbeafe;
}

/* Global Styles */
* {
    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-dark);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

/* Print Button */
.print-button-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.print-btn {
    background: var(--success-color);
    color: var(--text-light);
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.print-btn:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

/* Header */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text-light);
    text-align: center;
    padding: 40px 20px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.header h1 {
    font-size: 48px;
    font-weight: bold;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
    font-size: 24px;
    font-weight: bold;
    opacity: 0.9;
}

/* Navigation */
.navigation {
    background: var(--text-light);
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.navigation h2 {
    color: var(--primary-color);
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 20px;
    text-align: center;
}

.nav-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.nav-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text-light);
    border: none;
    padding: 15px 20px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 10px;
    cursor: pointer;
    text-align: left;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nav-btn:hover {
    transform: translateX(10px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Main Content */
.content {
    background: var(--text-light);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-width: 1400px;
    margin: 0 auto;
}

/* Sections */
.section {
    margin-bottom: 50px;
    padding: 30px;
    background: var(--light-bg);
    border-radius: 10px;
    border-left: 5px solid var(--primary-color);
}

.section-title {
    font-size: 36px;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--primary-color);
}

.sub-heading {
    font-size: 24px;
    font-weight: bold;
    color: var(--secondary-color);
    margin-top: 25px;
    margin-bottom: 15px;
}

.sub-sub-heading {
    font-size: 20px;
    font-weight: bold;
    color: var(--text-dark);
    margin-top: 15px;
    margin-bottom: 10px;
}

/* Text Content */
p {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.content-list {
    margin-left: 30px;
    margin-bottom: 20px;
}

.content-list li {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
    color: var(--text-dark);
}

code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    font-weight: bold;
    color: #dc2626;
}

/* Code Blocks */
.code-block {
    background: var(--code-bg);
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    overflow-x: auto;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.code-block pre {
    margin: 0;
}

.code-block code {
    background: transparent;
    color: #61dafb;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    font-weight: bold;
    padding: 0;
    display: block;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 25px 0;
    font-size: 18px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.data-table thead tr {
    background: var(--table-header-bg);
    color: var(--text-light);
    text-align: left;
}

.data-table th,
.data-table td {
    padding: 15px 20px;
    font-weight: bold;
}

.data-table th {
    font-size: 20px;
}

.data-table tbody tr {
    border-bottom: 1px solid var(--border-color);
}

.data-table tbody tr:nth-of-type(even) {
    background: #f8fafc;
}

.data-table tbody tr:hover {
    background: var(--table-row-hover);
    cursor: pointer;
}

.data-table tbody tr:last-of-type {
    border-bottom: 2px solid var(--table-header-bg);
}

/* Flowcharts */
.flowchart {
    background: linear-gradient(135deg, #e0e7ff 0%, #ddd6fe 100%);
    padding: 30px;
    border-radius: 10px;
    margin: 25px 0;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.flow-box {
    background: var(--text-light);
    border: 3px solid var(--primary-color);
    border-radius: 10px;
    padding: 20px;
    margin: 15px auto;
    max-width: 500px;
    font-size: 18px;
    font-weight: bold;
    color: var(--text-dark);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.flow-arrow {
    font-size: 32px;
    font-weight: bold;
    color: var(--primary-color);
    margin: 10px 0;
}

/* Mind Map */
.mindmap {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    padding: 50px;
    border-radius: 15px;
    margin: 30px 0;
    position: relative;
    min-height: 800px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.mindmap-center {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text-light);
    border: 4px solid var(--text-dark);
    border-radius: 50%;
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.mindmap-branch {
    position: relative;
}

.mindmap-node {
    background: var(--text-light);
    border: 3px solid var(--primary-color);
    border-radius: 10px;
    padding: 20px;
    width: 250px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    position: absolute;
}

.mindmap-node strong {
    display: block;
    font-size: 18px;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 5px;
}

.mindmap-node ul {
    list-style: none;
    padding: 0;
}

.mindmap-node li {
    font-size: 16px;
    font-weight: bold;
    color: var(--text-dark);
    margin: 5px 0;
    padding-left: 15px;
    position: relative;
}

.mindmap-node li::before {
    content: "▸";
    position: absolute;
    left: 0;
    color: var(--primary-color);
}

/* Mind Map Node Positions */
.node-1 { top: 50px; left: 50px; }
.node-2 { top: 50px; right: 50px; }
.node-3 { top: 200px; left: 20px; }
.node-4 { top: 200px; right: 20px; }
.node-5 { top: 350px; left: 50px; }
.node-6 { top: 350px; right: 50px; }
.node-7 { bottom: 200px; left: 20px; }
.node-8 { bottom: 200px; right: 20px; }
.node-9 { bottom: 50px; left: 50px; }
.node-10 { bottom: 50px; right: 50px; }

/* Questions and Solutions */
.question-container {
    margin-top: 30px;
}

.question {
    background: var(--text-light);
    border: 2px solid var(--primary-color);
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.solution-btn {
    background: var(--warning-color);
    color: var(--text-light);
    border: none;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 15px;
    transition: all 0.3s ease;
}

.solution-btn:hover {
    background: #d97706;
    transform: scale(1.05);
}

.solution {
    display: none;
    margin-top: 20px;
    padding: 20px;
    background: var(--light-bg);
    border-radius: 8px;
    border-left: 4px solid var(--success-color);
}

.solution.show {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Footer */
.footer {
    background: var(--dark-bg);
    color: var(--text-light);
    text-align: center;
    padding: 30px;
    margin-top: 50px;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.footer p {
    font-size: 18px;
    font-weight: bold;
    margin: 5px 0;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .header h1 {
        font-size: 32px;
    }
    
    .subtitle {
        font-size: 18px;
    }
    
    .section-title {
        font-size: 28px;
    }
    
    .sub-heading {
        font-size: 20px;
    }
    
    .nav-list {
        grid-template-columns: 1fr;
    }
    
    .content {
        padding: 20px;
    }
    
    .data-table {
        font-size: 14px;
    }
    
    .data-table th,
    .data-table td {
        padding: 10px;
    }
    
    .mindmap {
        padding: 20px;
        min-height: 1200px;
    }
    
    .mindmap-node {
        width: 180px;
        padding: 15px;
    }
    
    /* Adjust mind map nodes for mobile */
    .node-1 { top: 30px; left: 10px; }
    .node-2 { top: 30px; right: 10px; }
    .node-3 { top: 230px; left: 10px; }
    .node-4 { top: 230px; right: 10px; }
    .node-5 { top: 430px; left: 10px; }
    .node-6 { top: 430px; right: 10px; }
    .node-7 { top: 630px; left: 10px; }
    .node-8 { top: 630px; right: 10px; }
    .node-9 { top: 830px; left: 10px; }
    .node-10 { top: 830px; right: 10px; }
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white;
        padding: 0;
    }
    
    .content {
        box-shadow: none;
        max-width: 100%;
    }
    
    .section {
        page-break-inside: avoid;
        border-left: 3px solid var(--primary-color);
    }
    
    .data-table {
        page-break-inside: avoid;
    }
    
    .question {
        page-break-inside: avoid;
    }
    
    .solution {
        display: block !important;
    }
    
    .solution-btn {
        display: none;
    }
    
    .code-block {
        page-break-inside: avoid;
    }
    
    .flowchart {
        page-break-inside: avoid;
    }
    
    .mindmap {
        page-break-inside: avoid;
    }
    
    h2, h3 {
        page-break-after: avoid;
    }
}

/* Scroll Behavior */
html {
    scroll-behavior: smooth;
}

/* Selection Styling */
::selection {
    background: var(--primary-color);
    color: var(--text-light);
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section {
    animation: slideIn 0.5s ease;
}

/* Hover Effects */
.nav-btn,
.solution-btn,
.print-btn {
    position: relative;
    overflow: hidden;
}

.nav-btn::before,
.solution-btn::before,
.print-btn::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.nav-btn:hover::before,
.solution-btn:hover::before,
.print-btn:hover::before {
    width: 300px;
    height: 300px;
}

/* Strong Tag Styling */
strong {
    font-weight: 900;
    color: inherit;
}