/* Classicalia Lesson Styles - Universal CSS for all lesson pages */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #fafafa;
    color: #2c3e50;
    line-height: 1.6;
}

/* Global Elements */
.global-info-btn {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 1rem;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* Header */
.header {
    background: white;
    border-bottom: 1px solid #e9ecef;
    padding: 0.75rem 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    position: relative;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
}

.logo {
    font-size: 2rem !important;
    font-weight: 800;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -1px;
    margin: 0;
    line-height: 1;
}

.logo a {
    text-decoration: none;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.author {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    margin: 0;
    font-size: 0.8rem;
    font-weight: 300;
    letter-spacing: -0.5px;
    margin-top: -0.2rem;
    margin-bottom: -0.2rem;
    line-height: 1.3;
}

.subtitle {
    color: #6c757d;
    margin: 0;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.page-nav {
    display: flex;
    gap: 1rem;
}

.nav-link {
    color: #666;
    text-decoration: none;
    font-size: 0.85rem;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.nav-link:hover {
    opacity: 1;
    color: #333;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: black;
}

.modal-header h2 {
    color: #333;
    text-align: center;
    margin-bottom: 1rem;
}

.modal-body {
    text-align: center;
}

.modal-text p {
    color: #666;
    line-height: 1.6;
}

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

/* Header */
.lesson-header {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 2rem;
    box-shadow: 0 4px 16px rgba(0, 123, 255, 0.2);
}

.lesson-number {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 0.5rem;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.lesson-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.lesson-subtitle {
    font-size: 0.95rem;
    opacity: 0.95;
    font-style: italic;
}

/* Main content */
.content-section {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

h2 {
    color: #007bff;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    font-weight: 600;
    text-align: center;
}

.grammar-text {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #333;
    margin-bottom: 1rem;
    text-align: justify;
}

.grammar-text strong {
    color: #0056b3;
    font-weight: 600;
}

/* Main conjugation table - FIXED SIZING */
.conjugation-table {
    width: 100%;
    margin: 1.5rem 0;
    border-collapse: separate;
    border-spacing: 2px;
    font-size: 0.9rem;
}

.conjugation-table th {
    background: #007bff;
    color: white;
    padding: 0.75rem 0.5rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.85rem;
}

.conjugation-table td {
    padding: 0.75rem 0.5rem;
    border: 1px solid #dee2e6;
    text-align: center;
    position: relative;
    overflow: hidden;
    height: 50px;
    box-sizing: border-box;
}

.conjugation-table .number-col {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
    width: 80px;
    font-style: italic;
}

.conjugation-table .person-col {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
    width: 60px;
}

.conjugation-table .pronoun-col {
    background: #f8f9fa;
    color: #495057;
    font-weight: 500;
    width: 80px;
    font-style: italic;
}

.conjugation-table .stem-col {
    background: #f1f3f4;
    color: #333;
    font-weight: 600;
    width: 60px;
}

.conjugation-table .vowel-col {
    color: #dc3545;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 70px;
}

.conjugation-table .ending-col {
    color: #007bff;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 80px;
}

.conjugation-table .meaning-col {
    text-align: left;
    padding-left: 1rem;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 200px;
}

/* Glassmorphic overlay for unrevealed cells */
.conjugation-table .unrevealed {
    background: #f8f9fa;
}

.conjugation-table .unrevealed::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 2;
}

.conjugation-table .unrevealed::after {
    content: '•••';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #666;
    font-size: 1rem;
    z-index: 3;
}

.conjugation-table .unrevealed .content {
    opacity: 0;
    z-index: 1;
}

.conjugation-table .unrevealed:hover {
    background: #e8f2ff;
}

.conjugation-table .unrevealed:hover::before {
    background: rgba(232, 242, 255, 0.6);
}

.conjugation-table .revealed {
    background: white;
    animation: revealCell 0.3s ease;
}

.conjugation-table .revealed::before,
.conjugation-table .revealed::after {
    display: none;
}

.conjugation-table .revealed .content {
    opacity: 1;
    z-index: 3;
}

@keyframes revealCell {
    from {
        background: #e8f2ff;
        transform: scale(1.02);
    }
    to {
        background: white;
        transform: scale(1);
    }
}

/* Verb builder */
.verb-builder {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.builder-title {
    text-align: center;
    font-size: 0.9rem;
    color: #495057;
    margin-bottom: 1rem;
    font-style: italic;
}

.formula-display {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem 0;
    min-height: 50px;
    flex-wrap: wrap;
}

.formula-part {
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 1rem;
}

.stem {
    background: #333;
    color: white;
}

.vowel {
    background: #dc3545;
    color: white;
}

.ending {
    background: #007bff;
    color: white;
}

.result {
    background: #28a745;
    color: white;
}

.operator {
    color: #999;
    font-size: 1rem;
    padding: 0 0.25rem;
}

.ending-selector {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.ending-btn {
    background: white;
    border: 1px solid #dee2e6;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.ending-btn:hover {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.ending-btn.selected {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

/* Info notes */
.info-note {
    background: #fff8e1;
    border-left: 3px solid #ffc107;
    padding: 0.75rem;
    margin: 1rem 0;
    font-size: 0.85rem;
    border-radius: 4px;
}

.info-note strong {
    color: #856404;
}

/* Bullet points */
.grammar-points {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.grammar-points li {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #333;
}

/* Reveal button */
.reveal-btn {
    display: block;
    margin: 1rem auto;
    background: #007bff;
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.reveal-btn:hover {
    background: #0056b3;
}

/* Practice section */
.practice-box {
    background: #f8f9fa;
    border-left: 3px solid #007bff;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
}

.practice-title {
    font-weight: 600;
    color: #0056b3;
    margin-bottom: 0.3rem;
    font-size: 0.9rem;
}

.practice-content {
    font-size: 0.85rem;
    color: #495057;
}

/* Classicalia Lesson Styles - Universal CSS for all lesson pages */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #fafafa;
    color: #2c3e50;
    line-height: 1.6;
}

/* Global Elements */
.global-info-btn {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 1rem;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* Header */
.header {
    background: white;
    border-bottom: 1px solid #e9ecef;
    padding: 0.75rem 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    position: relative;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
}

.logo {
    font-size: 2rem !important;
    font-weight: 800;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -1px;
    margin: 0;
    line-height: 1;
}

.logo a {
    text-decoration: none;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.author {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    margin: 0;
    font-size: 0.8rem;
    font-weight: 300;
    letter-spacing: -0.5px;
    margin-top: -0.2rem;
    margin-bottom: -0.2rem;
    line-height: 1.3;
}

.subtitle {
    color: #6c757d;
    margin: 0;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.page-nav {
    display: flex;
    gap: 1rem;
}

.nav-link {
    color: #666;
    text-decoration: none;
    font-size: 0.85rem;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.nav-link:hover {
    opacity: 1;
    color: #333;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: black;
}

.modal-header h2 {
    color: #333;
    text-align: center;
    margin-bottom: 1rem;
}

.modal-body {
    text-align: center;
}

.modal-text p {
    color: #666;
    line-height: 1.6;
}

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

/* Header */
.lesson-header {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 2rem;
    box-shadow: 0 4px 16px rgba(0, 123, 255, 0.2);
}

.lesson-number {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 0.5rem;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.lesson-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.lesson-subtitle {
    font-size: 0.95rem;
    opacity: 0.95;
    font-style: italic;
}

/* Main content */
.content-section {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

h2 {
    color: #007bff;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    font-weight: 600;
    text-align: center;
}

.grammar-text {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #333;
    margin-bottom: 1rem;
    text-align: justify;
}

.grammar-text strong {
    color: #0056b3;
    font-weight: 600;
}

/* Main conjugation table - FIXED SIZING */
.conjugation-table {
    width: 100%;
    margin: 1.5rem 0;
    border-collapse: separate;
    border-spacing: 2px;
    font-size: 0.9rem;
}

.conjugation-table th {
    background: #007bff;
    color: white;
    padding: 0.75rem 0.5rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.85rem;
}

.conjugation-table td {
    padding: 0.75rem 0.5rem;
    border: 1px solid #dee2e6;
    text-align: center;
    position: relative;
    overflow: hidden;
    height: 50px;
    box-sizing: border-box;
}

.conjugation-table .number-col {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
    width: 80px;
    font-style: italic;
}

.conjugation-table .person-col {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
    width: 60px;
}

.conjugation-table .pronoun-col {
    background: #f8f9fa;
    color: #495057;
    font-weight: 500;
    width: 80px;
    font-style: italic;
}

.conjugation-table .stem-col {
    background: #f1f3f4;
    color: #333;
    font-weight: 600;
    width: 60px;
}

.conjugation-table .vowel-col {
    color: #dc3545;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 70px;
}

.conjugation-table .ending-col {
    color: #007bff;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 80px;
}

.conjugation-table .meaning-col {
    text-align: left;
    padding-left: 1rem;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 200px;
}

/* Glassmorphic overlay for unrevealed cells */
.conjugation-table .unrevealed {
    background: #f8f9fa;
}

.conjugation-table .unrevealed::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 2;
}

.conjugation-table .unrevealed::after {
    content: '•••';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #666;
    font-size: 1rem;
    z-index: 3;
}

.conjugation-table .unrevealed .content {
    opacity: 0;
    z-index: 1;
}

.conjugation-table .unrevealed:hover {
    background: #e8f2ff;
}

.conjugation-table .unrevealed:hover::before {
    background: rgba(232, 242, 255, 0.6);
}

.conjugation-table .revealed {
    background: white;
    animation: revealCell 0.3s ease;
}

.conjugation-table .revealed::before,
.conjugation-table .revealed::after {
    display: none;
}

.conjugation-table .revealed .content {
    opacity: 1;
    z-index: 3;
}

@keyframes revealCell {
    from {
        background: #e8f2ff;
        transform: scale(1.02);
    }
    to {
        background: white;
        transform: scale(1);
    }
}

/* Verb builder */
.verb-builder {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.builder-title {
    text-align: center;
    font-size: 0.9rem;
    color: #495057;
    margin-bottom: 1rem;
    font-style: italic;
}

.formula-display {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem 0;
    min-height: 50px;
    flex-wrap: wrap;
}

.formula-part {
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 1rem;
}

.stem {
    background: #333;
    color: white;
}

.vowel {
    background: #dc3545;
    color: white;
}

.ending {
    background: #007bff;
    color: white;
}

.result {
    background: #28a745;
    color: white;
}

.operator {
    color: #999;
    font-size: 1rem;
    padding: 0 0.25rem;
}

.ending-selector {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.ending-btn {
    background: white;
    border: 1px solid #dee2e6;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.ending-btn:hover {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.ending-btn.selected {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

/* Info notes */
.info-note {
    background: #fff8e1;
    border-left: 3px solid #ffc107;
    padding: 0.75rem;
    margin: 1rem 0;
    font-size: 0.85rem;
    border-radius: 4px;
}

.info-note strong {
    color: #856404;
}

/* Bullet points */
.grammar-points {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.grammar-points li {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #333;
}

/* Reveal button */
.reveal-btn {
    display: block;
    margin: 1rem auto;
    background: #007bff;
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.reveal-btn:hover {
    background: #0056b3;
}

/* Practice section */
.practice-box {
    background: #f8f9fa;
    border-left: 3px solid #007bff;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
}

.practice-title {
    font-weight: 600;
    color: #0056b3;
    margin-bottom: 0.3rem;
    font-size: 0.9rem;
}

.practice-content {
    font-size: 0.85rem;
    color: #495057;
}

/* Navigation */
.nav-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #dee2e6;
}

.nav-btn {
    padding: 0.5rem 1rem;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.nav-prev {
    background: white;
    color: #495057;
    border: 1px solid #dee2e6;
}

.nav-next {
    background: #007bff;
    color: white;
}

.nav-btn:hover {
    transform: translateY(-1px);
}

/* Vocabulary Sidebar */
.vocab-toggle {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    background: #007bff;
    color: white;
    border: none;
    padding: 1rem 0.5rem;
    writing-mode: vertical-rl;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 1000;
    border-radius: 8px 0 0 8px;
    box-shadow: -2px 0 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.vocab-toggle:hover {
    background: #0056b3;
    transform: translateY(-50%) translateX(-2px);
}

.vocab-toggle.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Annotation Toggle Button */
.annotation-toggle {
    position: fixed;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    background: #28a745;
    color: white;
    border: none;
    padding: 1rem 0.5rem;
    writing-mode: vertical-rl;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 1000;
    border-radius: 0 8px 8px 0;
    box-shadow: 2px 0 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.annotation-toggle:hover {
    background: #218838;
    transform: translateY(-50%) translateX(2px);
}

.annotation-toggle.hidden {
    opacity: 0;
    pointer-events: none;
}

.vocab-sidebar {
    position: fixed;
    top: 0;
    right: -350px;
    width: 350px;
    height: 100vh;
    background: white;
    border-left: 1px solid #dee2e6;
    box-shadow: -4px 0 16px rgba(0,0,0,0.1);
    z-index: 999;
    transition: right 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.vocab-sidebar.open {
    right: 0;
}

.vocab-header {
    background: #f8f9fa;
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.vocab-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.1rem;
}

.close-sidebar {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-sidebar:hover {
    color: #333;
}

.vocab-search {
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.vocab-search input {
    padding: 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 0.85rem;
}

.vocab-search select {
    padding: 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 0.85rem;
    background: white;
}

.vocab-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.vocab-item {
    background: #f8f9fa;
    margin-bottom: 0.1rem;
    padding: 0.4rem 0.5rem;
    border-radius: 4px;
    border-left: 3px solid #007bff;
}

.vocab-top-line {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.2rem;
    line-height: 1.2;
}

.vocab-latin {
    font-weight: 600;
    color: #007bff;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.vocab-info {
    color: #666;
    font-size: 0.75rem;
    font-style: italic;
    flex: 1;
}

.vocab-chapter {
    color: #999;
    font-size: 0.7rem;
    font-weight: 500;
    flex-shrink: 0;
}

.vocab-english {
    color: #333;
    font-size: 0.85rem;
    line-height: 1.2;
}

/* Annotation Tool */
.annotation-toolbar {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    padding: 0.75rem;
    z-index: 1001;
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
}

.annotation-toolbar.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(-10px);
}

.annotation-tools {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tool-btn, .action-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.tool-btn:hover, .action-btn:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

.tool-btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.tool-icon {
    font-size: 1.1rem;
    line-height: 1;
}

.tool-divider {
    width: 1px;
    height: 30px;
    background: #dee2e6;
    margin: 0 0.25rem;
}

.color-palette {
    display: flex;
    gap: 0.25rem;
}

.color-btn {
    border: 2px solid #dee2e6;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.color-btn:hover {
    transform: scale(1.1);
}

.color-btn.active {
    border-color: #333;
    box-shadow: 0 0 0 2px rgba(51,51,51,0.3);
}

.annotation-canvas {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 1002;
    background: transparent;
}

/* Only enable pointer events when drawing tools are active */
body[data-annotation-tool="pen"] .annotation-canvas,
body[data-annotation-tool="eraser"] .annotation-canvas {
    pointer-events: auto;
}

/* Pointer tool always allows clicks through */
body[data-annotation-tool="pointer"] .annotation-canvas {
    pointer-events: none !important;
}

/* Prevent text selection when drawing tools are active */
body[data-annotation-tool="pen"],
body[data-annotation-tool="eraser"] {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Example Cards for Vocabulary */
.example-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.example-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 3px solid #007bff;
}

.example-card:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.example-card.expanded {
    background: #e7f3ff;
    border-left-color: #0056b3;
}

.vocab-latin {
    font-size: 1.1rem;
    font-weight: 600;
    color: #007bff;
    margin-bottom: 0.25rem;
}

.vocab-english {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.case-examples {
    border-top: 1px solid #dee2e6;
    padding-top: 0.5rem;
    margin-top: 0.5rem;
}

.case-examples.hidden {
    display: none;
}

.case-examples div {
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

/* Sentence Practice */
.sentence-practice {
    margin-top: 1rem;
}

.latin-sentence {
    background: #f8f9fa;
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 3px solid #28a745;
}

.latin-sentence:hover {
    background: #e9ecef;
}

.latin-sentence.revealed {
    background: #d4edda;
}

.latin-sentence .translation {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #dee2e6;
    color: #495057;
    font-style: italic;
}

.latin-sentence .translation.hidden {
    display: none;
}

/* Declension colour coding - remove row backgrounds */
/* .first-declension td {
    border-left: 4px solid #dc3545 !important;
    background: #fff5f5 !important;
}

.second-declension td {
    border-left: 4px solid #007bff !important;
    background: #f0f8ff !important;
} */

/* Latin word colour coding */
.first-decl-word {
    color: #dc3545 !important;
    font-weight: 600;
}

.second-decl-word {
    color: #007bff !important;
    font-weight: 600;
}

/* Vocabulary card colour coding */
.example-card.first-decl {
    border-left: 4px solid #dc3545;
    background: #fff5f5;
}

.example-card.second-decl {
    border-left: 4px solid #007bff;
    background: #f0f8ff;
}

.example-card.first-decl:hover {
    background: #ffe6e6;
}

.example-card.second-decl:hover {
    background: #e6f3ff;
}

.example-card.first-decl.expanded {
    background: #ffebee;
    border-left-color: #c62828;
}

.example-card.second-decl.expanded {
    background: #e3f2fd;
    border-left-color: #1565c0;
}

/* Vocabulary Sidebar */
.vocab-toggle {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    background: #007bff;
    color: white;
    border: none;
    padding: 1rem 0.5rem;
    writing-mode: vertical-rl;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 1000;
    border-radius: 8px 0 0 8px;
    box-shadow: -2px 0 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.vocab-toggle:hover {
    background: #0056b3;
    transform: translateY(-50%) translateX(-2px);
}

.vocab-toggle.hidden {
    opacity: 0;
    pointer-events: none;
}

.vocab-sidebar {
    position: fixed;
    top: 0;
    right: -350px;
    width: 350px;
    height: 100vh;
    background: white;
    border-left: 1px solid #dee2e6;
    box-shadow: -4px 0 16px rgba(0,0,0,0.1);
    z-index: 999;
    transition: right 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.vocab-sidebar.open {
    right: 0;
}

.vocab-header {
    background: #f8f9fa;
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.vocab-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.1rem;
}

.close-sidebar {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-sidebar:hover {
    color: #333;
}

.vocab-search {
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.vocab-search input {
    padding: 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 0.85rem;
}

.vocab-search select {
    padding: 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 0.85rem;
    background: white;
}

.vocab-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.vocab-item {
    background: #f8f9fa;
    margin-bottom: 0.1rem;
    padding: 0.4rem 0.5rem;
    border-radius: 4px;
    border-left: 3px solid #007bff;
}

.vocab-top-line {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.2rem;
    line-height: 1.2;
}

.vocab-latin {
    font-weight: 600;
    color: #007bff;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.vocab-info {
    color: #666;
    font-size: 0.75rem;
    font-style: italic;
    flex: 1;
}

.vocab-chapter {
    color: #999;
    font-size: 0.7rem;
    font-weight: 500;
    flex-shrink: 0;
}

.vocab-english {
    color: #333;
    font-size: 0.85rem;
    line-height: 1.2;
}

/* Annotation Tool */
.annotation-toolbar {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    padding: 0.75rem;
    z-index: 1001;
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
}

.annotation-toolbar.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(-10px);
}

.annotation-tools {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tool-btn, .action-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.tool-btn:hover, .action-btn:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

.tool-btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.tool-icon {
    font-size: 1.1rem;
    line-height: 1;
}

.tool-divider {
    width: 1px;
    height: 30px;
    background: #dee2e6;
    margin: 0 0.25rem;
}

.color-palette {
    display: flex;
    gap: 0.25rem;
}

.color-btn {
    border: 2px solid #dee2e6;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.color-btn:hover {
    transform: scale(1.1);
}

.color-btn.active {
    border-color: #333;
    box-shadow: 0 0 0 2px rgba(51,51,51,0.3);
}

.annotation-canvas {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 998;
}

.annotation-canvas:not(.hidden) {
    pointer-events: auto;
}
