

/* Shared CSS for AI Tutorial Website */

/* Base Styles */
body {
    font-family: "Hoefler Text", "Times New Roman", serif;
    line-height: 1.4;
    margin: 0;
    padding: 0;
    background: #3C444C;
    color: #f0f0f0; /* Increased contrast */
    font-size: 18px;
    display: flex;
}

.sidebar {
    width: 280px;
    background: #2d333a;
    min-height: 100vh;
    padding: 20px;
    border-right: 1px solid #555;
    position: fixed;
    left: 0;
    top: 0;
    overflow-y: auto;
}

.main-content {
    margin-left: 320px;
    flex: 1;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
}

/* Table of Contents */
.toc {
    margin-bottom: 30px;
}

.toc-title {
    font-family: "Menlo", "Monaco", monospace;
    font-size: 18px;
    font-weight: bold;
    color: #f0f0f0; /* Increased contrast */
    margin-bottom: 15px;
    border-bottom: 1px solid #555;
    padding-bottom: 10px;
}

.toc-item {
    margin-bottom: 8px;
}

.toc-link {
    color: #cccccc; /* Increased contrast */
    text-decoration: none;
    font-size: 14px;
    display: block;
    padding: 5px 0;
    border-left: 3px solid transparent;
    padding-left: 10px;
    transition: all 0.2s;
}

.toc-link:hover {
    color: #6495ED; /* Brighter link color */
    border-left-color: #6495ED;
}

.toc-link.active {
    color: #6495ED; /* Brighter link color */
    border-left-color: #6495ED;
    background-color: rgba(100, 149, 237, 0.1);
}

.toc-section {
    margin-bottom: 20px;
}

.toc-chapter {
    font-weight: bold;
    color: #f0f0f0; /* Increased contrast */
    margin-bottom: 5px;
}

/* Top Bar */
.top-bar {
    position: relative;
    padding: 20px 0;
    border-bottom: 1px solid #555;
}

.lang-selector {
    position: absolute;
    top: 20px;
    right: 0;
}

.lang-button {
    background-color: #555;
    color: #f0f0f0; /* Increased contrast */
    border: none;
    padding: 8px 16px;
    margin: 0 3px;
    cursor: pointer;
    font-size: 14px;
    font-family: "Menlo", "Monaco", monospace;
    border-radius: 3px;
    transition: background-color 0.2s;
}

.lang-button:hover {
    background-color: #666;
}

.lang-button.active {
    background-color: #6495ED; /* Brighter link color */
    color: white;
}

.nav-link {
    color: #6495ED; /* Brighter link color */
    text-decoration: none;
    font-family: "Menlo", "Monaco", monospace;
    font-size: 14px;
}

.nav-link:hover {
    text-decoration: underline;
}

/* Header */
.header {
    text-align: left;
    margin: 40px 0;
    padding-bottom: 30px;
    border-bottom: 1px solid #555;
}

.site-title {
    font-family: "Menlo", "Monaco", monospace;
    font-size: 32px;
    font-weight: bold;
    color: #f0f0f0; /* Increased contrast */
    margin: 0 0 15px 0;
    text-decoration: none;
    letter-spacing: -1px;
}

.site-title:hover {
    color: #6495ED; /* Brighter link color */
}

.subtitle {
    font-family: "Hoefler Text", "Times New Roman", serif;
    font-size: 16px;
    color: #cccccc; /* Increased contrast */
    font-style: italic;
    margin: 0;
}

/* Content */
.content {
    margin-bottom: 40px;
}

.intro {
    font-size: 16px;
    line-height: 1.5;
    color: #f0f0f0; /* Increased contrast */
    margin-bottom: 40px;
    font-family: "Hoefler Text", "Times New Roman", serif;
}

/* Post Card */
.post-card {
    background: #4a5259;
    padding: 30px;
    margin-bottom: 0;
    border: 1px solid #555;
    border-radius: 8px;
}

.post-card .header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid #666;
}

.post-card .title {
    font-family: "Menlo", "Monaco", monospace;
    font-size: 24px;
    font-weight: bold;
    color: #f0f0f0; /* Increased contrast */
    margin-bottom: 12px;
}

.post-card .subtitle {
    font-family: "Hoefler Text", "Times New Roman", serif;
    font-size: 16px;
    color: #cccccc; /* Increased contrast */
    margin-bottom: 4px;
    font-weight: normal;
    font-style: italic;
}

/* Section */
.section {
    margin-bottom: 30px;
    padding: 0;
    background: none;
    border-radius: 0;
    border-left: none;
}

.section-title {
    font-family: "Menlo", "Monaco", monospace;
    font-size: 18px;
    font-weight: bold;
    color: #f0f0f0; /* Increased contrast */
    margin-bottom: 15px;
    border-bottom: 1px solid #666;
    padding-bottom: 10px;
}

.content-text {
    font-family: "Hoefler Text", "Times New Roman", serif;
    font-size: 15px;
    line-height: 1.5;
    color: #f0f0f0; /* Increased contrast */
    margin-bottom: 15px;
}

/* Footer */
.footer {
    margin-top: 80px;
    padding: 40px 0;
    border-top: 1px solid #555;
    text-align: center;
    color: #888;
    font-size: 16px;
}

.footer a {
    color: #6495ED; /* Brighter link color */
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* Charts and Demos */
.chart-container, .demo-container {
    background: #515960;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    border: 1px solid #666;
}

.coordinates-demo, .input-output, .word-transformation {
    display: flex;
    align-items: center;
    justify-content: space-around;
    margin: 20px 0;
    flex-wrap: wrap;
}

.location-box, .word-box, .io-box {
    background: #6495ED; /* Brighter link color */
    color: white;
    padding: 20px 24px;
    border-radius: 6px;
    font-family: "Menlo", "Monaco", monospace;
    font-weight: bold;
    text-align: center;
    margin: 10px;
    min-width: 140px;
}

.input-box {
    background: #e74c3c;
}

.output-box {
    background: #27ae60;
}

.vector-box, .function-box {
    background: #3C444C;
    color: #f0f0f0; /* Increased contrast */
    padding: 20px;
    border-radius: 6px;
    font-family: "Menlo", "Monaco", monospace;
    font-size: 14px;
    text-align: center;
    border: 1px solid #777;
    margin: 10px;
    min-width: 160px;
}

.arrow {
    font-size: 28px;
    color: #6495ED; /* Brighter link color */
    font-weight: bold;
    margin: 0 15px;
}

/* Highlight Box */
.highlight-box {
    background: #515960;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
    border: 1px solid #666;
}

.highlight-text {
    font-family: "Menlo", "Monaco", monospace;
    font-size: 16px;
    font-weight: bold;
    color: #f0f0f0; /* Increased contrast */
    margin-bottom: 12px;
}

/* Word Groups and Similarity Demo */
.similarity-demo {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin: 25px 0;
}

.word-group {
    background: #3C444C;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #777;
    text-align: center;
}

.group-title {
    font-family: "Menlo", "Monaco", monospace;
    font-weight: bold;
    color: #f0f0f0; /* Increased contrast */
    margin-bottom: 15px;
    font-size: 16px;
}

.word-item {
    background: #6495ED; /* Brighter link color */
    color: white;
    padding: 8px 14px;
    border-radius: 4px;
    margin: 6px;
    display: inline-block;
    font-family: "Menlo", "Monaco", monospace;
    font-size: 14px;
    font-weight: bold;
}

/* Process Flow */
.process-flow {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin: 25px 0;
}

.process-step {
    background: #3C444C;
    color: #f0f0f0; /* Increased contrast */
    padding: 20px 30px;
    border-radius: 6px;
    border: 1px solid #777;
    text-align: center;
    width: 85%;
    font-family: "Hoefler Text", "Times New Roman", serif;
    font-weight: normal;
}

/* Learning Steps */
.learning-steps {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin: 25px 0;
}

.learning-step {
    background: #3C444C;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #777;
    text-align: center;
}

.step-number {
    font-family: "Menlo", "Monaco", monospace;
    font-weight: bold;
    color: #6495ED; /* Brighter link color */
    margin-bottom: 10px;
    font-size: 18px;
}

/* Tips */
.tips {
    background: #515960;
    border-radius: 8px;
    padding: 20px;
    margin-top: 30px;
    border: 1px solid #666;
}

.tips-title {
    font-family: "Menlo", "Monaco", monospace;
    font-weight: bold;
    color: #f0f0f0; /* Increased contrast */
    margin-bottom: 15px;
    font-size: 16px;
}

.tips-text {
    font-family: "Hoefler Text", "Times New Roman", serif;
    font-size: 15px;
    line-height: 1.5;
    color: #f0f0f0; /* Increased contrast */
    margin-bottom: 10px;
}

/* To Be Continued */
.to-be-continued {
    text-align: center;
    margin: 40px 0 30px 0;
    padding: 25px;
    background: #515960;
    border-radius: 8px;
    border: 1px solid #666;
}

.continued-text {
    font-family: "Menlo", "Monaco", monospace;
    font-size: 18px;
    font-weight: bold;
    color: #f0f0f0; /* Increased contrast */
    font-style: italic;
}

/* Special styles for math examples and parameters */
.parameter-demo {
    background: #2c3338;
    padding: 20px;
    border-radius: 6px;
    margin: 15px 0;
    font-family: "Menlo", "Monaco", monospace;
    font-size: 14px;
    border: 1px solid #555;
}

.math-example {
    background: #3C444C;
    padding: 20px;
    border-radius: 6px;
    margin: 15px 0;
    font-family: "Menlo", "Monaco", monospace;
    font-size: 16px;
    border: 1px solid #777;
    text-align: center;
}

/* Chinese version specific styles */
#zh-content .process-step {
    border-radius: 8px;
    border: 2px solid #6495ED; /* Brighter link color */
    font-weight: 500;
}

#zh-content .tips {
    background: #515960;
    border-radius: 8px;
}

#zh-content .tips-title {
    font-weight: bold;
    color: #f0f0f0; /* Increased contrast */
}

#zh-content .tips-text {
    color: #f0f0f0; /* Increased contrast */
}

/* Language content visibility */
.intro-en, .intro-zh, .intro-fr,
#en-content, #zh-content, #fr-content {
    display: none;
}

.intro-en.active, .intro-zh.active, .intro-fr.active,
#en-content.active, #zh-content.active, #fr-content.active {
    display: block;
}

/* TOC content visibility */
.toc-content {
    display: none;
}

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


/* Responsive Design */
@media (max-width: 768px) {
    body {
        display: block;
    }
    
    .sidebar {
        position: static;
        width: 100%;
        min-height: auto;
        border-right: none;
        border-bottom: 1px solid #555;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .container {
        padding: 0 20px;
    }
    
    .site-title {
        font-size: 26px;
    }
    
    .intro {
        font-size: 15px;
    }

    .lang-selector {
        position: static;
        text-align: center;
        margin-bottom: 20px;
    }
    
    .similarity-demo {
        grid-template-columns: 1fr;
    }
    
    .coordinates-demo,
    .word-transformation,
    .input-output {
        flex-direction: column;
    }
    
    .arrow {
        transform: rotate(90deg);
        margin: 15px 0;
    }
}

@media (max-width: 600px) {
    .similarity-demo {
        grid-template-columns: 1fr;
    }
    
    .coordinates-demo,
    .word-transformation {
        flex-direction: column;
    }
    
    .arrow {
        transform: rotate(90deg);
        margin: 15px 0;
    }
}

@media (max-width: 480px) {
    .site-title {
        font-size: 22px;
    }
    
    .subtitle {
        font-size: 14px;
    }
    
    .post-card .title {
        font-size: 20px;
    }
    
    .section-title {
        font-size: 16px;
    }
    
    .content-text {
        font-size: 14px;
    }
}

/* Chapter 4 Specific Styles */
.example-box {
    background: #515960;
    border: 1px solid #666;
    padding: 20px;
    margin: 20px 0;
    border-radius: 8px;
    position: relative;
}

.example-box::before {
    content: "💡 Example";
    position: absolute;
    top: -10px;
    left: 20px;
    background: #6495ED;
    color: white;
    padding: 5px 15px;
    border-radius: 15px;
    font-size: 0.9em;
    font-weight: bold;
}

.masked-text {
    background: #2d3748;
    color: white;
    padding: 15px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    margin: 15px 0;
    position: relative;
}

.hidden {
    background: #e53e3e;
    color: #e53e3e;
    border-radius: 4px;
    padding: 2px 8px;
    margin: 0 2px;
}

.visible {
    background: #38a169;
    color: white;
    border-radius: 4px;
    padding: 2px 8px;
    margin: 0 2px;
}

.prediction {
    background: #3182ce;
    color: white;
    border-radius: 4px;
    padding: 2px 8px;
    margin: 0 2px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.step-flow {
    display: flex;
    align-items: center;
    margin: 20px 0;
    flex-wrap: wrap;
    gap: 10px;
}

.step {
    background: #667eea;
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: bold;
}

.comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 20px 0;
}

.vs-item {
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    background: #515960;
    border: 1px solid #666;
}

.human {
    /* background is now on .vs-item */
    border: none;
}

.ai {
    /* background is now on .vs-item */
    border: none;
}

.daily-life {
    background: #515960;
    padding: 25px;
    border-radius: 8px;
    margin: 30px 0;
    border: 1px solid #666;
}

.daily-life h3 {
    color: #f0f0f0; /* Adjusted for contrast */
    margin-top: 0;
}

ul {
    list-style: none;
    padding-left: 0;
}

li {
    margin: 10px 0;
    padding-left: 25px;
    position: relative;
}

li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: #667eea;
    font-weight: bold;
}

@media (max-width: 600px) {
    .comparison {
        grid-template-columns: 1fr;
    }
    
    .step-flow {
        flex-direction: column;
        text-align: center;
    }
    
    .arrow {
        transform: rotate(90deg);
    }
}
