/* 
 * VietReader Frontend CSS Stylesheet
 * Được thiết kế trang nhã, hiện đại, không xung đột với các thành phần giao diện khác.
 */

.vr-toolbar-wrapper {
    background-color: #fcfcfc;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    font-family: 'Be Vietnam Pro', system-ui, sans-serif;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.vr-primary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

/* Nút điều hướng chính */
.vr-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.vr-btn-primary {
    background-color: #0284c7;
    color: #ffffff;
}

.vr-btn-primary:hover {
    background-color: #0369a1;
    transform: translateY(-1px);
}

.vr-btn-primary.vr-speaking {
    background-color: #ea580c;
    animation: vr-pulse-orange 2s infinite;
}

.vr-btn-secondary {
    background-color: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
}

.vr-btn-secondary:hover {
    background-color: #e5e7eb;
}

/* Cụm điều khiển Media */
.vr-media-controls {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background-color: #f3f4f6;
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.vr-control-btn {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    transition: transform 0.1s ease;
}

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

.vr-speed-control {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #4b5563;
    border-left: 1px solid #d1d5db;
    padding-left: 10px;
    margin-left: 4px;
}

.vr-speed-control input[type="range"] {
    width: 70px;
    height: 4px;
    cursor: pointer;
}

/* Khối Customizer */
.vr-customizer-panel {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 14px;
    animation: vr-slide-down 0.2s ease-out;
}

.vr-panel-section {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.vr-section-title {
    font-size: 13px;
    font-weight: 600;
    color: #4b5563;
    width: 120px;
}

.vr-font-selector-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.vr-font-opt-btn {
    padding: 6px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 12px;
    background-color: #ffffff;
    cursor: pointer;
    transition: all 0.15s ease;
}

.vr-font-opt-btn:hover, .vr-font-opt-btn.vr-active {
    border-color: #0284c7;
    color: #0284c7;
    background-color: #f0f9ff;
}

.vr-size-adjuster {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 4px 10px;
}

.vr-size-btn {
    background: none;
    border: none;
    font-weight: bold;
    cursor: pointer;
    color: #4b5563;
    font-size: 14px;
}

.vr-size-btn:hover {
    color: #0284c7;
}

.vr-bg-selector-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.vr-bg-opt-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.1);
    cursor: pointer;
    font-size: 9px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease;
}

.vr-bg-opt-btn:hover, .vr-bg-opt-btn.vr-active {
    transform: scale(1.15);
    box-shadow: 0 0 0 2px #0284c7;
}

.vr-btn-reset {
    background-color: #fee2e2 !important;
    border-radius: 6px !important;
    width: auto !important;
    height: auto !important;
    padding: 4px 10px !important;
    font-size: 11px !important;
}

.vr-hidden {
    display: none !important;
}

.vietreader-entry-content {
    transition: all 0.3s ease;
}

/* Animations */
@keyframes vr-pulse-orange {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(234, 88, 12, 0.5);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(234, 88, 12, 0);
    }
}

@keyframes vr-slide-down {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Click-to-Read Sentence Highlighting */
.vr-selectable-sentence {
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px dashed transparent;
}

.vr-selectable-sentence:hover {
    background-color: rgba(2, 132, 199, 0.08) !important; /* sky blue light hover */
    color: #0284c7 !important;
}

.vr-selectable-sentence.vr-active-sentence {
    background-color: rgba(253, 224, 71, 0.6) !important; /* warm yellow highlight */
    color: #000000 !important;
    border-radius: 3px;
    padding: 1px 3px;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* Sticky Bottom Player Bar */
.vr-sticky-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #0f172a !important; /* Slate 900 */
    color: #ffffff !important;
    border-top: 1px solid #1e293b !important; /* Slate 800 */
    box-shadow: 0 -10px 25px -5px rgba(0, 0, 0, 0.3), 0 -8px 10px -6px rgba(0, 0, 0, 0.3);
    padding: 12px 20px;
    z-index: 999999 !important;
    font-family: 'Be Vietnam Pro', system-ui, sans-serif !important;
    animation: vr-slide-up 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: block;
}

.vr-sticky-player.vr-hidden {
    display: none !important;
}

.vr-sticky-content {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.vr-sticky-info {
    flex: 1;
    min-width: 0;
    text-align: left;
}

.vr-sticky-tag {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    color: #38bdf8 !important; /* sky 400 */
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.vr-sticky-title {
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #f8fafc !important;
    margin: 2px 0 0 0 !important;
    padding: 0 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2 !important;
}

.vr-sticky-progress-text {
    font-size: 10px !important;
    color: #94a3b8 !important; /* slate 400 */
    margin-top: 2px !important;
}

.vr-sticky-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.vr-sticky-btn {
    background: none !important;
    border: none !important;
    font-size: 16px !important;
    cursor: pointer !important;
    padding: 6px !important;
    border-radius: 6px !important;
    transition: all 0.2s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #ffffff !important;
}

.vr-sticky-btn:hover {
    background-color: #1e293b !important;
    transform: scale(1.05);
}

.vr-sticky-play-pause-btn {
    width: 32px !important;
    height: 32px !important;
    background-color: #0284c7 !important;
    border-radius: 50% !important;
    color: #ffffff !important;
    font-size: 12px !important;
}

.vr-sticky-play-pause-btn:hover {
    background-color: #0369a1 !important;
}

.vr-sticky-divider {
    height: 20px;
    width: 1px;
    background-color: #334155;
    margin: 0 4px;
}

@keyframes vr-slide-up {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

/* Adjust layout on mobile */
@media (max-width: 480px) {
    .vr-sticky-player {
        padding: 10px 14px;
    }
    .vr-sticky-title {
        font-size: 11px !important;
        max-width: 150px;
    }
    .vr-sticky-tag {
        font-size: 8px;
    }
    .vr-sticky-progress-text {
        font-size: 9px !important;
    }
}

@media print {
    .no-print {
        display: none !important;
    }
}
