/* Digital Text Template Styles */

/* Text Container */
.text-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    background: #fff;
    min-height: 100vh;
}

/* Breadcrumb Navigation */
.breadcrumb {
    margin-bottom: 2rem;
    padding: 1rem 0;
    border-bottom: 1px solid #e0e0e0;
}

.breadcrumb ol {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.breadcrumb li {
    display: flex;
    align-items: center;
}

.breadcrumb li:not(:last-child)::after {
    content: "›";
    margin-left: 0.5rem;
    color: #666;
    font-weight: bold;
}

.breadcrumb a {
    color: #2563eb;
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.breadcrumb li[aria-current="page"] {
    color: #374151;
    font-weight: 600;
}

/* Text Header */
.text-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
    border-bottom: 2px solid #f3f4f6;
}

.text-title {
    font-family: 'Adishila', serif;
    font-size: 3rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.text-meta {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.text-meta span {
    background: #f3f4f6;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.9rem;
    color: #374151;
    font-weight: 500;
}

.text-description {
    font-size: 1.1rem;
    color: #6b7280;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Reading Controls */
.reading-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f9fafb;
    border-radius: 1rem;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
}

.control-group select {
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    background: white;
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.control-group select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn-secondary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.btn-secondary[aria-pressed="true"] {
    background: #059669;
}

/* Table of Contents */
.toc {
    margin-bottom: 3rem;
    padding: 2rem;
    background: #f9fafb;
    border-radius: 1rem;
    border-left: 4px solid #2563eb;
}

.toc-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1.5rem;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-list li {
    margin-bottom: 0.75rem;
}

.toc-list a {
    display: block;
    padding: 0.75rem 1rem;
    color: #374151;
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    font-weight: 500;
}

.toc-list a:hover {
    background: #e5e7eb;
    color: #1f2937;
    transform: translateX(5px);
}

.toc-list a.active {
    background: #2563eb;
    color: white;
}

/* Text Content */
.text-content {
    font-family: 'Adishila', serif;
    line-height: 1.8;
    color: #1f2937;
    margin-bottom: 3rem;
}

/* Chapter Styles */
.chapter {
    margin-bottom: 3rem;
    padding: 2rem;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.chapter-title {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e5e7eb;
    text-align: center;
}

.chapter-subtitle {
    font-size: 1.2rem;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 2rem;
    text-align: center;
    font-style: italic;
}

/* Verse Styles */
.verse {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f9fafb;
    border-radius: 0.75rem;
    border-left: 4px solid #2563eb;
    position: relative;
}

.verse-number {
    position: absolute;
    top: 0.5rem;
    right: 1rem;
    background: #2563eb;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 600;
}

.verse-text {
    font-size: 1.1rem;
    line-height: 2;
    margin-bottom: 1rem;
    text-align: center;
}

.verse-translation {
    font-size: 1rem;
    line-height: 1.6;
    color: #6b7280;
    font-style: italic;
    padding: 1rem;
    background: white;
    border-radius: 0.5rem;
    margin-top: 1rem;
    border-left: 3px solid #e5e7eb;
}

/* Sanskrit Text Toggle */
.sanskrit-text {
    display: none;
    margin-top: 1rem;
    padding: 1rem;
    background: #fef3c7;
    border-radius: 0.5rem;
    border-left: 3px solid #f59e0b;
}

.sanskrit-text.show {
    display: block;
}

/* Reading Progress */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: #e5e7eb;
    z-index: 1000;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #2563eb, #3b82f6);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 1001;
}

/* Navigation Controls */
.text-navigation {
    display: flex;
    justify-content: space-between;
    margin: 2rem 0;
    gap: 1rem;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.nav-btn:hover:not(:disabled) {
    background: #1d4ed8;
    transform: translateY(-2px);
}

.nav-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

.nav-icon {
    font-size: 1.2rem;
}

/* Text Tools */
.text-tools {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.tool-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tool-btn:hover {
    background: #e5e7eb;
    transform: translateY(-1px);
}

.tool-icon {
    font-size: 1.1rem;
}

/* Search and Filter */
.text-search {
    margin: 2rem 0;
}

.search-container {
    display: flex;
    max-width: 500px;
    margin: 0 auto;
    gap: 0.5rem;
}

.search-container input {
    flex: 1;
    padding: 1rem;
    border: 2px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.search-container input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-btn {
    padding: 1rem 1.5rem;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background 0.3s ease;
}

.search-btn:hover {
    background: #1d4ed8;
}

.search-results {
    margin-top: 1rem;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    background: white;
}

.search-result {
    padding: 1rem;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: background 0.3s ease;
}

.search-result:hover {
    background: #f9fafb;
}

.search-result:last-child {
    border-bottom: none;
}

.search-highlight {
    background: #fef3c7;
    padding: 0.1rem 0.2rem;
    border-radius: 0.2rem;
}

/* Related Texts */
.related-texts {
    margin-top: 4rem;
    padding: 2rem;
    background: #f9fafb;
    border-radius: 1rem;
}

.related-texts h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1.5rem;
    text-align: center;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.related-text-card {
    background: white;
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.related-text-card:hover {
    transform: translateY(-2px);
}

.related-text-card h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.related-text-card p {
    color: #6b7280;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Font Size Classes */
.font-small .text-content {
    font-size: 0.9rem;
}

.font-medium .text-content {
    font-size: 1rem;
}

.font-large .text-content {
    font-size: 1.2rem;
}

.font-x-large .text-content {
    font-size: 1.4rem;
}

/* Line Spacing Classes */
.line-tight .text-content {
    line-height: 1.4;
}

.line-normal .text-content {
    line-height: 1.8;
}

.line-relaxed .text-content {
    line-height: 2.2;
}

.line-loose .text-content {
    line-height: 2.6;
}

/* Theme Classes */
.theme-light {
    background: #ffffff;
    color: #1f2937;
}

.theme-sepia {
    background: #fdf8f3;
    color: #2d3748;
}

.theme-sepia .text-content {
    background: #fdf8f3;
}

.theme-sepia .verse {
    background: #f7f3ee;
}

.theme-dark {
    background: #1f2937;
    color: #f9fafb;
}

.theme-dark .text-content {
    background: #1f2937;
    color: #f9fafb;
}

.theme-dark .verse {
    background: #374151;
    color: #f9fafb;
}

.theme-dark .chapter {
    background: #374151;
    color: #f9fafb;
}

.theme-high-contrast {
    background: #000000;
    color: #ffffff;
}

.theme-high-contrast .text-content {
    background: #000000;
    color: #ffffff;
}

.theme-high-contrast .verse {
    background: #1a1a1a;
    color: #ffffff;
    border-left-color: #ffff00;
}

/* Responsive Design */
@media (max-width: 768px) {
    .text-container {
        padding: 1rem;
    }
    
    .text-title {
        font-size: 2rem;
    }
    
    .text-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .reading-controls {
        flex-direction: column;
        gap: 1rem;
    }
    
    .control-group {
        width: 100%;
    }
    
    .text-navigation {
        flex-direction: column;
    }
    
    .nav-btn {
        justify-content: center;
    }
    
    .text-tools {
        justify-content: center;
    }
    
    .tool-btn {
        flex: 1;
        justify-content: center;
    }
    
    .chapter {
        padding: 1rem;
    }
    
    .verse {
        padding: 1rem;
    }
    
    .verse-text {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .text-container {
        padding: 0.5rem;
    }
    
    .text-title {
        font-size: 1.5rem;
    }
    
    .chapter-title {
        font-size: 1.5rem;
    }
    
    .verse-text {
        font-size: 0.9rem;
    }
    
    .reading-controls {
        padding: 1rem;
    }
    
    .toc {
        padding: 1rem;
    }
    
    .text-tools {
        gap: 0.5rem;
    }
    
    .tool-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
    
    .search-container {
        flex-direction: column;
    }
    
    .search-container input {
        width: 100%;
    }
}

/* Print Styles */
@media print {
    .reading-controls,
    .text-navigation,
    .text-tools,
    .text-search,
    .related-texts,
    .reading-progress,
    .progress-text {
        display: none !important;
    }
    
    .text-container {
        padding: 0;
        max-width: none;
    }
    
    .text-content {
        font-size: 12pt;
        line-height: 1.5;
    }
    
    .verse {
        page-break-inside: avoid;
        margin-bottom: 1rem;
    }
    
    .chapter {
        page-break-before: always;
    }
    
    .chapter:first-child {
        page-break-before: avoid;
    }
}

/* Accessibility Enhancements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus Styles */
button:focus,
select:focus,
input:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .verse {
        border-left-width: 6px;
    }
    
    .toc {
        border-left-width: 6px;
    }
    
    .btn-secondary,
    .nav-btn,
    .search-btn {
        border: 2px solid currentColor;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .theme-light {
        background: #1f2937;
        color: #f9fafb;
    }
    
    .theme-light .text-content {
        background: #1f2937;
        color: #f9fafb;
    }
    
    .theme-light .verse {
        background: #374151;
        color: #f9fafb;
    }
    
    .theme-light .chapter {
        background: #374151;
        color: #f9fafb;
    }
} 