:root {
    /* Default theme (coffee) */
    --background: #f5f0e8;
    --card-background: #ffffff;
    --graph-background: #fcfaf7;
    --primary-text: #6b4423;
    --secondary-text: #a18869;
    --tertiary-text: #8b7355;
    --border: #e6d5c3;
    --shadow: rgba(149, 127, 107, 0.2);
    --light-shadow: rgba(149, 127, 107, 0.1);
    --accent: #ff9900;
    --node-level-1: #8b5e3c;
    --node-level-2: #a18869;
    --node-level-3: #c4b5a0;
    --coffee-stain: rgba(181, 136, 99, 0.08);
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--background);
    font-family: 'Georgia', serif;
    overflow: hidden; /* Prevent body scrolling */
    height: 100vh;
    width: 100vw;
}

.container {
    display: flex;
    width: 100%;
    height: 100vh;
    padding: 0; /* Remove padding for edge-to-edge */
    box-sizing: border-box;
}

/* Left side - Concept Map */
.concept-map {
    flex: 1;
    background: var(--card-background);
    border-radius: 15px;
    box-shadow: 0 8px 24px var(--shadow),
        0 2px 6px var(--light-shadow);
    padding: 2rem;
    position: relative;
    overflow: hidden;
    margin: 2em;
    margin-right: 1em;
    /* max-width: 35%; */
    min-height: 700px;
}

.concept-content {
    position: relative;
    z-index: 2;
    height: 100%;
}

#graph {
    width: 100%;
    height: calc(100% - 60px);
    background: var(--graph-background);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.node circle {
    stroke: var(--card-background);
    stroke-width: 2px;
}

.node text {
    font-family: 'Georgia', serif;
    font-size: 12px;
    fill: var(--primary-text);
}

.link {
    stroke: var(--border);
    stroke-opacity: 0.6;
}

/* .legend {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--card-background);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem;
}

.legend-item {
    display: flex;
    align-items: center;
    margin: 0.25rem 0;
    font-size: 0.8rem;
    color: var(--primary-text);
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 0.5rem;
} */

/* Right side - Notes Container */
.notes-container {
    flex: 1;
    overflow-y: auto; /* Enable vertical scrolling */
    padding: 2em; /* Add padding inside */
    padding-left: 1em;
    height: 100vh;
    box-sizing: border-box;
}

/* Scrollbar styling */
.notes-container::-webkit-scrollbar {
    width: 10px;
}

.notes-container::-webkit-scrollbar-track {
    background: var(--background);
    border-radius: 5px;
}

.notes-container::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 5px;
}

.notes-container::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-text);
}

/* Firefox scrollbar */
.notes-container {
    scrollbar-width: thin;
    scrollbar-color: var(--border) var(--background);
}

/* Individual anki-card */
.anki-card {
    background: var(--card-background);
    border-radius: 15px;
    box-shadow: 0 8px 24px var(--shadow),
        0 2px 6px var(--light-shadow);
    padding: 2rem;
    position: relative;
    overflow: hidden;
    margin-bottom: 1rem; /* Space between cards */
    min-height: auto; /* Remove fixed height */
}

.anki-card:last-child {
    margin-bottom: 0;
}

.card-content {
    position: relative;
    z-index: 2;
}

.coffee-stain {
    position: absolute;
    top: -50px;
    right: -50px;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: var(--coffee-stain);
    transform: rotate(-15deg);
}

p {
    color: var(--primary-text);
}

h1,h2,h3,h4,h5,h6 {
    color: var(--primary-text);
    /* font-size: 1.2rem; */
    /* margin-bottom: 1.5rem; */
    margin: 0;
    /* border-bottom: 2px solid var(--border); */
    padding-bottom: 0.5rem;
}

hr {
    border: 1px solid var(--border);
}

.graph-container {
    margin: 20px 0;
    text-align: center;
}

canvas {
    background-color: var(--graph-background);
    border-radius: 8px;
    box-shadow: inset 0 2px 4px var(--light-shadow);
}

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

.slider-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 10px 0;
}

input[type="range"] {
    width: 200px;
    height: 6px;
    -webkit-appearance: none;
    background: var(--border);
    border-radius: 3px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary-text);
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.15s ease-in-out;
}

input[type="range"]::-webkit-slider-thumb:hover {
    background: var(--node-level-1);
}

.hint {
    color: var(--secondary-text);
    font-size: 0.95rem;
    margin-top: 1rem;
    text-align: center;
}

.footer {
    color: var(--tertiary-text);
    font-size: 0.9rem;
    text-align: right;
    margin-top: 2rem;
    font-style: italic;
}

/* Theme switcher */
.theme-switcher {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: var(--card-background);
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 2px 10px var(--shadow);
    display: flex;
    align-items: center;
}

.theme-switcher select {
    padding: 5px 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--graph-background);
    color: var(--primary-text);
    font-family: 'Georgia', serif;
    cursor: pointer;
}

.theme-switcher label {
    margin-right: 10px;
    color: var(--primary-text);
    font-size: 14px;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .container {
        flex-direction: column;
    }

    .concept-map,
    .notes-container {
        margin: 1rem;
        width: calc(100% - 2rem);
        height: calc(50vh - 2rem);
    }
}

img {
    max-width: 100%;
}

iframe {
    width: 100%;
    border: none;
}