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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

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

/* Navigation */
.navbar {
    background-color: #1a1a2e;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-brand a {
    color: #e94560;
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.nav-links a {
    color: #fff;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
    background-color: #e94560;
}

/* Hero Section */
.hero {
    background-color: #1a1a2e;
    color: #fff;
    padding: 4rem 2rem;
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
}

.hero-content {
    max-width: 500px;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #e94560;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    color: #ccc;
}

.btn-primary {
    background-color: #e94560;
    color: #fff;
    padding: 1rem 2rem;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    display: inline-block;
}

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

.btn-secondary {
    background-color: #16213e;
    color: #e94560;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    border-radius: 4px;
    border: 1px solid #e94560;
    display: inline-block;
    margin-top: 1rem;
}

.btn-secondary:hover {
    background-color: #e94560;
    color: #fff;
}

.hero-code {
    background-color: #0f0f23;
    border-radius: 8px;
    padding: 1.5rem;
    max-width: 500px;
    overflow-x: auto;
}

.hero-code pre {
    margin: 0;
}

.hero-code code {
    color: #50fa7b;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Course Units Grid */
.course-units {
    padding: 3rem 0;
}

.course-units h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
    color: #1a1a2e;
}

.units-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.unit-card {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    border-left: 4px solid #e94560;
}

.unit-card h3 {
    color: #e94560;
    margin-bottom: 0.5rem;
}

.unit-card h4 {
    color: #1a1a2e;
    margin-bottom: 1rem;
}

.unit-card ul {
    list-style: none;
    margin-bottom: 1rem;
}

.unit-card li {
    padding: 0.25rem 0;
    color: #666;
}

.unit-card li::before {
    content: "✓";
    color: #e94560;
    margin-right: 0.5rem;
}

.unit-card li a {
    color: #666;
    text-decoration: none;
}

.unit-card li a:hover {
    color: #e94560;
}

/* Why Java Section */
.why-java {
    padding: 3rem 0;
}

.why-java h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
    color: #1a1a2e;
}

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

.feature-card {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
}

.feature-card h3 {
    color: #1a1a2e;
    margin-bottom: 0.75rem;
}

.feature-card p {
    color: #666;
}

/* Unit Page Styles */
.unit-header {
    background-color: #1a1a2e;
    color: #fff;
    padding: 3rem 2rem;
    text-align: center;
}

.unit-header h1 {
    color: #e94560;
    margin-bottom: 0.5rem;
}

.unit-header p {
    color: #ccc;
}

.topics-nav {
    background: #fff;
    padding: 1rem 2rem;
    border-bottom: 1px solid #ddd;
    position: sticky;
    top: 60px;
    z-index: 100;
}

.topics-nav ul {
    display: flex;
    list-style: none;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.topics-nav a {
    color: #1a1a2e;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
}

.topics-nav a:hover {
    background-color: #e94560;
    color: #fff;
}

/* Content Sections */
.content-section {
    background: #fff;
    margin: 2rem auto;
    padding: 2rem;
    border-radius: 8px;
    max-width: 900px;
}

.content-section h2 {
    color: #e94560;
    border-bottom: 2px solid #e94560;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

.content-section h3 {
    color: #1a1a2e;
    margin: 1.5rem 0 1rem 0;
}

.content-section h4 {
    color: #333;
    margin: 1rem 0 0.5rem 0;
}

.content-section p {
    margin-bottom: 1rem;
    text-align: justify;
}

.content-section ul,
.content-section ol {
    margin: 1rem 0 1rem 2rem;
}

.content-section li {
    margin-bottom: 0.5rem;
}

/* Code Blocks */
.code-block {
    background-color: #1a1a2e;
    border-radius: 8px;
    margin: 1rem 0;
    overflow: hidden;
}

.code-header {
    background-color: #0f0f23;
    padding: 0.5rem 1rem;
    color: #888;
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.code-block pre {
    padding: 1rem;
    margin: 0;
    overflow-x: auto;
}

.code-block code {
    color: #50fa7b;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Syntax Highlighting */
.keyword { color: #ff79c6; }
.string { color: #f1fa8c; }
.comment { color: #6272a4; }
.number { color: #bd93f9; }
.annotation { color: #ffb86c; }

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

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

.data-table th {
    background-color: #1a1a2e;
    color: #fff;
}

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

/* Info Boxes */
.note-box {
    background-color: #e8f4fd;
    border-left: 4px solid #2196F3;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 0 4px 4px 0;
}

.note-box h4 {
    color: #2196F3;
    margin-bottom: 0.5rem;
}

.warning-box {
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 0 4px 4px 0;
}

.warning-box h4 {
    color: #856404;
    margin-bottom: 0.5rem;
}

.exam-tip {
    background-color: #d4edda;
    border-left: 4px solid #28a745;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 0 4px 4px 0;
}

.exam-tip h4 {
    color: #155724;
    margin-bottom: 0.5rem;
}

.common-mistake {
    background-color: #f8d7da;
    border-left: 4px solid #dc3545;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 0 4px 4px 0;
}

.common-mistake h4 {
    color: #721c24;
    margin-bottom: 0.5rem;
}

/* MCQ Styles */
.mcq-container {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.mcq-filter {
    background: #fff;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    text-align: center;
}

.mcq-filter select {
    padding: 0.5rem 1rem;
    font-size: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-left: 0.5rem;
}

.mcq-card {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-left: 4px solid #e94560;
}

.mcq-card .unit-tag {
    display: inline-block;
    background-color: #1a1a2e;
    color: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.mcq-card .question {
    font-weight: bold;
    margin-bottom: 1rem;
}

.mcq-card .options {
    list-style: none;
}

.mcq-card .option {
    padding: 0.5rem;
    margin: 0.25rem 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
}

.mcq-card .option:hover {
    background-color: #f8f9fa;
}

.mcq-card .option.correct {
    background-color: #d4edda;
    border-color: #28a745;
}

.mcq-card .option.incorrect {
    background-color: #f8d7da;
    border-color: #dc3545;
}

/* Practice Question Styles */
.practice-section {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.practice-card {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.practice-card h3 {
    color: #1a1a2e;
    margin-bottom: 0.5rem;
}

.difficulty-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-left: 0.5rem;
}

.difficulty-tag.easy {
    background-color: #d4edda;
    color: #155724;
}

.difficulty-tag.medium {
    background-color: #fff3cd;
    color: #856404;
}

.difficulty-tag.hard {
    background-color: #f8d7da;
    color: #721c24;
}

.solution-toggle {
    background-color: #e94560;
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 1rem;
}

.solution-toggle:hover {
    background-color: #d63851;
}

/* Details/Summary for Solutions */
details.solution {
    margin-top: 1rem;
    display: block;
}

details.solution summary {
    background-color: #e94560;
    color: #fff;
    padding: 0.75rem 1.25rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    list-style: none;
    display: inline-block;
    transition: background-color 0.3s ease;
}

details.solution summary::-webkit-details-marker {
    display: none;
}

details.solution summary::before {
    content: "▶ ";
    font-size: 0.8em;
}

details.solution[open] summary::before {
    content: "▼ ";
}

details.solution summary:hover {
    background-color: #d63851;
}

details.solution[open] summary {
    margin-bottom: 1rem;
    border-radius: 6px 6px 0 0;
}

details.solution .code-block {
    background-color: #1a1a2e;
    border-radius: 0 0 8px 8px;
    padding: 1.5rem;
    overflow-x: auto;
}

/* Theory Details Styling */
details.theory-item {
    background: #fff;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

details.theory-item summary {
    background-color: #16213e;
    color: #fff;
    padding: 1rem 1.5rem;
    cursor: pointer;
    font-weight: 600;
    list-style: none;
    transition: background-color 0.3s ease;
}

details.theory-item summary::-webkit-details-marker {
    display: none;
}

details.theory-item summary::before {
    content: "▶ ";
    font-size: 0.8em;
    margin-right: 0.5rem;
}

details.theory-item[open] summary::before {
    content: "▼ ";
}

details.theory-item summary:hover {
    background-color: #1a1a2e;
}

details.theory-item .answer {
    padding: 1.5rem;
    background-color: #f8f9fa;
    border-top: 3px solid #e94560;
}

details.theory-item .answer p {
    margin-bottom: 0.75rem;
}

details.theory-item .answer p:last-child {
    margin-bottom: 0;
}

details.theory-item .answer ul {
    margin-left: 1.5rem;
    margin-bottom: 0.75rem;
}

details.theory-item .answer table {
    width: 100%;
    margin-top: 0.5rem;
}

/* Error Guide Styles */
.error-card {
    background: #fff;
    border-radius: 8px;
    margin-bottom: 2rem;
    overflow: hidden;
}

.error-header {
    background-color: #dc3545;
    color: #fff;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.error-header h3 {
    margin: 0;
}

.error-frequency {
    background-color: rgba(255,255,255,0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

.error-content {
    padding: 1.5rem;
}

.error-cause,
.error-fix {
    margin-bottom: 1rem;
}

.error-cause h4,
.error-fix h4 {
    margin-bottom: 0.5rem;
}

/* Theory Section */
.theory-section {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.theory-unit {
    background: #fff;
    border-radius: 8px;
    margin-bottom: 2rem;
    overflow: hidden;
}

.theory-unit h3 {
    background-color: #1a1a2e;
    color: #e94560;
    padding: 1rem;
    margin: 0;
}

.theory-questions {
    padding: 1rem;
}

.theory-question {
    padding: 1rem;
    border-bottom: 1px solid #eee;
}

.theory-question:last-child {
    border-bottom: none;
}

.theory-question h4 {
    color: #1a1a2e;
    margin-bottom: 0.5rem;
    cursor: pointer;
}

.theory-question h4:hover {
    color: #e94560;
}

/* Navigation Buttons */
.nav-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    padding: 2rem;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.nav-btn {
    background-color: #1a1a2e;
    color: #fff;
    padding: 1rem 2rem;
    text-decoration: none;
    border-radius: 4px;
}

.nav-btn:hover {
    background-color: #e94560;
}

/* Footer */
footer {
    background-color: #1a1a2e;
    color: #fff;
    padding: 3rem 2rem 1rem;
    margin-top: 3rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.footer-section h3 {
    color: #e94560;
    margin-bottom: 1rem;
}

.footer-section h4 {
    color: #fff;
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #ccc;
    text-decoration: none;
}

.footer-section a:hover {
    color: #e94560;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    margin-top: 2rem;
    border-top: 1px solid #333;
    color: #888;
}

/* Responsive Design */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-links {
        justify-content: center;
    }
    
    .hero {
        flex-direction: column;
        text-align: center;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero-code {
        width: 100%;
    }
    
    .nav-buttons {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-btn {
        text-align: center;
    }
}
