:root {
    /* Light theme variables */
    --primary-color: #4f46e5;
    --primary-color-rgb: 79, 70, 229;
    --secondary-color: #6366f1;
    --background-color: #f8fafc;
    --text-color: #1e293b;
    --border-color: #e2e8f0;
    --card-background: white;
    --subtitle-color: #64748b;
    --gradient-start: #4338ca;
    --gradient-end: #6366f1;
    --header-background: #f1f5f9;
    --header-text: #1e293b;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    --hover-shadow: 0 8px 12px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    /* Dark theme variables */
    --primary-color: #818cf8;
    --primary-color-rgb: 129, 140, 248;
    --secondary-color: #6366f1;
    --background-color: #0f172a;
    --text-color: #f1f5f9;
    --border-color: #1e293b;
    --card-background: #1e293b;
    --subtitle-color: #94a3b8;
    --gradient-start: #3730a3;
    --gradient-end: #4f46e5;
    --header-background: #1e293b;
    --header-text: #f1f5f9;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    --hover-shadow: 0 8px 12px rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    background-color: var(--background-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100vh;
    background-image: 
        radial-gradient(circle at 100% 0%, rgba(var(--primary-color-rgb), 0.05) 0%, transparent 50%),
        radial-gradient(circle at 0% 100%, rgba(var(--primary-color-rgb), 0.05) 0%, transparent 50%);
    background-attachment: fixed;
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: var(--card-background);
    border: none;
    color: var(--text-color);
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: var(--card-shadow);
    backdrop-filter: blur(10px);
}

.theme-toggle:hover {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--hover-shadow);
}

.theme-toggle svg {
    width: 1.2em;
    height: 1.2em;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem 1rem;
    background: var(--header-background);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--card-shadow);
}

h1 {
    margin-bottom: 0.5rem;
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--header-text);
    letter-spacing: -0.025em;
}

.subtitle {
    color: var(--subtitle-color);
    font-size: 1.1rem;
}

.unit-card {
    background: var(--card-background);
    border-radius: 16px;
    padding: 1.8rem;
    margin-bottom: 2rem;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.unit-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--hover-shadow);
}

.unit-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(to right, var(--gradient-start), var(--gradient-end));
    opacity: 0.8;
}

.unit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.title-section {
    flex: 1;
}

.unit-title {
    font-size: 1.4rem;
    color: var(--primary-color);
    margin-bottom: 0.3rem;
    font-weight: 600;
}

.exam-weight {
    font-size: 0.9rem;
    color: var(--subtitle-color);
    display: block;
}

.progress-section {
    text-align: right;
    min-width: 150px;
    margin-left: 1rem;
}

.unit-progress {
    font-size: 0.9rem;
    color: var(--subtitle-color);
    display: block;
    margin-bottom: 0.4rem;
}

.progress-bar {
    height: 6px;
    background-color: var(--header-background);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(to right, var(--gradient-start), var(--gradient-end));
    opacity: 0.9;
    width: 0;
    transition: width 0.3s ease;
}

.topic-list {
    list-style: none;
    margin: 1.5rem 0;
}

.topic-item {
    display: flex;
    align-items: center;
    padding: 0.8rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
    background: rgba(var(--primary-color-rgb), 0.03);
}

.topic-item:hover {
    background: rgba(var(--primary-color-rgb), 0.06);
}

.topic-checkbox {
    margin-right: 1rem;
    width: 20px;
    height: 20px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.topic-text {
    flex: 1;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.topic-item.checked {
    background: rgba(var(--primary-color-rgb), 0.08);
}

.topic-item.checked .topic-text {
    text-decoration: line-through;
    opacity: 0.7;
    color: var(--subtitle-color);
}

.characters-section, .skills-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(var(--primary-color-rgb), 0.1);
}

.section-title {
    font-size: 1.1rem;
    color: var(--text-color);
    margin-bottom: 0.8rem;
    font-weight: 600;
}

footer {
    text-align: center;
    margin-top: 3rem;
    padding: 1.5rem;
    color: var(--subtitle-color);
    font-size: 0.9rem;
    background: var(--card-background);
    border-radius: 16px;
    box-shadow: var(--card-shadow);
}

.offline-notice {
    background: var(--header-background);
    color: var(--primary-color);
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    margin-top: 1rem;
    text-align: center;
    font-size: 0.9rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
    .container {
        padding: 15px;
    }

    h1 {
        font-size: 1.8rem;
    }

    .unit-card {
        padding: 1.2rem;
    }

    .unit-title {
        font-size: 1.2rem;
    }

    .theme-toggle {
        top: 0.5rem;
        right: 0.5rem;
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }

    .progress-section {
        min-width: 120px;
    }
}

/* Timeline Section */
.timeline-section {
    margin-top: 4rem;
    padding: 2rem;
    background: var(--card-background);
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
}

.timeline-title {
    text-align: center;
    font-size: 2rem;
    color: var(--text-color);
    margin-bottom: 3rem;
    font-weight: 700;
}

.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 0;
}

.timeline-item {
    position: relative;
    margin-bottom: 4rem;
    padding-left: 50px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 24px;
    height: 24px;
    background: var(--period-color);
    border-radius: 50%;
    border: 4px solid var(--card-background);
    box-shadow: 0 0 0 3px var(--period-color);
    z-index: 2;
}

/* Vertical line for each period */
.timeline-item::after {
    content: '';
    position: absolute;
    left: 11px;
    top: 24px;
    width: 2px;
    height: calc(100% + 2rem);
    background: var(--period-color);
    opacity: 0.5;
}

/* Remove the line from the last period */
.timeline-item:last-child::after {
    display: none;
}

.timeline-period-header {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--card-background);
    border: 2px solid var(--period-color);
    border-radius: 12px;
    position: relative;
    z-index: 1;
}

.timeline-period-title {
    color: var(--period-color);
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.timeline-period-subtitle {
    color: var(--subtitle-color);
    font-size: 1.1rem;
    display: block;
}

.timeline-events {
    list-style: none;
    padding: 0;
    margin: 0;
    position: relative;
}

.timeline-event {
    position: relative;
    padding: 1rem 1.5rem;
    background: var(--header-background);
    border-left: 3px solid var(--period-color);
    border-radius: 8px;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

/* Add circles for each event */
.timeline-event::before {
    content: '';
    position: absolute;
    left: -44px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: var(--period-color);
    border-radius: 50%;
    border: 2px solid var(--card-background);
    opacity: 0.8;
    z-index: 2;
}

/* Add connecting lines for each event */
.timeline-event::after {
    content: '';
    position: absolute;
    left: -37px;
    top: 50%;
    width: 34px;
    height: 2px;
    background: var(--period-color);
    opacity: 0.5;
}

.timeline-event:hover {
    transform: translateX(5px);
    background: var(--card-background);
    box-shadow: var(--card-shadow);
}

.timeline-event:hover::before {
    transform: translateY(-50%) scale(1.2);
    opacity: 1;
}

.timeline-event:hover::after {
    opacity: 0.8;
}

/* Mobile Responsiveness for Timeline */
@media (max-width: 768px) {
    .timeline-item {
        padding-left: 40px;
    }

    .timeline-item::before {
        left: 0;
        width: 20px;
        height: 20px;
    }

    .timeline-item::after {
        left: 9px;
    }

    .timeline-event::before {
        left: -34px;
        width: 10px;
        height: 10px;
    }

    .timeline-event::after {
        left: -27px;
        width: 24px;
    }

    .timeline-period-header {
        padding: 1rem;
    }

    .timeline-period-title {
        font-size: 1.2rem;
    }

    .timeline-period-subtitle {
        font-size: 1rem;
    }
}

/* Resource Sections */
.resource-section {
    margin: 3rem 0;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
}

/* Key Figures Section - Orange theme */
#key-figures {
    background: linear-gradient(
        135deg,
        rgba(255, 159, 67, 0.05) 0%,
        rgba(255, 159, 67, 0.1) 100%
    );
    border: 1px solid rgba(255, 159, 67, 0.1);
}

/* Artworks Section - Green theme */
#artworks {
    background: linear-gradient(
        135deg,
        rgba(46, 213, 115, 0.05) 0%,
        rgba(46, 213, 115, 0.1) 100%
    );
    border: 1px solid rgba(46, 213, 115, 0.1);
}

/* Maps Section - Red theme */
#maps {
    background: linear-gradient(
        135deg,
        rgba(235, 59, 90, 0.05) 0%,
        rgba(235, 59, 90, 0.1) 100%
    );
    border: 1px solid rgba(235, 59, 90, 0.1);
}

/* Adjust card backgrounds for better contrast */
#key-figures .figure-card {
    background: rgba(255, 159, 67, 0.02);
    border: 1px solid rgba(255, 159, 67, 0.15);
}

#artworks .artwork-card {
    background: rgba(46, 213, 115, 0.02);
    border: 1px solid rgba(46, 213, 115, 0.15);
}

#maps .map-card {
    background: rgba(235, 59, 90, 0.02);
    border: 1px solid rgba(235, 59, 90, 0.15);
}

/* Hover effects for cards */
#key-figures .figure-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(255, 159, 67, 0.15);
    background: rgba(255, 159, 67, 0.04);
}

#artworks .artwork-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(46, 213, 115, 0.15);
    background: rgba(46, 213, 115, 0.04);
}

#maps .map-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(235, 59, 90, 0.15);
    background: rgba(235, 59, 90, 0.04);
}

/* Section titles with matching colors */
#key-figures h2 {
    color: rgb(255, 159, 67);
    font-size: 1.8rem;
    margin-bottom: 2rem;
    text-align: center;
}

#artworks h2 {
    color: rgb(46, 213, 115);
    font-size: 1.8rem;
    margin-bottom: 2rem;
    text-align: center;
}

#maps h2 {
    color: rgb(235, 59, 90);
    font-size: 1.8rem;
    margin-bottom: 2rem;
    text-align: center;
}

/* Unit subtitles with matching colors */
#key-figures .unit-subtitle {
    border-bottom: 2px solid rgba(255, 159, 67, 0.2);
    color: rgb(255, 159, 67);
}

#artworks .unit-subtitle {
    border-bottom: 2px solid rgba(46, 213, 115, 0.2);
    color: rgb(46, 213, 115);
}

#maps .unit-subtitle {
    border-bottom: 2px solid rgba(235, 59, 90, 0.2);
    color: rgb(235, 59, 90);
}

/* Dark mode adjustments */
[data-theme="dark"] #key-figures {
    background: linear-gradient(
        135deg,
        rgba(255, 159, 67, 0.1) 0%,
        rgba(255, 159, 67, 0.05) 100%
    );
}

[data-theme="dark"] #artworks {
    background: linear-gradient(
        135deg,
        rgba(46, 213, 115, 0.1) 0%,
        rgba(46, 213, 115, 0.05) 100%
    );
}

[data-theme="dark"] #maps {
    background: linear-gradient(
        135deg,
        rgba(235, 59, 90, 0.1) 0%,
        rgba(235, 59, 90, 0.05) 100%
    );
}

/* Additional color adjustments for dark mode */
[data-theme="dark"] #key-figures .figure-dates,
[data-theme="dark"] #key-figures .figure-description {
    color: rgba(255, 159, 67, 0.9);
}

[data-theme="dark"] #artworks .artwork-artist,
[data-theme="dark"] #artworks .artwork-date,
[data-theme="dark"] #artworks .artwork-description {
    color: rgba(46, 213, 115, 0.9);
}

[data-theme="dark"] #maps .map-date,
[data-theme="dark"] #maps .map-description {
    color: rgba(235, 59, 90, 0.9);
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .resource-section {
        padding: 1.5rem;
        margin: 2rem 0;
    }

    #key-figures h2,
    #artworks h2,
    #maps h2 {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }
}

/* Grid Layouts */
.figures-grid,
.artwork-grid,
.maps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    padding: 1rem;
    margin-bottom: 2rem;
}

/* Card Styles */
.figure-card,
.artwork-card,
.map-card {
    background: var(--background-color);
    border-radius: 8px;
    padding: 1rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    border: 1px solid var(--border-color);
}

.figure-card:hover,
.artwork-card:hover,
.map-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(var(--primary-color-rgb), 0.1);
}

/* Image Containers */
.figure-image,
.artwork-image,
.map-image {
    width: 100%;
    height: 250px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1rem;
    position: relative;
    background: var(--card-background);
    border: 1px solid var(--border-color);
}

/* Image Styling */
.figure-image img,
.artwork-image img,
.map-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

/* Hover Effects */
.figure-card:hover .figure-image img,
.artwork-card:hover .artwork-image img,
.map-card:hover .map-image img {
    transform: scale(1.05);
}

/* Remove old placeholder styles */
.figure-image-placeholder,
.artwork-image-placeholder,
.map-image-placeholder,
.add-image-prompt {
    display: none;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .figure-image,
    .artwork-image,
    .map-image {
        height: 200px;
    }
}

/* Card Content */
.figure-card h3,
.artwork-card h3,
.map-card h3 {
    color: var(--text-color);
    font-size: 1.2rem;
    margin: 0.5rem 0;
}

.figure-dates,
.artwork-artist,
.artwork-date,
.map-date {
    color: var(--primary-color);
    font-size: 0.9rem;
    margin: 0.3rem 0;
}

.figure-description,
.artwork-description,
.map-description {
    color: var(--subtitle-color);
    font-size: 0.9rem;
    margin-top: 0.5rem;
    line-height: 1.4;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .figures-grid,
    .artwork-grid,
    .maps-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .resource-section h2 {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }
}

/* Unit Subtitles */
.unit-subtitle {
    color: var(--primary-color);
    font-size: 1.4rem;
    margin: 2rem 0 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(var(--primary-color-rgb), 0.2);
    grid-column: 1 / -1;
    width: 100%;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .unit-subtitle {
        font-size: 1.2rem;
        margin: 1.5rem 0 1rem;
    }
}

/* Exam Components Section */
.exam-components {
    padding: 2rem;
    margin: 2rem 0;
    background: var(--background-color);
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(var(--primary-color-rgb), 0.1);
}

.exam-components h2 {
    color: var(--text-color);
    font-size: 1.8rem;
    margin-bottom: 2rem;
    text-align: center;
}

.component-card {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.component-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(var(--primary-color-rgb), 0.15);
}

.component-card h3 {
    color: var(--primary-color);
    font-size: 1.4rem;
    margin-bottom: 1rem;
}

.component-card .timing {
    color: var(--text-color);
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.component-card .question-count {
    color: var(--subtitle-color);
    font-style: italic;
    margin-bottom: 1rem;
}

.component-card .requirements {
    list-style-type: none;
    padding: 0;
}

.component-card .requirements li {
    color: var(--text-color);
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
    position: relative;
}

.component-card .requirements li::before {
    content: "•";
    color: var(--primary-color);
    position: absolute;
    left: 0;
}

.exam-order {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 2rem;
}

.exam-order h3 {
    color: var(--primary-color);
    font-size: 1.4rem;
    margin-bottom: 1rem;
}

.exam-order ol {
    color: var(--text-color);
    padding-left: 1.5rem;
}

.exam-order li {
    margin-bottom: 0.5rem;
}

/* Component-specific colors */
.component-card.mcq {
    border-left: 4px solid #FF9800;
}

.component-card.saq {
    border-left: 4px solid #4CAF50;
}

.component-card.dbq {
    border-left: 4px solid #2196F3;
}

.component-card.leq {
    border-left: 4px solid #9C27B0;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .exam-components {
        padding: 1rem;
        margin: 1rem 0;
    }

    .exam-components h2 {
        font-size: 1.5rem;
    }

    .component-card {
        padding: 1rem;
    }

    .component-card h3 {
        font-size: 1.2rem;
    }
} 