:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --secondary-color: #64748b;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --accent-color: #f59e0b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.2);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius: 12px;
}

[data-theme="dark"] {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

/* Glassmorphism Classes */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
}

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

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
    margin-bottom: 3rem;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Grid for Courses */
.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.course-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.course-card i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.speech-btn {
    background: #FF4757;
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 800;
    font-family: 'Outfit';
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    box-shadow: 0 4px 15px rgba(255, 71, 87, 0.3);
}

.speech-btn:hover {
    background: #ff6b81;
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 71, 87, 0.4);
}

.speech-btn.speaking {
    background: #2ed573;
    animation: pulse 1.5s infinite;
    box-shadow: 0 4px 15px rgba(46, 213, 115, 0.3);
}

/* Speech Block Highlighting */
.speech-block {
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
    cursor: pointer;
}

.speech-block:hover {
    background: rgba(99, 102, 241, 0.03);
    border-left: 4px solid var(--primary-color);
}

.highlight-block {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.1), transparent) !important;
    border-left: 4px solid var(--primary-color) !important;
    transform: translateX(10px);
    box-shadow: -10px 0 0 -5px var(--primary-color);
}

/* Updated Word Highlighting for Inner Polish (Optional) */
.highlight {
    background: linear-gradient(120deg, #6366f1 0%, #a855f7 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: inline-block;
}

.active-word {
    background: var(--primary-color);
    color: white !important;
    -webkit-text-fill-color: initial !important;
    padding: 0 4px;
    border-radius: 4px;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
    font-weight: bold;
    display: inline-block;
    transition: transform 0.2s ease;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.highlight {
    background: linear-gradient(120deg, #84fab0 0%, #8fd3f4 100%);
    color: #1e293b;
    border-radius: 4px;
    padding: 2px 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    font-weight: bold;
}

/* Simple Button Styles */
.btn {
    padding: 0.8rem 1.5rem;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: scale(1.02);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.8s ease-out forwards;
}

/* Sidebar for Tutorial */
.tutorial-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    min-height: 80vh;
}

.sidebar {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.sidebar h3 {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--glass-border);
}

.day-link {
    display: block;
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-muted);
    transition: all 0.2s;
}

.day-link:hover,
.day-link.active {
    background: var(--primary-color);
    color: white;
}

/* Content Area */
.content-area {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 2.5rem;
    box-shadow: var(--shadow-sm);
}

.video-container {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 aspect ratio */
    height: 0;
    margin-bottom: 2rem;
    border-radius: var(--radius);
    overflow: hidden;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.markdown-image {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 2rem auto;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--glass-border);
}

/* Markdown Content Styling */
.markdown-body {
    color: var(--text-main);
    font-size: 1.1rem;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

.markdown-body .blue-header {
    color: #2563eb !important;
    border-left: 5px solid #2563eb !important;
}

.markdown-body h3 {
    padding-left: 1rem;
    border-left: 5px solid var(--primary-color);
    background: linear-gradient(90deg, var(--glass-bg), transparent);
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    border-radius: 4px;
}

.markdown-body p {
    margin-bottom: 1.5rem;
    padding: 1.2rem;
    background: var(--bg-color);
    border-radius: 8px;
    border-left: 3px solid var(--glass-border);
    line-height: 1.8;
    font-weight: 600;
}

.markdown-body strong {
    font-weight: 800;
    color: var(--primary-color);
}

.markdown-body ul,
.markdown-body ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.markdown-body li {
    margin-bottom: 0.5rem;
}

.markdown-body code {
    background: var(--primary-color);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
}

.markdown-body pre {
    background: #f8fafc;
    color: #1e293b;
    padding: 1.5rem;
    border-radius: 12px;
    overflow-x: auto;
    margin: 0;
    border: 1px solid #e2e8f0;
    box-shadow: var(--shadow-sm);
    font-weight: 500;
}

.code-wrapper {
    position: relative;
    margin: 1.5rem 0;
}

.copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: white;
    border: 1px solid var(--glass-border);
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 5px;
}

.copy-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.copy-btn.copied {
    background: var(--success-color);
    color: white;
    border-color: var(--success-color);
}

.markdown-body pre code {
    background: none;
    color: inherit;
    padding: 0;
}

.markdown-body table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.markdown-body img {
    max-width: 100%;
    height: auto;
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        margin-bottom: 1.5rem;
    }

    .header-left {
        width: 100%;
        justify-content: center;
    }

    .course-badge {
        font-size: 0.8rem;
    }

    #day-title {
        font-size: 1.5rem !important;
    }

    .speech-btn {
        padding: 0.6rem 1rem !important;
        font-size: 0.9rem !important;
    }
}

/* Assignment Styles */
.assignment-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px dashed var(--glass-border);
}

.question-card {
    background: var(--bg-color);
    padding: 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}

.options-list {
    list-style: none;
    margin-top: 1rem;
}

.option-item {
    margin-bottom: 0.8rem;
}

.option-item input {
    margin-right: 10px;
}

textarea {
    width: 100%;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: var(--card-bg);
    color: var(--text-main);
    min-height: 100px;
}

/* Evaluation Sheet */
.evaluation-sheet {
    background: var(--card-bg);
    padding: 3rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    max-width: 800px;
    margin: 2rem auto;
}

@media print {
    body * {
        visibility: hidden;
    }

    .evaluation-sheet,
    .evaluation-sheet * {
        visibility: visible;
    }

    .evaluation-sheet {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }
}

@keyframes slideUpFade {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.animate-slide-up {
    animation: slideUpFade 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.slide-text-wrapper {
    font-family: 'Outfit', sans-serif;
    font-size: 2.5rem;
    line-height: 1.4;
    font-weight: 700;
    color: white;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.slide-text-wrapper p {
    margin: 0;
}

.slide-text-wrapper h3 {
    color: #6366f1;
    font-size: 3.5rem;
    margin-bottom: 2rem;
    background: linear-gradient(to right, #6366f1, #a855f7);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    border: none !important;
    padding: 0 !important;
}

.slide-text-wrapper li {
    list-style: none;
    font-size: 2rem;
    margin-bottom: 1.2rem;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border-left: 4px solid #6366f1;
}

.presentation-active {
    overflow: hidden !important;
}

@media (max-width: 1024px) {
    .tutorial-layout {
        grid-template-columns: 250px 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    header {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
        margin-bottom: 2rem;
    }

    .header-left {
        width: 100%;
        justify-content: center;
    }

    .welcome-section h1 {
        font-size: 2rem !important;
    }

    .welcome-section p {
        font-size: 1rem !important;
    }

    .course-grid {
        grid-template-columns: 1fr;
    }

    #mobile-sidebar-toggle {
        display: block !important;
    }

    .tutorial-layout {
        display: block;
    }

    .sidebar {
        position: fixed;
        left: -320px;
        top: 0;
        bottom: 0;
        width: 300px;
        z-index: 1000;
        transition: left 0.3s ease;
        border-radius: 0;
        box-shadow: 20px 0 50px rgba(0, 0, 0, 0.1);
        padding-top: 5rem;
        overflow-y: auto;
    }

    .sidebar.active {
        left: 0;
    }

    .content-area {
        padding: 1rem;
    }

    .speech-controls-wrapper {
        flex-direction: column;
        padding: 1rem !important;
    }

    .speech-controls-wrapper>div {
        flex-direction: column;
        width: 100%;
        gap: 1rem !important;
    }

    .speech-controls-wrapper>div>div {
        width: 100% !important;
    }

    #slide-content {
        width: 95%;
    }

    .nav-btn {
        font-size: 1.5rem !important;
        left: -35px !important;
        right: -35px !important;
    }

    .evaluation-sheet {
        padding: 1rem;
    }

    #day-title {
        font-size: 1.5rem !important;
    }

    .speech-btn {
        padding: 0.7rem 1rem !important;
        font-size: 0.85rem !important;
        width: 100%;
        display: flex;
        justify-content: center;
    }
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    backdrop-filter: blur(5px);
}

.sidebar-overlay.active {
    display: block;
}

@media (max-width: 500px) {
    .slide-text-wrapper {
        font-size: 1.2rem;
    }

    .slide-text-wrapper h3 {
        font-size: 1.6rem;
    }

    .slide-text-wrapper li {
        font-size: 0.9rem;
        padding: 8px 15px;
    }

    .logo {
        font-size: 1.4rem;
    }

    .course-badge {
        font-size: 0.75rem;
        padding: 0.4rem 0.8rem;
    }
}

/* Topic Navigation Buttons */
.topic-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--glass-border);
    gap: 1rem;
}

.nav-topic-btn {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text-main);
    transition: all 0.3s ease;
    max-width: 48%;
}

.nav-topic-btn:hover {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white !important;
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.nav-topic-btn .nav-label {
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-topic-btn.prev {
    justify-content: flex-start;
}

.nav-topic-btn.next {
    justify-content: flex-end;
}

.nav-topic-btn:hover .nav-label {
    color: white;
}

@media (max-width: 600px) {
    .topic-navigation {
        flex-direction: column;
    }

    .nav-topic-btn {
        max-width: 100%;
    }
}