/**
 * Daily Biblical Readings App - Styles
 * Версия: 1.0
 * Дата: 12 февраля 2026
 */

/* === RESET & BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.daily-reading-page {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow: hidden;
    height: 100vh;
    height: 100dvh; /* Для Safari на iOS */
    background: #000;
    color: #fff;
    touch-action: pan-y;
}

/* === APP CONTAINER === */
.app-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* === MEDIA SECTION (3/4) === */
.media-section {
    position: relative;
    flex: 3;
    overflow: hidden;
    background: #1a1a1a;
}

.media-content {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.media-placeholder {
    background: linear-gradient(135deg, #1F4E78, #2E5C8A);
}

.media-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.8));
    pointer-events: none;
}

/* === DAY NAVIGATION (Вчера / Завтра) === */
.day-navigation {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 20;
    pointer-events: none;
}

.nav-arrow {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    pointer-events: all;
    touch-action: manipulation;
}

.nav-arrow svg {
    width: 20px;
    height: 20px;
}

.nav-arrow:not(.disabled):hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
}

.nav-arrow:not(.disabled):active {
    transform: scale(0.95);
}

.nav-arrow.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* === READING INFO === */
.reading-info {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    z-index: 10;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

.feast-name {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #FFD700;
    margin-bottom: 6px;
}

.reading-date {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 4px;
}

.bible-reference {
    font-size: 16px;
    font-weight: 400;
    opacity: 0.95;
}

/* === AUDIO SECTION (1/4) === */
.audio-section {
    flex: 1;
    background: linear-gradient(to bottom, #1F4E78, #2E5C8A);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

.audio-player {
    width: 100%;
    max-width: 500px;
}

/* === PROGRESS BAR === */
.progress-container {
    margin-bottom: 20px;
}

.progress-bar {
    position: relative;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    cursor: pointer;
    margin-bottom: 8px;
    overflow: visible;
}

.progress-filled {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: #fff;
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s linear;
}

.progress-handle {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    cursor: grab;
    left: 0%;
    transition: left 0.1s linear;
    opacity: 0;
}

.progress-bar:hover .progress-handle,
.progress-handle.dragging {
    opacity: 1;
}

.progress-handle.dragging {
    cursor: grabbing;
    transform: translate(-50%, -50%) scale(1.2);
}

.time-display {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    font-variant-numeric: tabular-nums;
}

/* === CONTROLS === */
.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
}

.control-btn {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, opacity 0.2s;
    touch-action: manipulation;
}

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

.control-btn:active {
    transform: scale(0.95);
}

.play-pause-btn {
    padding: 4px;
}

.play-pause-btn svg {
    width: 56px;
    height: 56px;
}

.rewind-btn svg,
.forward-btn svg {
    width: 36px;
    height: 36px;
}

.hidden {
    display: none !important;
}

/* === BOTTOM BAR === */
.bottom-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(31, 78, 120, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0 20px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
    z-index: 100;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.bottom-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 8px 16px;
    transition: all 0.2s;
    touch-action: manipulation;
    min-width: 80px;
}

.bottom-btn svg {
    width: 22px;
    height: 22px;
    pointer-events: none; /* Не блокировать клики по кнопке */
}

.bottom-btn span {
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    pointer-events: none; /* Не блокировать клики по кнопке */
}

.bottom-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.bottom-btn:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.15);
}

/* === TEXT PANEL === */
.text-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    z-index: 1000;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    color: #333;
}

.text-panel.active {
    transform: translateY(0);
}

.text-panel-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background: #1F4E78;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    gap: 12px;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    padding: 8px;
    margin-left: -8px;
    border-radius: 4px;
    transition: background 0.2s;
    touch-action: manipulation;
}

.back-btn:hover,
.back-btn:active {
    background: rgba(255, 255, 255, 0.1);
}

.back-btn svg {
    width: 20px;
    height: 20px;
}

.text-panel-header h2 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    flex: 1;
}

.text-panel-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 20px 100px;
}

.reading-text {
    padding: 24px 0;
    font-size: 18px;
    line-height: 1.8;
    color: #333;
    max-width: 700px;
    margin: 0 auto;
}

.reading-text p {
    margin-bottom: 1em;
}

.reading-text strong {
    font-weight: 600;
    color: #1F4E78;
}

/* === FONT SIZE CONTROLS === */
.font-size-controls {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 8px;
    background: #fff;
    padding: 8px;
    border-radius: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1001;
}

.font-btn {
    width: 44px;
    height: 44px;
    border: 2px solid #1F4E78;
    background: #fff;
    color: #1F4E78;
    border-radius: 50%;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    touch-action: manipulation;
}

.font-btn:active {
    background: #1F4E78;
    color: #fff;
}

/* === MENU PANEL (как текстовая панель) === */
.menu-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    z-index: 1000;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    color: #333;
}

.menu-panel.active {
    transform: translateY(0);
}

.menu-panel-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background: #1F4E78;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    gap: 12px;
}

.menu-panel-header h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    flex: 1;
}

.menu-panel-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 24px 20px;
}

.menu-item {
    margin-bottom: 24px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 24px;
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item-label {
    font-size: 14px;
    font-weight: 600;
    color: #666;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.menu-item-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #f5f5f5;
    border-radius: 12px;
    color: #1F4E78;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.2s;
    touch-action: manipulation;
}

.menu-item-link:hover,
.menu-item-link:active {
    background: #e8e8e8;
    transform: translateX(4px);
}

.menu-item-link svg {
    opacity: 0.5;
}

/* === NO READING PAGE === */
.no-reading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    padding: 20px;
    text-align: center;
    background: linear-gradient(to bottom, #1F4E78, #2E5C8A);
    color: #fff;
}

.no-reading-icon {
    margin-bottom: 24px;
    opacity: 0.8;
}

.no-reading-icon svg {
    stroke: #fff;
}

.no-reading h2 {
    font-size: 28px;
    margin-bottom: 16px;
}

.no-reading p {
    font-size: 16px;
    opacity: 0.9;
    margin-bottom: 32px;
}

.last-reading-link {
    margin-top: 20px;
}

.btn-primary {
    display: inline-block;
    padding: 14px 32px;
    background: #fff;
    color: #1F4E78;
    text-decoration: none;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* === RESPONSIVE === */
@media (max-width: 480px) {
    .reading-info {
        left: 16px;
        right: 16px;
        bottom: 16px;
    }

    .feast-name {
        font-size: 12px;
    }

    .reading-date {
        font-size: 16px;
    }

    .bible-reference {
        font-size: 14px;
    }

    .audio-section {
        padding: 16px 16px 76px;
    }

    .controls {
        gap: 20px;
    }

    .play-pause-btn svg {
        width: 48px;
        height: 48px;
    }

    .rewind-btn svg,
    .forward-btn svg {
        width: 32px;
        height: 32px;
    }

    .reading-text {
        font-size: 16px;
        line-height: 1.7;
    }

    .day-navigation {
        padding: 0 8px;
    }

    .nav-arrow {
        padding: 8px 12px;
        font-size: 12px;
    }

    .nav-arrow svg {
        width: 16px;
        height: 16px;
    }

    .bottom-bar {
        height: 56px;
        padding: 0 12px;
    }

    .bottom-btn {
        padding: 6px 10px;
        min-width: 70px;
    }

    .bottom-btn span {
        font-size: 10px;
    }
}

/* === LANDSCAPE === */
@media (orientation: landscape) and (max-height: 500px) {
    .media-section {
        flex: 2;
    }

    .audio-section {
        flex: 1;
        padding: 12px 16px 72px;
    }

    .controls {
        gap: 15px;
    }

    .progress-container {
        margin-bottom: 12px;
    }

    .reading-info {
        bottom: 12px;
    }

    .bottom-bar {
        height: 50px;
    }
}

/* === TOUCH === */
@media (hover: none) and (pointer: coarse) {
    .control-btn:active {
        transform: scale(0.9);
        opacity: 0.8;
    }

    .progress-handle {
        width: 20px;
        height: 20px;
        opacity: 1;
    }
}

/* === LOADING STATE === */
.audio-player.loading .control-btn {
    opacity: 0.5;
    pointer-events: none;
}

/* === ANIMATIONS === */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.app-container {
    animation: fadeIn 0.3s ease-out;
}

/* === SAFE AREA (iOS) === */
@supports (padding-top: env(safe-area-inset-top)) {
    .bottom-bar {
        padding-bottom: calc(env(safe-area-inset-bottom) + 0px);
        height: calc(60px + env(safe-area-inset-bottom));
    }

    .audio-section {
        padding-bottom: calc(76px + env(safe-area-inset-bottom));
    }
}

/* === PRINT === */
@media print {
    .app-container {
        overflow: visible;
        height: auto;
    }

    .media-section,
    .audio-section,
    .bottom-bar,
    .day-navigation,
    .font-size-controls {
        display: none;
    }

    .text-panel {
        position: static;
        transform: none;
        background: #fff;
        color: #000;
    }

    .text-panel-content {
        overflow: visible;
        padding: 20px;
    }

    .reading-text {
        font-size: 12pt;
        line-height: 1.6;
        color: #000;
    }
}
