/* styles.css */

body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background-color: #0D0D0D; /* Dark background */
    color: #F5F5DC; /* White text */
}

header, footer {
    background-color: #1A1A1A;
    color: #F5F5DC;
    text-align: center;
    padding: 1em 0;
}

main {
    padding: 20px;
}

h1, h2 {
    text-align: center;
    color: #FFD700; /* Gold color for headings */
}

#explanation, #pseudocode, #visualization, #traversal-path {
    margin-bottom: 40px;
}

#tree-diagram {
    display: block;
    margin: 0 auto;
    background-color: #1A1A1A;
    border: 1px solid #333;
}

.node circle {
    fill: #1E90FF;
    stroke: #FFFFFF;
    stroke-width: 1px;
}

.node text {
    font-size: 14px;
    text-anchor: middle;
    fill: #FFFFFF;
}

.link {
    fill: none;
    stroke: #FFFFFF;
    stroke-width: 2px;
}

.highlighted {
    fill: #FFD700 !important; /* Highlighted node color */
}

#start-dfs {
    display: block;
    margin: 20px auto;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    background-color: #FFD700;
    border: none;
    border-radius: 5px;
    color: #000000;
}

#start-dfs:hover {
    background-color: #FFC200;
}

#start-bfs {
    display: block;
    margin: 20px auto;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    background-color: #FFD700;
    border: none;
    border-radius: 5px;
    color: #000000;
}

#start-bfs:hover {
    background-color: #FFC200;
}

#path-output {
    font-size: 18px;
    text-align: center;
    color: #FFFFFF;
}

p {
    line-height: 1.6;
}

pre {
    background-color: #1A1A1A;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    color: #FFFFFF;
}

code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 16px;
    color: #00FF7F; /* Light green code color */
}

#pseudocode h2 {
    margin-bottom: 10px;
}


/* Existing styles remain unchanged */

/* Add the following styles for the navigation bar */

nav {
    background-color: #1A1A1A;
    text-align: center;
    padding: 10px 0;
}

nav ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
}

nav li {
    display: inline;
    margin: 0 15px;
}

nav a {
    color: #FFFFFF;
    text-decoration: none;
    font-size: 18px;
}

nav a:hover {
    color: #FFD700;
}


#union-find-diagram {
    border: 1px solid #ccc;
    margin: 20px auto;
    display: block;
}

button {
    display: block;
    margin: 20px auto;
    padding: 10px 20px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

button:hover {
    background-color: #45a049;
}


/* LeetCode Questions Section - Updated for Dark Theme */
#leetcode-questions {
    margin-top: 20px;
    padding: 20px;
    background-color: #1A1A1A; /* Match the dark background */
    border: 1px solid #333; /* Match existing section borders */
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5); /* Subtle shadow for depth */
}

#leetcode-questions h2 {
    color: #FFD700; /* Gold color to match other headings */
    margin-bottom: 20px;
    font-size: 24px;
    text-align: center;
}

#leetcode-questions article {
    margin-bottom: 30px;
    padding: 15px;
    background-color: #0D0D0D; /* Slightly darker for contrast */
    border-radius: 8px;
    border: 1px solid #333;
}

#leetcode-questions article h3 {
    color: #FFD700; /* Gold for consistency */
    margin-bottom: 10px;
    font-size: 20px;
    text-align: left;
}

#leetcode-questions article h3:hover {
    text-decoration: underline;
    cursor: pointer;
    color: #FFC200; /* Lighter gold on hover */
}

#leetcode-questions .visual-container {
    margin: 15px auto;
    text-align: center;
}

#leetcode-questions svg {
    border: 1px solid #333;
    background-color: #1A1A1A; /* Match section background */
    border-radius: 5px;
}

#leetcode-questions pre {
    background-color: #1A1A1A; /* Dark theme for code blocks */
    color: #00FF7F; /* Light green code text */
    padding: 15px;
    border: 1px solid #333;
    border-radius: 5px;
    overflow-x: auto;
    font-size: 14px;
    line-height: 1.6;
}

#leetcode-questions pre code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    color: #FFFFFF; /* White code text */
}

/* Chapter Structure Styles */
.chapters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.chapter-card, .chapter-preview {
    background-color: #1A1A1A;
    border: 1px solid #333;
    border-radius: 10px;
    padding: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.chapter-card:hover, .chapter-preview:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(255, 215, 0, 0.3);
    border-color: #FFD700;
}

.chapter-card h3, .chapter-preview h3 {
    color: #FFD700;
    margin-top: 0;
    margin-bottom: 10px;
}

.chapter-card h3 a, .chapter-preview h3 a {
    color: #FFD700;
    text-decoration: none;
}

.chapter-card h3 a:hover, .chapter-preview h3 a:hover {
    color: #FFC200;
    text-decoration: underline;
}

.chapter-card ul {
    list-style-type: none;
    padding-left: 0;
    margin-top: 15px;
}

.chapter-card ul li {
    margin: 8px 0;
    padding-left: 20px;
    position: relative;
}

.chapter-card ul li:before {
    content: "→";
    position: absolute;
    left: 0;
    color: #FFD700;
}

.chapter-card ul li a {
    color: #F5F5DC;
    text-decoration: none;
}

.chapter-card ul li a:hover {
    color: #FFD700;
}

.chapter-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 30px 0;
    padding: 15px;
    background-color: #1A1A1A;
    border-radius: 5px;
}

.chapter-nav a {
    color: #FFD700;
    text-decoration: none;
    padding: 8px 15px;
    border: 1px solid #333;
    border-radius: 5px;
    transition: background-color 0.2s;
}

.chapter-nav a:hover {
    background-color: #2A2A2A;
    border-color: #FFD700;
}

.chapter-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.chapter-content h1 {
    font-size: 2.5em;
    margin-bottom: 30px;
    text-align: left;
}

.chapter-content section {
    margin-bottom: 40px;
}

.chapter-content section h2 {
    color: #FFD700;
    font-size: 1.8em;
    margin-bottom: 15px;
    border-bottom: 2px solid #333;
    padding-bottom: 10px;
}

.chapter-content section h3 {
    color: #FFC200;
    font-size: 1.4em;
    margin-top: 25px;
    margin-bottom: 10px;
}

.complexity-table, .comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background-color: #1A1A1A;
}

.complexity-table th, .comparison-table th {
    background-color: #2A2A2A;
    color: #FFD700;
    padding: 12px;
    text-align: left;
    border: 1px solid #333;
}

.complexity-table td, .comparison-table td {
    padding: 10px 12px;
    border: 1px solid #333;
    color: #F5F5DC;
}

.complexity-table tr:nth-child(even), .comparison-table tr:nth-child(even) {
    background-color: #0D0D0D;
}

.cta-section {
    text-align: center;
    margin: 40px 0;
    padding: 30px;
    background-color: #1A1A1A;
    border-radius: 10px;
    border: 2px solid #FFD700;
}

.cta-section h3 {
    margin-bottom: 10px;
}

.cta-section h3 a {
    color: #FFD700;
    text-decoration: none;
    font-size: 1.5em;
}

.cta-section h3 a:hover {
    color: #FFC200;
    text-decoration: underline;
}

#reading-order {
    margin-top: 40px;
    padding: 20px;
    background-color: #1A1A1A;
    border-radius: 10px;
}

#reading-order ol {
    line-height: 2;
}

#reading-order ol li {
    margin: 10px 0;
}

#reading-order ol li a {
    color: #FFD700;
    text-decoration: none;
}

#reading-order ol li a:hover {
    text-decoration: underline;
}

