/* /app/static/significantstories_com/css/article.css */

/* --- Article Footer Styles --- */

.article-footer {
    padding-top: 2rem;
    border-top: 1px solid #e9ecef;
    margin-top: 2rem;
}

/* Footer Navigation Card Styles */
.nav-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: stretch; /* Make cards same height */
    gap: 1.5rem;
}

/* Favorite row (full width, centered) */
.nav-links-favorite {
    flex-basis: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

/* Breadcrumb row (full width, centered) */
.nav-links-breadcrumb {
    flex-basis: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 0.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e9ecef;
}

.nav-links-breadcrumb .article-breadcrumb {
    margin-top: 0;
}


.nav-card {
    flex: 1; /* Each card takes up half the space */
    display: flex;
    flex-direction: column;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    background-color: #ffffff;
    border: 1px solid #e9ecef;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.04);
}

.nav-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 14px rgba(0,0,0,0.07);
    border-color: #ced4da;
}

.nav-card-placeholder {
    flex: 1;
}

.nav-card-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: #3498db;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 0.25rem;
}

.nav-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
}

.nav-card.prev {
    text-align: left;
}

.nav-card.next {
    text-align: right;
}

/* --- YouTube Block Styles --- */

.youtube-block {
    margin: 1.5rem 0;
}

.youtube-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.youtube-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* --- Article Reading Stats (for returning visitors) --- */

.article-reading-stats {
    display: block;
    text-align: center;
    margin-bottom: 0.5rem;
}

/* Guest prompt stats are clickable */
.article-reading-stats.guest-prompt {
    cursor: pointer;
    transition: opacity 0.15s;
}

.article-reading-stats.guest-prompt:hover {
    opacity: 0.7;
}

/* --- Article Actions Row (history, favorite, book icons) --- */

.article-actions-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.article-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    background: transparent;
    color: #aaa;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s ease;
    text-decoration: none;
}

.article-action-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* History button */
.article-action-btn.history-btn {
    color: #888;
}

.article-action-btn.history-btn:hover {
    color: #5b8fa8;
    background: rgba(91, 143, 168, 0.1);
}

.reading-stats-text {
    font-size: 0.85rem;
    color: #888;
    font-style: italic;
}

.reading-stats-date {
    /* Will be converted to local date by JavaScript */
}

.article-reading-stats.guest-prompt .reading-stats-text {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.guest-prompt-icon {
    opacity: 0.6;
    vertical-align: middle;
}

/* --- Favorite Toggle Button --- */

.favorite-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    background: transparent;
    color: #ccc;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.favorite-toggle:hover {
    color: #d4a537;
    background: rgba(212, 165, 55, 0.1);
}

.favorite-toggle.favorited {
    color: #d4a537;
}

.favorite-toggle.favorited:hover {
    color: #b8922f;
}

.favorite-toggle .star-icon {
    transition: transform 0.15s ease;
}

.favorite-toggle:active .star-icon {
    transform: scale(0.9);
}

/* Pulse animation when toggling */
@keyframes favorite-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.favorite-toggle.animating .star-icon {
    animation: favorite-pulse 0.3s ease;
}

/* Favorite toggle label color */
.favorite-toggle-label {
    color: inherit;
}

/* Inline favorite toggle in footer (pill style) */
.favorite-toggle.favorite-toggle-inline {
    width: auto;
    height: auto;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ddd;
    background: none;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #888;
    gap: 0.375rem;
    white-space: nowrap;
}

.favorite-toggle.favorite-toggle-inline svg {
    width: 14px;
    height: 14px;
}

.favorite-toggle.favorite-toggle-inline:hover {
    border-color: #d4a537;
    color: #d4a537;
}

.favorite-toggle.favorite-toggle-inline.favorited {
    border-color: #d4a537;
    color: #d4a537;
}

.favorite-toggle.favorite-toggle-inline.favorited:hover {
    color: #b8922f;
    border-color: #b8922f;
}

/* --- Inline Practice Icons in Articles --- */

.heading-with-practice {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.heading-with-practice h1,
.heading-with-practice h2,
.heading-with-practice h3,
.heading-with-practice h4,
.heading-with-practice h5,
.heading-with-practice h6 {
    margin-top: 0;
}

.markdown-with-practice {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.inline-practice-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f5f2ee;
    border-radius: 10px;
    color: #8b7355;
    position: relative;
    z-index: 1;
    box-sizing: border-box;
}


.inline-practice-icon svg {
    width: 28px;
    height: 28px;
    pointer-events: none; /* Let hover pass through to parent container */
}

.practice-markdown-content {
    flex: 1;
    min-width: 0;
}

/* Practice Tooltip */
.practice-tooltip-trigger {
    position: relative;
    cursor: pointer;
    z-index: 10;
}

/* Practice Tooltip - scoped to article content to avoid toc.css conflicts */
.practice-tooltip-trigger .practice-tooltip {
    display: none !important;
    position: absolute !important;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) !important;
    width: 280px;
    padding: 1rem;
    background-color: #f5f2ee;
    border: 1px solid #e8e4df;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    text-align: center;
    /* Override toc.css defaults which use opacity/transition for its tooltip system */
    opacity: 1 !important;
    pointer-events: auto !important;
    transition: none !important;
}

.practice-tooltip-trigger .practice-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: #f5f2ee;
    border-bottom: none;
}

.practice-tooltip-trigger .practice-tooltip::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 9px solid transparent;
    border-top-color: #e8e4df;
    border-bottom: none;
}

/* Show tooltip on tap/click (mobile + desktop) */
.practice-tooltip-trigger.active .practice-tooltip {
    display: block !important;
}

/* Show tooltip on hover only for devices with true hover capability (not touch) */
@media (hover: hover) {
    .practice-tooltip-trigger:hover .practice-tooltip {
        display: block !important;
    }
}

.practice-tooltip-trigger .practice-tooltip-title {
    font-family: var(--serif-font);
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.practice-tooltip-trigger .practice-tooltip-description {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #5a6a7a;
}

.practice-tooltip-trigger .practice-tooltip-link {
    display: inline-block;
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: #8b7355;
    text-decoration: none;
    font-weight: 500;
}

.practice-tooltip-trigger .practice-tooltip-link:hover {
    text-decoration: underline;
}

/* Mobile adjustments for tooltip */
@media (max-width: 768px) {
    .practice-tooltip-trigger .practice-tooltip {
        width: 260px;
        padding: 0.875rem;
    }
}

/* --- Unfavorite Confirmation Modal --- */
.unfavorite-confirm-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.unfavorite-confirm-overlay.active {
    display: flex;
}

.unfavorite-confirm-dialog {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    max-width: 360px;
    width: 100%;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.unfavorite-confirm-title {
    font-family: var(--serif-font, Georgia, serif);
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 0.75rem 0;
}

.unfavorite-confirm-message {
    font-size: 0.95rem;
    color: #666;
    margin: 0 0 1.5rem 0;
    line-height: 1.5;
}

.unfavorite-confirm-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.unfavorite-confirm-cancel,
.unfavorite-confirm-remove {
    padding: 0.625rem 1.25rem;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.unfavorite-confirm-cancel {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #495057;
}

.unfavorite-confirm-cancel:hover {
    background: #e9ecef;
}

.unfavorite-confirm-remove {
    background: #dc3545;
    border: 1px solid #dc3545;
    color: #fff;
}

.unfavorite-confirm-remove:hover {
    background: #c82333;
}

@media (max-width: 600px) {
    .unfavorite-confirm-dialog {
        padding: 1.25rem;
    }

    .unfavorite-confirm-actions {
        flex-direction: column-reverse;
    }

    .unfavorite-confirm-cancel,
    .unfavorite-confirm-remove {
        width: 100%;
    }
}

/* --- Breadcrumb Navigation --- */

.article-breadcrumb {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #888;
}

.breadcrumb-link {
    color: #6c757d;
    text-decoration: none;
    transition: color 0.15s ease;
}

.breadcrumb-link:hover {
    color: #3498db;
    text-decoration: underline;
}

.breadcrumb-separator {
    color: #adb5bd;
    font-size: 0.9em;
}

/* --- Article Content Divider --- */

.article-divider {
    border: none;
    border-top: 1px solid #e9ecef;
    margin: 0.75rem 0 1.5rem 0;
}

/* --- Book Toggle Button (Bookmark Icon) --- */

.book-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    background: transparent;
    color: #ccc;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.book-toggle:hover {
    color: #3498db;
    background: rgba(52, 152, 219, 0.1);
}

.book-toggle .bookmark-icon {
    transition: transform 0.15s ease;
}

.book-toggle:active .bookmark-icon {
    transform: scale(0.9);
}

/* Inline book toggle in footer (pill style) */
.book-toggle.book-toggle-inline {
    width: auto;
    height: auto;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ddd;
    background: none;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #888;
    gap: 0.375rem;
    white-space: nowrap;
}

.book-toggle.book-toggle-inline svg {
    width: 14px;
    height: 14px;
}

.book-toggle.book-toggle-inline:hover {
    border-color: #3498db;
    color: #3498db;
}

.book-toggle-label {
    color: inherit;
}

/* Book toggle "in books" state */
.book-toggle.in-books {
    color: #3498db;
}

.book-toggle.in-books:hover {
    color: #2980b9;
}

.book-toggle.book-toggle-inline.in-books {
    border-color: #3498db;
    color: #3498db;
}

.book-toggle.book-toggle-inline.in-books:hover {
    border-color: #2980b9;
    color: #2980b9;
}

/* --- Share Toggle (inline in footer, pill style) --- */

.share-toggle-footer {
    width: auto;
    height: auto;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ddd;
    background: none;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #888;
    gap: 0.375rem;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.share-toggle-footer svg {
    width: 14px;
    height: 14px;
}

.share-toggle-footer:hover {
    border-color: #6c757d;
    color: #6c757d;
}

.share-toggle-footer.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Shared state for share buttons (green - user has shared before) */
.share-toggle.shared,
.share-toggle-footer.shared {
    color: #28a745;
    border-color: #28a745;
}

.share-toggle.shared:hover,
.share-toggle-footer.shared:hover {
    color: #218838;
    border-color: #218838;
}

/* Not published state for share buttons (clickable but shows modal) */
.share-toggle.not-published,
.share-toggle-footer.not-published {
    opacity: 0.4;
    cursor: pointer;
    color: #6c757d;
}

.share-toggle.not-published:hover,
.share-toggle-footer.not-published:hover {
    opacity: 0.6;
    background: rgba(0, 0, 0, 0.05);
    color: #6c757d;
    border-color: #dee2e6;
}

.share-toggle-label {
    color: inherit;
}

/* Guest actions row (centered, full width) */
.guest-actions {
    justify-content: center;
}

/* --- Book Picker Modal --- */

.book-picker-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.book-picker-overlay:not([hidden]) {
    opacity: 1;
    pointer-events: auto;
}

.book-picker-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 360px;
    max-height: 80vh;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.book-picker-modal:not([hidden]) {
    opacity: 1;
    pointer-events: auto;
}

.book-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e9ecef;
}

.book-picker-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
}

.book-picker-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background: transparent;
    color: #6c757d;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.15s ease;
}

.book-picker-close:hover {
    background-color: #f8f9fa;
    color: #2c3e50;
}

.book-picker-content {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.book-picker-loading {
    padding: 2rem;
    text-align: center;
    color: #6c757d;
}

.book-picker-list {
    display: flex;
    flex-direction: column;
}

.book-picker-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    border: none;
    background: transparent;
    cursor: pointer;
    text-align: left;
    transition: background-color 0.15s ease;
}

.book-picker-item:hover {
    background-color: #f8f9fa;
}

.book-picker-item-check {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #3498db;
}

.book-picker-item-check svg {
    width: 18px;
    height: 18px;
}

.book-picker-item-check:not(.checked) {
    color: #dee2e6;
}

.book-picker-item-check.checked {
    color: #3498db;
}

.book-picker-item-name {
    flex: 1;
    font-size: 0.95rem;
    color: #2c3e50;
}

.book-picker-item.in-book .book-picker-item-name {
    font-weight: 500;
}

/* Books section with list and action buttons */
.book-picker-books-section {
    padding: 0 1.25rem 0.75rem;
}

.book-picker-empty {
    padding: 1.5rem 0;
    text-align: center;
    color: #6c757d;
    font-size: 0.9rem;
}

/* Action buttons container (Done/Cancel) */
.book-picker-actions {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e9ecef;
}

.book-picker-hint {
    margin: 0 0 0.75rem 0;
    font-size: 0.8rem;
    color: #6c757d;
    text-align: center;
}

.book-picker-actions-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* Shared button styles */
.book-picker-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.book-picker-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.book-picker-btn-primary {
    background-color: #d4a537;
    color: #fff;
}

.book-picker-btn-primary:hover:not(:disabled) {
    background-color: #c49428;
}

.book-picker-btn-secondary {
    background-color: #f8f9fa;
    color: #6c757d;
}

.book-picker-btn-secondary:hover:not(:disabled) {
    background-color: #e9ecef;
}

/* Divider between books list and create section */
.book-picker-divider {
    margin: 0.5rem 1.25rem;
    border: none;
    border-top: 1px solid #e9ecef;
}

/* Create new book section */
.book-picker-create {
    padding: 0.5rem 1.25rem 1rem;
}

.book-picker-create-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem;
    border: 1px dashed #dee2e6;
    background: transparent;
    border-radius: 8px;
    color: #6c757d;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.book-picker-create-btn:hover {
    border-color: #3498db;
    color: #3498db;
    background: rgba(52, 152, 219, 0.05);
}

.book-picker-create-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.book-picker-create-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.book-picker-create-input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 0.9rem;
}

.book-picker-create-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.15);
}

.book-picker-create-submit,
.book-picker-create-cancel {
    padding: 0.5rem 0.75rem;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.book-picker-create-submit {
    background-color: #3498db;
    color: #fff;
}

.book-picker-create-submit:hover {
    background-color: #2980b9;
}

.book-picker-create-cancel {
    background-color: #f8f9fa;
    color: #6c757d;
}

.book-picker-create-cancel:hover {
    background-color: #e9ecef;
}

.book-picker-error {
    padding: 0.75rem 1.25rem;
    color: #dc3545;
    font-size: 0.9rem;
}


