/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f8fafc;
}

/* Layout Container */
.learn-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.learn-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.back-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    transition: background 0.3s ease;
}

.back-link:hover {
    background: rgba(255, 255, 255, 0.1);
}

.header-title h1 {
    font-size: 1.8em;
    margin-bottom: 5px;
}

.header-title p {
    opacity: 0.9;
    font-size: 0.95em;
}

.progress-indicator {
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 200px;
}

.progress-bar {
    width: 150px;
    height: 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: white;
    width: 5%;
    transition: width 0.3s ease;
    border-radius: 3px;
}

/* Main Layout */
.learn-layout {
    display: flex;
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Sidebar */
.sidebar {
    width: 320px;
    background: white;
    border-right: 2px solid #e2e8f0;
    position: sticky;
    top: 80px;
    height: calc(100vh - 80px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e0 transparent;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

.sidebar-content {
    padding: 30px 20px;
}

.sidebar h3 {
    color: #2d3748;
    margin-bottom: 20px;
    font-size: 1.2em;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
}

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

.nav-section {
    margin-bottom: 25px;
}

.nav-section h4 {
    color: #4a5568;
    font-size: 0.95em;
    margin-bottom: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-items {
    list-style: none;
}

.nav-items li {
    margin-bottom: 8px;
}

.nav-link {
    display: block;
    color: #666;
    text-decoration: none;
    padding: 10px 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 0.9em;
    border-left: 3px solid transparent;
}

.nav-link:hover {
    background: #f7fafc;
    color: #667eea;
    border-left-color: #667eea;
}

.nav-link.active {
    background: #667eea;
    color: white;
    border-left-color: #5a67d8;
    font-weight: 500;
}

.sidebar-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #e2e8f0;
}

.platform-indicator {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.platform-badge {
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.8em;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid #e2e8f0;
    background: white;
}

.platform-badge.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.sidebar-note {
    font-size: 0.8em;
    color: #666;
    line-height: 1.4;
}

/* Main Content */
.content {
    flex: 1;
    padding: 30px;
    min-width: 0;
}

.content-section {
    display: none;
    max-width: 800px;
}

.content-section.active {
    display: block;
}

.section-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e2e8f0;
}

.section-header h2 {
    color: #2d3748;
    font-size: 2.2em;
    margin-bottom: 15px;
}

.section-meta {
    display: flex;
    gap: 15px;
    align-items: center;
}

.difficulty {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
}

.difficulty.beginner {
    background: #c6f6d5;
    color: #2f855a;
}

.difficulty.intermediate {
    background: #fed7d7;
    color: #c53030;
}

.difficulty.advanced {
    background: #e9d8fd;
    color: #6b46c1;
}

.duration {
    color: #666;
    font-size: 0.9em;
}

/* Content Elements */
.intro-overview {
    background: linear-gradient(135deg, #f0f4ff 0%, #e0e7ff 100%);
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 30px;
    border-left: 4px solid #667eea;
}

.intro-overview h3 {
    color: #2d3748;
    margin-bottom: 15px;
    font-size: 1.4em;
}

.intro-overview p {
    color: #4a5568;
    font-size: 1.05em;
}

.key-concepts {
    margin-bottom: 30px;
}

.key-concepts h3 {
    color: #2d3748;
    margin-bottom: 20px;
    font-size: 1.3em;
}

.concept-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.concept-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border: 2px solid #f7fafc;
    transition: all 0.3s ease;
}

.concept-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    border-color: #667eea;
}

.concept-icon {
    font-size: 2em;
    margin-bottom: 15px;
}

.concept-card h4 {
    color: #2d3748;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.concept-card p {
    color: #666;
    font-size: 0.9em;
    line-height: 1.5;
}

/* Architecture Diagram */
.architecture-diagram {
    margin: 30px 0;
}

.architecture-diagram h3 {
    color: #2d3748;
    margin-bottom: 20px;
    font-size: 1.3em;
}

.diagram-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.diagram-box {
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    min-width: 120px;
    border: 2px solid #e2e8f0;
    background: white;
}

.diagram-box.host {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.diagram-box.client {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    border-color: #48bb78;
}

.diagram-box.server {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
    color: white;
    border-color: #ed8936;
}

.diagram-box.data {
    background: linear-gradient(135deg, #9f7aea 0%, #805ad5 100%);
    color: white;
    border-color: #9f7aea;
}

.diagram-box h4 {
    font-size: 1em;
    margin-bottom: 5px;
    font-weight: 600;
}

.diagram-box p {
    font-size: 0.8em;
    opacity: 0.9;
}

.diagram-arrow {
    font-size: 1.5em;
    color: #667eea;
    font-weight: bold;
}

/* Platform Tabs */
.platform-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.platform-tab {
    padding: 12px 20px;
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.platform-tab.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.platform-content {
    display: none;
}

.platform-content.active {
    display: block;
}

/* Step Cards */
.step-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border-left: 4px solid #667eea;
}

.step-card h4 {
    color: #2d3748;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.step-card p {
    color: #666;
    margin-bottom: 15px;
}

.step-card ol,
.step-card ul {
    margin-left: 20px;
    color: #555;
}

.step-card li {
    margin-bottom: 8px;
}

/* Code Blocks */
.code-block {
    background: #1a202c;
    border-radius: 8px;
    padding: 20px;
    margin: 15px 0;
    overflow-x: auto;
}

.code-block pre {
    color: #e2e8f0;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.9em;
    line-height: 1.4;
}

.code-block code {
    color: #e2e8f0;
}

/* Special Elements */
.info-box {
    background: linear-gradient(135deg, #e6fffa 0%, #b2f5ea 100%);
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid #38b2ac;
    margin: 20px 0;
}

.info-box h4 {
    color: #2d3748;
    margin-bottom: 10px;
}

.warning-box {
    background: linear-gradient(135deg, #fed7d7 0%, #feb2b2 100%);
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid #e53e3e;
    margin: 20px 0;
}

.warning-box p {
    color: #742a2a;
    font-weight: 500;
}

.warning-box ul {
    margin-left: 20px;
    color: #742a2a;
}

.download-section {
    text-align: center;
    margin: 20px 0;
}

.download-button {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 30px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.download-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.download-note {
    margin-top: 10px;
    color: #666;
    font-size: 0.9em;
}

.config-path {
    background: #f7fafc;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    border-left: 3px solid #667eea;
}

.config-path code {
    background: #e2e8f0;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
}

.config-explanation {
    background: #f0f4ff;
    padding: 20px;
    border-radius: 8px;
    margin-top: 15px;
}

.config-explanation h4 {
    color: #2d3748;
    margin-bottom: 15px;
}

.config-explanation ul {
    margin-left: 20px;
}

.config-explanation li {
    margin-bottom: 8px;
    color: #555;
}

/* Troubleshooting */
.troubleshooting {
    margin: 30px 0;
}

.troubleshooting h3 {
    color: #2d3748;
    margin-bottom: 20px;
    font-size: 1.3em;
}

.troubleshooting-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.trouble-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border-left: 4px solid #f56565;
}

.trouble-card h4 {
    color: #2d3748;
    margin-bottom: 15px;
    font-size: 1.1em;
}

.trouble-card ul {
    margin-left: 20px;
    color: #555;
}

.trouble-card li {
    margin-bottom: 8px;
}

/* Benefits List */
.benefits-list {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    margin: 20px 0;
}

.benefits-list li {
    margin-bottom: 15px;
    padding-left: 10px;
    border-left: 3px solid #48bb78;
    background: #f0fff4;
    padding: 10px;
    border-radius: 6px;
}

/* Next Steps / CTA */
.next-steps, .cta-section {
    text-align: center;
    margin: 40px 0;
    padding: 30px;
    background: linear-gradient(135deg, #f0f4ff 0%, #e0e7ff 100%);
    border-radius: 12px;
}

.cta-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 25px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.cta-note {
    margin-top: 15px;
    color: #666;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .learn-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: static;
        border-right: none;
        border-bottom: 2px solid #e2e8f0;
    }

    .sidebar-content {
        padding: 20px;
    }

    .nav-list {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 20px;
    }

    .concept-grid {
        grid-template-columns: 1fr;
    }

    .diagram-container {
        flex-direction: column;
        gap: 10px;
    }

    .diagram-arrow {
        transform: rotate(90deg);
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .progress-indicator {
        justify-content: center;
    }

    .content {
        padding: 20px;
    }

    .section-header h2 {
        font-size: 1.8em;
    }

    .platform-tabs {
        flex-direction: column;
    }

    .troubleshooting-grid {
        grid-template-columns: 1fr;
    }

    .nav-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .learn-header {
        padding: 15px 0;
    }

    .header-title h1 {
        font-size: 1.5em;
    }

    .content {
        padding: 15px;
    }

    .step-card {
        padding: 20px;
    }

    .code-block {
        padding: 15px;
        font-size: 0.8em;
    }
}

/* Print Styles */
@media print {
    .sidebar {
        display: none;
    }

    .learn-header {
        background: none;
        color: black;
        box-shadow: none;
    }

    .content {
        padding: 0;
    }

    .code-block {
        background: #f5f5f5;
        border: 1px solid #ddd;
    }

    .code-block pre {
        color: black;
    }
}