/**
 * Najibul Poems Homepage Styles - App-Like Design
 * Version: 52.0.0
 * 
 * ✅ Core Web Vitals Optimized
 * ✅ Dark Mode Support
 * ✅ Responsive Design
 * ✅ App-Like UI/UX
 * ✅ Accessibility Ready
 * ✅ Mobile-First Design
 * ✅ Purple-Pink Theme
 */

:root {
    --poems-primary: #8b5cf6;
    --poems-primary-dark: #6d28d9;
    --poems-primary-light: #ede9fe;
    --poems-secondary: #ec4899;
    --poems-secondary-dark: #db2777;
    --text-primary: #0f172a;
    --text-muted: #64748b;
    --bg-light: #f5f7fa;
    --bg-card: #ffffff;
    --border-light: #e2e8f0;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
    --shadow-lg: 0 12px 28px -8px rgba(139,92,246,0.15);
    --radius-md: 14px;
    --radius-lg: 16px;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.poems-app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
    background: var(--bg-light);
    min-height: 100vh;
    box-sizing: border-box;
}

.poems-header-glass {
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(255,255,255,0.3);
}

.poems-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.poems-brand { display: flex; align-items: center; gap: 10px; }
.brand-icon { font-size: 28px; }

.brand-title {
    font-size: clamp(20px, 3.5vw, 28px);
    font-weight: 800;
    background: linear-gradient(135deg, var(--poems-primary), var(--poems-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.poems-live-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 600;
    background: rgba(139,92,246,0.08);
    padding: 6px 16px;
    border-radius: 30px;
    border: 1px solid rgba(139,92,246,0.15);
}

.live-indicator {
    width: 8px;
    height: 8px;
    background: var(--poems-primary);
    border-radius: 50%;
    animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(0.7); }
}

.live-label {
    color: var(--poems-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 11px;
}

.live-clock {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 12px;
}

.poems-nav-arrows {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 12px 0;
    margin-bottom: 16px;
    background: rgba(255,255,255,0.8);
    border-radius: 40px;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.3);
}

.nav-arrow {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(139,92,246,0.1);
    color: var(--poems-primary);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.nav-arrow:hover { background: var(--poems-primary); color: white; }
.nav-arrow:active { transform: scale(0.9); }
.nav-arrow svg { width: 20px; height: 20px; }
.nav-page-info { font-size: 14px; font-weight: 600; color: #1e293b; min-width: 60px; text-align: center; }

.poems-feed {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-bottom: 30px;
}

.poems-item {
    opacity: 0;
    transform: translateY(16px);
    animation: feed-appear 0.4s ease forwards;
}

@keyframes feed-appear { to { opacity: 1; transform: translateY(0); } }

.poems-link {
    display: block;
    height: 100%;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
    border: 1px solid rgba(0,0,0,0.04);
}

.poems-link:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(139,92,246,0.08);
}

.poems-link:active { transform: scale(0.98); }

.poems-image-wrap {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #eef2f6;
}

.poems-image { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.poems-link:hover .poems-image { transform: scale(1.04); }

.poems-badge {
    position: absolute; top: 10px; right: 10px;
    padding: 4px 14px; border-radius: 20px;
    font-size: 11px; font-weight: 700; text-transform: uppercase;
}
.poems-badge.trending { background: #ef4444; color: #fff; }

.poems-content { padding: 14px 16px 12px; }

.poems-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 6px 0;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.poems-excerpt {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-wrap: break-word;
}

.poems-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px 14px;
    font-size: 12px;
    color: var(--text-muted);
    flex-wrap: wrap;
    border-top: 1px solid var(--border-light);
}
.poems-author { font-weight: 600; color: var(--poems-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
.poems-dot { color: #cbd5e1; font-size: 8px; flex-shrink: 0; }
.poems-time { font-weight: 500; white-space: nowrap; }
.meta-icon { font-size: 11px; margin-right: 2px; }
.poems-ctr { color: #dc2626; font-weight: 700; background: #fef2f2; padding: 2px 10px; border-radius: 12px; font-size: 10px; white-space: nowrap; }

.load-more-wrap { text-align: center; margin: 10px 0 40px; }
.load-more-btn {
    background: linear-gradient(135deg, var(--poems-primary), var(--poems-secondary));
    color: #fff;
    border: none;
    padding: 12px 40px;
    border-radius: 40px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 24px -6px rgba(139,92,246,0.3);
    display: inline-flex;
    align-items: center; gap: 10px;
}
.load-more-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 32px -8px rgba(139,92,246,0.4); }
.load-more-btn:active { transform: scale(0.96); }
.load-more-btn.loading { opacity: 0.7; cursor: wait; transform: none; }

.load-spinner { display: none; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; }
.load-more-btn.loading .load-spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.poems-end { text-align: center; padding: 30px 20px; margin: 10px 0 30px; background: rgba(255,255,255,0.85); border-radius: var(--radius-lg); color: var(--text-muted); font-size: 15px; }
.end-icon { font-size: 36px; display: block; margin-bottom: 8px; }

.poems-empty { grid-column: 1 / -1; text-align: center; padding: 50px 20px; color: var(--text-muted); }
.empty-icon { font-size: 44px; display: block; margin-bottom: 10px; }

.scroll-sentinel { height: 1px; width: 100%; visibility: hidden; }

/* Responsive */
@media (min-width: 993px) {
    .poems-feed { grid-template-columns: repeat(3, 1fr); gap: 20px; }
    .poems-app-container { padding: 20px; }
    .poems-nav-arrows { display: flex !important; }
}

@media (min-width: 769px) and (max-width: 992px) {
    .poems-feed { grid-template-columns: repeat(2, 1fr); gap: 16px; }
    .poems-app-container { padding: 16px; }
    .poems-nav-arrows { display: flex !important; }
    .poems-title { font-size: 15px; }
    .poems-excerpt { font-size: 13px; }
}

@media (min-width: 481px) and (max-width: 768px) {
    .poems-app-container { padding: 14px; }
    .poems-header-glass { padding: 14px 16px; border-radius: 14px; }
    .poems-header-inner { flex-direction: column; align-items: stretch; gap: 10px; }
    .poems-brand { justify-content: center; }
    .brand-title { font-size: 22px; }
    .poems-live-badge { justify-content: center; padding: 5px 14px; font-size: 12px; }
    .poems-feed { grid-template-columns: 1fr; gap: 14px; }
    .poems-nav-arrows { display: flex !important; }
    .poems-title { font-size: 16px; }
    .poems-excerpt { font-size: 14px; }
    .poems-meta { font-size: 12px; flex-wrap: wrap; }
    .poems-author { max-width: 100px; }
    .load-more-btn { padding: 12px 32px; font-size: 14px; width: 100%; justify-content: center; }
}

@media (max-width: 480px) {
    .poems-app-container { padding: 8px; }
    .poems-header-glass { padding: 12px 14px; border-radius: 12px; margin-bottom: 14px; }
    .brand-icon { font-size: 22px; }
    .brand-title { font-size: 18px; }
    .poems-live-badge { font-size: 10px; padding: 4px 12px; gap: 6px; }
    .live-clock { font-size: 10px; }
    .poems-feed { gap: 12px; }
    .poems-nav-arrows { display: flex !important; gap: 12px; padding: 10px 0; border-radius: 30px; }
    .nav-arrow { width: 34px; height: 34px; }
    .nav-arrow svg { width: 16px; height: 16px; }
    .nav-page-info { font-size: 12px; min-width: 50px; }
    .poems-link { border-radius: 12px; }
    .poems-content { padding: 12px 14px 10px; }
    .poems-title { font-size: 14px; -webkit-line-clamp: 2; line-height: 1.3; }
    .poems-excerpt { font-size: 12px; -webkit-line-clamp: 2; }
    .poems-meta { padding: 8px 14px 12px; font-size: 10px; gap: 4px; }
    .poems-author { font-size: 10px; max-width: 80px; }
    .load-more-btn { padding: 10px 24px; font-size: 12px; width: 100%; justify-content: center; }
    .poems-end { padding: 20px 16px; font-size: 13px; }
    .end-icon { font-size: 28px; }
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-light: #0f172a;
        --bg-card: #1e293b;
        --text-primary: #f1f5f9;
        --text-muted: #94a3b8;
        --border-light: #334155;
        --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
        --shadow-md: 0 4px 16px rgba(0,0,0,0.3);
        --shadow-lg: 0 12px 28px -8px rgba(0,0,0,0.4);
    }
    
    .poems-header-glass { background: rgba(30,41,59,0.92); border-color: rgba(255,255,255,0.05); }
    .brand-title { background: linear-gradient(135deg, #a78bfa, #f472b6); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
    .poems-live-badge { background: rgba(139,92,246,0.15); border-color: rgba(139,92,246,0.2); }
    .live-clock { color: #94a3b8; }
    .poems-nav-arrows { background: rgba(30,41,59,0.8); border-color: rgba(255,255,255,0.05); }
    .nav-page-info { color: #e2e8f0; }
    .nav-arrow { background: rgba(139,92,246,0.2); color: #a78bfa; }
    .nav-arrow:hover { background: #8b5cf6; color: white; }
    .poems-link { background: #1e293b; border-color: rgba(255,255,255,0.05); }
    .poems-link:hover { border-color: rgba(139,92,246,0.15); box-shadow: 0 12px 28px -8px rgba(0,0,0,0.4); }
    .poems-title { color: #f1f5f9; }
    .poems-excerpt { color: #94a3b8; }
    .poems-meta { color: #94a3b8; border-top-color: #334155; }
    .poems-author { color: #a78bfa; }
    .poems-ctr { color: #f87171; background: #334155; }
    .poems-dot { color: #475569; }
    .poems-empty { color: #94a3b8; }
    .poems-end { background: rgba(30,41,59,0.9); color: #94a3b8; }
    .load-more-btn { box-shadow: 0 8px 24px -6px rgba(139,92,246,0.2); }
}