/* ============================================
   assets/css/orthodox.css - Православна естетика (КОРИГИРАН v1.4)
   ============================================ */

/* Quote Section - THEME SUPPORT */
.daily-quote {
    background: var(--bg-secondary);
    padding: 3rem 0;
    border-top: 3px solid var(--gold);
    border-bottom: 3px solid var(--gold);
}

.quote-card {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    position: relative;
}

.quote-icon {
    font-size: 3rem;
    color: var(--gold);
    margin-bottom: 1rem;
}

.quote-text {
    font-size: 1.5rem;
    font-style: italic;
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1.8;
}

.quote-author {
    font-size: 1.1rem;
    color: var(--gold-text);
    font-weight: 600;
}

/* Saint of the Day */
.saint-of-day {
    padding: 3rem 0;
    background: linear-gradient(135deg, var(--blue) 0%, var(--deep-blue) 100%);
    color: white;
    /* Performance: секцията е под fold-а на index.php при първо зареждане.
       content-visibility пропуска paint/layout работа докато не е близо
       до viewport-а. contain-intrinsic-size пази мястото за scrollbar-а. */
    content-visibility: auto;
    contain-intrinsic-size: auto 400px;
}

.saint-card {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
    padding: 2rem;
    background: rgba(255,255,255,0.1);
    border-radius: 15px;
    border: 2px solid var(--gold);
}

.saint-card h3 {
    color: var(--gold);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.saint-card h4 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

/* Prayer Modal Styling - THEME SUPPORT */
.prayer-content {
    text-align: center;
}

.prayer-content h2 {
    color: var(--gold);
    margin-bottom: 1.25rem;
}

.prayer-text {
    background: var(--cream);
    padding: 1.5rem;
    border-radius: 10px;
    border-left: 5px solid var(--gold);
    margin-bottom: 1.5rem;
}

.prayer-text p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 0.4rem;
    color: var(--modal-text);
}

.prayer-text .amen {
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--gold);
    margin-top: 0.75rem;
}

/* Video Carousel - THEME SUPPORT */
.video-carousel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

/* Featured Section - РАЗЛИЧЕН ФОН */
.featured-section {
    padding: 3rem 0;
    background: var(--bg-secondary);
}

/* Theme-specific за featured section */
:root[data-theme="light"] .featured-section {
    background: #ffffff !important;
}

:root[data-theme="dark"] .featured-section {
    background: #2a2a2a !important;
}

/* Newsletter Section - THEME SUPPORT */
.newsletter-section {
    background: linear-gradient(135deg, var(--blue) 0%, var(--deep-blue) 100%);
    padding: 4rem 0;
    color: white;
    /* Performance: под fold-а на index.php — виж бележката при .saint-of-day */
    content-visibility: auto;
    contain-intrinsic-size: auto 350px;
}

.newsletter-card {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.newsletter-card h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.newsletter-form {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.newsletter-form input {
    flex: 1;
    padding: 1rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
}

.newsletter-form button {
    padding: 1rem 2rem;
}

/* Video Player Page */
.video-player-section {
    background: #000;
    padding: 0;
}

.video-player-wrapper {
    max-width: 1400px;
    margin: 0 auto;
}

.video-player {
    position: relative;
    padding-top: 56.25%;
    background: #000;
}

.video-player video,
.video-player iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* БЪГФИКС: video/iframe не се разширяваше на fullscreen.
   .video-player ползва padding-top:56.25% (aspect-ratio hack), а
   video/iframe вътре е position:absolute; width/height:100% спрямо
   тази кутия. Тези правила имат по-висока CSS specificity
   (.video-player iframe → 0,1,1) от браузърния default за :fullscreen
   (0,1,0), затова печелят каскадата и iframe-ът остава заклещен в
   малката 56.25% кутия дори докато е "на fullscreen" — вместо
   реално да покрие целия екран. Тук вдигаме specificity-то нарочно
   (.video-player iframe:fullscreen → 0,2,1), за да наложим fixed
   позициониране спрямо viewport-а, докато е в fullscreen режим. */
.video-player video:fullscreen,
.video-player iframe:fullscreen,
.video-player video:-webkit-full-screen,
.video-player iframe:-webkit-full-screen,
.video-player video:-moz-full-screen,
.video-player iframe:-moz-full-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
}

.video-info-section {
    padding: 2rem 0;
}

.video-main-info {
    margin-bottom: 2rem;
}

.video-title {
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.video-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

.video-stats span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.video-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--cream);
    border-radius: 10px;
}

.rating-widget {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stars {
    display: flex;
    gap: 0.25rem;
}

.star {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    line-height: 1;
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.2s;
    opacity: 0.3;
}

.star.active {
    opacity: 1;
}

.star:hover {
    transform: scale(1.2);
}

.rating-info {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.action-btn {
    padding: 0.75rem 1.5rem;
    background: var(--bg-secondary);
    border: 2px solid var(--gold);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    color: var(--text-primary);
    /* .donate-action-btn е <a>, не <button> — линковете имат underline
       по подразбиране, който се наследява и от .action-btn-icon (💝 е
       текстов Unicode символ, не картинка) И от .action-btn-label,
       затова изглеждаше като черта под иконата И текста едновременно. */
    text-decoration: none;
    display: inline-block;
}

.action-btn:hover,
.action-btn.active {
    background: var(--gold-fill);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(201, 169, 97, 0.4);
}

.prayer-btn {
    background: var(--blue);
    color: white;
    border-color: var(--blue);
}

.prayer-btn:hover {
    background: var(--deep-blue);
    border-color: var(--deep-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(22, 33, 62, 0.4);
}

/* Donate action бутон — розово/червен градиент вместо навy/злато,
   съзнателно различен от другите 3, за да се откроява като отделен
   CTA, не поредното действие. */
.donate-action-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 50%, #c44569 100%);
    color: white;
    border-color: transparent;
}

.donate-action-btn:hover {
    background: linear-gradient(135deg, #ff7979 0%, #f06292 50%, #d5517c 100%);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(238, 90, 111, 0.45);
}

:root[data-theme="dark"] .donate-action-btn {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 50%, #922b21 100%);
}

:root[data-theme="dark"] .donate-action-btn:hover {
    background: linear-gradient(135deg, #ec7063 0%, #e74c3c 50%, #cb4335 100%);
}

/* Video Details Grid */
.video-details-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

.video-description {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px var(--shadow);
}

.video-description h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.uploader-info {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
}

/* Comments Section - THEME SUPPORT */
.comments-section {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px var(--shadow);
    /* Performance: contain (без content-visibility) — коментарите могат
       да имат anchor линкове (#comment-123), а content-visibility:auto
       изисква допълнителна beforematch логика за да работи коректно с
       такива директни скролове. contain: layout е безопасен компромис. */
    contain: layout style;
}

.comments-section h3 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.comment-form {
    margin-bottom: 2rem;
}

.comment-form textarea {
    width: 100%;
    min-height: 100px;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    resize: vertical;
    font-family: inherit;
    margin-bottom: 1rem;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.comment-form textarea:focus {
    outline: none;
    border-color: var(--gold);
}

.login-prompt {
    text-align: center;
    padding: 2rem;
    background: var(--cream);
    border-radius: 8px;
}

.login-prompt a {
    color: var(--gold);
    font-weight: 600;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.comment {
    padding: 1rem;
    background: var(--cream);
    border-radius: 8px;
    border-left: 3px solid var(--gold);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.comment-author {
    color: var(--gold-text);
    font-weight: 600;
}

.comment-date {
    color: var(--text-light);
    font-size: 0.875rem;
}

.comment-content {
    color: var(--text-primary);
    line-height: 1.6;
}

/* Recommended Section */
.recommended-section {
    margin-top: 3rem;
}

.recommended-section h3 {
    color: var(--text-primary);
    font-size: 1.8rem;
    margin-bottom: 2rem;
}

/* Share Modal */
.share-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
}

.share-links input {
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* Ornamental Decorations */
.header-ornament-top::before,
.header-ornament-bottom::after {
    content: '☦';
    position: absolute;
    color: var(--gold);
    font-size: 1.5rem;
}

/* Footer ornaments - без gap */
.footer-ornament-top,
.footer-ornament-bottom {
    height: 0;
    overflow: hidden;
}

/* Hover Effects */
.video-card,
.category-card,
.btn {
    position: relative;
    overflow: hidden;
}

.video-card::before,
.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(201,169,97,0.1), transparent);
    transition: left 0.5s;
}

.video-card:hover::before,
.category-card:hover::before {
    left: 100%;
}

/* Loading Animation */
@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

.loading {
    animation: shimmer 2s infinite;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 1000px 100%;
}

/* Scrollbar Styling - THEME SUPPORT */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--dark-gold);
}

/* Byzantine-inspired borders */
.ornate-border {
    border: 3px solid var(--gold);
    border-image: repeating-linear-gradient(
        45deg,
        var(--gold),
        var(--gold) 10px,
        var(--dark-gold) 10px,
        var(--dark-gold) 20px
    ) 3;
}

/* ============================================
   THEME-SPECIFIC CORRECTIONS
   ============================================ */

/* Светла тема корекции */
:root[data-theme="light"] .video-description,
:root[data-theme="light"] .comments-section {
    background: #ffffff !important;
}

:root[data-theme="light"] .comment {
    background: #f8f5ed !important;
}

:root[data-theme="light"] .video-actions {
    background: #f8f5ed !important;
}

:root[data-theme="light"] .action-btn {
    background: #ffffff !important;
    color: #2c3e50 !important;
    border-color: #c9a961 !important;
}

:root[data-theme="light"] .action-btn:hover {
    background: #a68943 !important;
    color: #ffffff !important;
}

/* По-висока специфичност (.action-btn.donate-action-btn), за да
   победи генеричния override точно над това правило — иначе
   градиентът никога не се вижда, винаги пада обратно на бяло/злато. */
:root[data-theme="light"] .action-btn.donate-action-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 50%, #c44569 100%) !important;
    color: #ffffff !important;
    border-color: transparent !important;
}

:root[data-theme="light"] .action-btn.donate-action-btn:hover {
    background: linear-gradient(135deg, #ff7979 0%, #f06292 50%, #d5517c 100%) !important;
    color: #ffffff !important;
}

:root[data-theme="light"] .action-btn.active {
    background: #a68943 !important;
    color: #ffffff !important;
}

:root[data-theme="light"] .prayer-btn {
    background: #16213e !important;
    color: #ffffff !important;
    border-color: #16213e !important;
}

:root[data-theme="light"] .prayer-btn:hover {
    background: #0f3460 !important;
    border-color: #0f3460 !important;
}

/* Тъмна тема корекции */
:root[data-theme="dark"] .video-description,
:root[data-theme="dark"] .comments-section {
    background: #2a2a2a !important;
}

:root[data-theme="dark"] .comment {
    background: #1a1a1a !important;
}

:root[data-theme="dark"] .video-actions {
    background: #1a1a1a !important;
}

:root[data-theme="dark"] .action-btn {
    background: #2a2a2a !important;
    color: #e0e0e0 !important;
    border-color: #c9a961 !important;
}

:root[data-theme="dark"] .action-btn.donate-action-btn {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 50%, #922b21 100%) !important;
    color: #ffffff !important;
    border-color: transparent !important;
}

:root[data-theme="dark"] .action-btn.donate-action-btn:hover {
    background: linear-gradient(135deg, #ec7063 0%, #e74c3c 50%, #cb4335 100%) !important;
    color: #ffffff !important;
}

:root[data-theme="dark"] .action-btn:hover {
    background: #c78748 !important;
    color: #ffffff !important;
}

:root[data-theme="dark"] .action-btn.active {
    background: #c78748 !important;
    color: #ffffff !important;
}

:root[data-theme="dark"] .prayer-btn {
    background: #4a5f7f !important;
    color: #ffffff !important;
    border-color: #4a5f7f !important;
}

:root[data-theme="dark"] .prayer-btn:hover {
    background: #2c3e50 !important;
    border-color: #2c3e50 !important;
}

:root[data-theme="dark"] .loading {
    background: linear-gradient(90deg, #2a2a2a 25%, #333 50%, #2a2a2a 75%);
}

@media (max-width: 768px) {
    .video-details-grid {
        grid-template-columns: 1fr;
    }
    
    .newsletter-form {
        flex-direction: column;
    }
    
    .prayer-text p {
        font-size: 1rem;
    }
    
    .video-stats {
        font-size: 0.875rem;
    }
}