/* LifeVed Devotional — Component Library (Premium 9.5+ Target)
   Cards, Content Items, Tool Headers, Search, Grids */

/* === TOOL PAGE HEADER === */
.tool-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    min-height: 56px;
}
.tool-back {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    flex-shrink: 0;
    transition: all var(--duration);
}
.tool-back:hover { background: var(--accent-glow); border-color: var(--accent); color: var(--accent); }
.tool-header-title {
    flex: 1;
    font-size: var(--fs-lg);
    font-weight: 700;
    font-family: var(--font-heading);
    color: var(--text-primary);
    line-height: 1.3;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tool-header-actions { display: flex; gap: 4px; flex-shrink: 0; }

/* === CONTENT ITEM (List Row) === */
.content-list { display: flex; flex-direction: column; gap: 8px; }

.content-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text-primary);
    transition: all var(--duration) var(--ease-out);
    min-height: 64px;
    position: relative;
}
.content-item:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-glow);
    transform: translateX(4px);
}
.content-item:active { transform: scale(0.98); }
.content-item-icon {
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--bg-secondary), #fff7ee);
    font-size: 1.3rem;
    flex-shrink: 0;
    border: 1px solid var(--border);
}
.content-item-body { flex: 1; min-width: 0; }
.content-item-title {
    font-weight: 600;
    font-size: var(--fs-base);
    line-height: 1.4;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.content-item-sub {
    font-size: var(--fs-xs);
    color: var(--text-muted);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.content-item-arrow {
    color: var(--text-muted);
    flex-shrink: 0;
    opacity: 0.5;
    transition: all var(--duration);
}
.content-item:hover .content-item-arrow { opacity: 1; color: var(--accent); transform: translateX(3px); }

/* === CONTENT CARD (Grid — premium style) === */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
}
.content-card {
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s var(--ease-out);
    box-shadow: var(--shadow-sm);
}
.content-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}
.content-card:active { transform: scale(0.97); }
.content-card-img {
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: linear-gradient(135deg, var(--bg-secondary), #fef3e0);
    display: flex; align-items: center; justify-content: center;
}
.content-card-img img { width: 100%; height: 100%; object-fit: cover; }
.content-card-img .placeholder { font-size: 2.5rem; opacity: 0.5; }
.content-card-body { padding: 12px 14px 14px; }
.content-card-title {
    font-weight: 700;
    font-size: var(--fs-sm);
    line-height: 1.3;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.content-card-sub { font-size: var(--fs-xs); color: var(--text-muted); }
.content-card-badge {
    position: absolute;
    top: 8px; right: 8px;
}

/* === SECTION HEADER === */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
    padding-top: var(--space-md);
}
.section-header h2 {
    font-family: var(--font-heading);
    font-size: var(--fs-lg);
}
.section-header .see-all {
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--accent);
}

/* === SEARCH BAR === */
.search-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-full);
    transition: border-color var(--duration);
    box-shadow: var(--shadow-sm);
}
.search-bar:focus-within { border-color: var(--accent); box-shadow: var(--shadow-glow); }
.search-bar input {
    border: none;
    background: transparent;
    width: 100%;
    font-size: var(--fs-base);
    color: var(--text-primary);
    outline: none;
}
.search-bar input::placeholder { color: var(--text-muted); }
.search-icon { color: var(--text-muted); flex-shrink: 0; }

/* === CONTENT VIEW META === */
.content-view { padding-top: 8px; }
.content-view-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: var(--space-md);
    align-items: center;
}

/* === SHARE BAR === */
.share-bar {
    display: flex;
    gap: 10px;
    margin: var(--space-lg) 0;
    flex-wrap: wrap;
}
.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: var(--radius-full);
    font-size: var(--fs-sm);
    font-weight: 600;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--duration);
    min-height: 44px;
}
.share-btn:hover { border-color: var(--accent); color: var(--accent); }
.share-btn.whatsapp { background: #25d366; color: #fff; border-color: #25d366; }
.share-btn.whatsapp:hover { background: #20bd5a; }

/* === CROSS LINKS === */
.cross-links {
    margin: var(--space-xl) 0;
    padding: var(--space-lg);
    background: linear-gradient(135deg, var(--bg-secondary), #fef8ee);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}
.cross-links h3 { font-size: var(--fs-base); margin-bottom: var(--space-md); }
.cross-link-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.cross-link-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--duration);
    min-height: 40px;
}
.cross-link-item:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); }

/* === PAGE TRANSITIONS === */
.page-enter { animation: pageEnter 0.4s var(--ease-out) forwards; }
@keyframes pageEnter {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === STAGGER ANIMATION === */
.stagger > * {
    opacity: 0;
    transform: translateY(16px);
    animation: staggerIn 0.5s var(--ease-out) forwards;
}
.stagger > *:nth-child(1) { animation-delay: 0.05s; }
.stagger > *:nth-child(2) { animation-delay: 0.1s; }
.stagger > *:nth-child(3) { animation-delay: 0.15s; }
.stagger > *:nth-child(4) { animation-delay: 0.2s; }
.stagger > *:nth-child(5) { animation-delay: 0.25s; }
.stagger > *:nth-child(6) { animation-delay: 0.3s; }
.stagger > *:nth-child(7) { animation-delay: 0.35s; }
.stagger > *:nth-child(8) { animation-delay: 0.4s; }
.stagger > *:nth-child(9) { animation-delay: 0.45s; }
.stagger > *:nth-child(10) { animation-delay: 0.5s; }
.stagger > *:nth-child(11) { animation-delay: 0.55s; }
.stagger > *:nth-child(12) { animation-delay: 0.6s; }
@keyframes staggerIn {
    to { opacity: 1; transform: translateY(0); }
}

/* === REVEAL ON SCROLL === */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity var(--duration-slower) var(--ease-out), transform var(--duration-slower) var(--ease-out);
}
.reveal.active { opacity: 1; transform: translateY(0); }

/* === SEARCH OVERLAY (full-screen, above everything) === */
.search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(26,15,5,0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 99999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 80px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s, visibility 0.3s;
}
.search-overlay.active { opacity: 1; visibility: visible; pointer-events: auto; }

.search-modal {
    width: 100%;
    max-width: 580px;
    max-height: 75vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-card, #fff);
    border-radius: var(--radius-2xl, 32px);
    box-shadow: 0 32px 80px rgba(26,15,5,0.3), 0 0 0 1px rgba(198,153,62,0.1);
    overflow: hidden;
    transform: translateY(-20px) scale(0.97);
    transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.search-overlay.active .search-modal { transform: translateY(0) scale(1); }

.search-modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border, rgba(198,153,62,0.18));
}
.search-input-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-secondary, #f8f1e6);
    border-radius: var(--radius-full, 100px);
    border: 1.5px solid transparent;
    transition: border-color 0.2s;
}
.search-input-wrap:focus-within { border-color: var(--accent, #d4520a); }
.search-input-wrap input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 1rem;
    color: var(--text-primary, #1c0f05);
    outline: none;
    font-family: inherit;
}
.search-input-wrap input::placeholder { color: var(--text-muted, #8b6e4e); }
.search-close-btn {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: var(--bg-card, #fff);
    border: 1px solid var(--border, rgba(198,153,62,0.18));
    font-size: 0.9rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}
.search-close-btn:hover { background: rgba(212,82,10,0.08); color: var(--accent); }

.search-results-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}
.search-results-body .search-result-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-radius: var(--radius, 16px);
    text-decoration: none;
    color: var(--text-primary);
    transition: background 0.2s;
    margin-bottom: 4px;
}
.search-results-body .search-result-item:hover { background: var(--bg-secondary, #f8f1e6); }

@media (max-width: 640px) {
    .search-overlay { padding-top: 24px; }
    .search-modal { max-width: 94%; max-height: 80vh; border-radius: 24px; }
}
