/*
Theme Name: GeneratePress Child
Theme URI: https://najibul.com
Description: Custom Child Theme for GeneratePress with World-Class Optimized Table & UI Styles
Author: Farhat Khan
Author URI: https://najibul.com
Template: generatepress
Version: 7.0.0
*/

/* ============================================================
   NAJIBUL PLATFORM - OPTIMIZED CHILD THEME STYLESHEET
   ============================================================ */

:root {
    --brand-primary: #2ECC71;
    --brand-primary-dark: #27AE60;
    --brand-accent: #E74C3C;
    --brand-secondary: #F39C12;
    --text-main: #2C3E50;
    --text-muted: #5D6D7E;
    --bg-light: #f8f9fa;
    --card-bg: #ffffff;
    --border-color: #e8ecf0;
    --shadow-sm: 0 4px 16px rgba(44, 62, 80, 0.06);
    --shadow-lg: 0 12px 40px rgba(44, 62, 80, 0.12);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
}

/* --- GENERAL STYLES --- */
body {
    font-family: "Poppins", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    font-display: swap;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

/* --- POLYLANG DIRECTION --- */
:lang(en) body { direction: ltr; }
:lang(ar) body { direction: rtl; text-align: right; }
:lang(bn) body, :lang(hi) body { direction: ltr; }

/* --- LOGIN & UI CARDS --- */
.najibul-login-card {
    max-width: 380px;
    margin: 40px auto;
    padding: 30px;
    border-radius: 20px;
    background: linear-gradient(135deg, #ffffff, #f2f7ff);
    box-shadow: 0 20px 50px rgba(0,0,0,0.08);
    text-align: center;
    animation: fadeUp 0.7s ease;
}

.najibul-login-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-main);
}

#credential_picker_container { z-index: 999999 !important; }

.najibul-success-animation {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    color: #fff;
    font-size: 26px;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    animation: fadeIn 0.4s ease;
}

/* --- GRID & POST ITEMS --- */
.latest-posts-wrapper,
.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin: 24px 0;
    padding: 12px;
}

.post-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
    overflow: hidden;
    opacity: 0;
    animation: fadeIn 0.8s forwards;
    padding: 20px;
    content-visibility: auto;
}
.post-item:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.post-thumbnail img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-bottom: 3px solid var(--brand-primary);
}

.post-content { padding: 16px; text-align: center; }

.post-title {
    font-size: 1.3em;
    margin-bottom: 10px;
    font-weight: 700;
    color: var(--text-main);
}
.post-title a { text-decoration: none; color: inherit; transition: color 0.3s ease; }
.post-title a:hover { color: var(--brand-accent); }

.post-meta {
    font-size: 0.9em;
    color: #7F8C8D;
    margin-top: 10px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}
.post-meta .author { font-weight: 600; color: var(--text-main); }
.post-meta .time { color: #95A5A6; }

.post-excerpt {
    font-size: 1em;
    line-height: 1.6;
    color: var(--text-muted);
    display: none;
}
.post-excerpt.show { display: block; }

/* --- BUTTONS & LINKS --- */
a.read-more.button {
    background: #ffffff;
    font-size: 18px;
    padding: 8px 20px;
    text-align: center;
    transition: all 0.3s ease;
    color: var(--brand-accent);
    box-shadow: var(--shadow-sm);
    border-radius: 50px;
    border: 2px solid var(--brand-accent);
    font-weight: 700;
    display: inline-block;
    text-decoration: none;
}
a.read-more.button:hover {
    background: var(--brand-accent);
    color: #ffffff;
    box-shadow: 0 8px 24px rgba(231, 76, 60, 0.25);
}

.single article a {
    color: #8E44AD;
    border-bottom: 2px solid transparent;
    transition: border-color 0.3s ease;
    text-decoration: none;
}
.single article a:hover { border-bottom-color: #8E44AD; }

/* --- AUTHOR BOX --- */
.author-box {
    display: flex;
    align-items: flex-start;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-top: 30px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}
.author-box:hover { box-shadow: 0 8px 32px rgba(44, 62, 80, 0.1); }
.author-avatar { margin-right: 20px; }
.author-avatar-img {
    border-radius: 50%;
    border: 3px solid var(--brand-primary);
    box-shadow: 0 0 20px rgba(46, 204, 113, 0.2);
    width: 96px;
    height: 96px;
    object-fit: cover;
}
.author-details { flex: 1; }
.author-name { font-size: 20px; font-weight: 700; margin: 0 0 10px; color: var(--text-main); }
.author-name a { text-decoration: none; color: inherit; }
.author-bio { font-size: 15px; color: var(--text-muted); margin: 0 0 15px; line-height: 1.6; }
.author-link { font-size: 15px; text-decoration: none; color: var(--brand-primary); font-weight: 600; }

/* --- TABLES --- */
.wp-block-table {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1rem 0;
    border: 1px solid #e1e1e1;
    border-radius: var(--radius-sm);
    background: var(--card-bg);
}
.wp-block-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 16px;
}
.wp-block-table th,
.wp-block-table thead td {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-dark));
    color: #ffffff;
    font-weight: 600;
    padding: 14px 16px;
    border: 1px solid var(--brand-primary-dark);
    text-align: center;
    white-space: nowrap;
}
.wp-block-table td {
    padding: 12px 15px;
    border: 1px solid #e1e1e1;
    text-align: center;
}
.wp-block-table tbody tr:nth-child(even) { background-color: rgba(0,0,0,0.02); }
.wp-block-table tbody tr:hover { background-color: rgba(46,204,113,0.05); }

/* --- BACK TO TOP BUTTON --- */
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 99999;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--brand-accent), var(--brand-secondary));
    color: #ffffff;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(231, 76, 60, 0.3);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}
#back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
#back-to-top:hover { transform: translateY(-4px) scale(1.1); }

/* --- RESPONSIVE MEDIA QUERIES --- */
@media (max-width: 1024px) {
    .latest-posts-wrapper, .posts-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .latest-posts-wrapper, .posts-grid { grid-template-columns: 1fr; }
    .najibul-login-card { margin: 20px; padding: 25px; }
}

/* --- ANIMATIONS --- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(25px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- DARK MODE SUPPORT --- */
@media (prefers-color-scheme: dark) {
    body { background-color: #12181F; color: #E8EDF2; }
    .post-item, .author-box, .wp-block-table, .wp-block-table table {
        background: #1E2A36;
        border-color: #2F4050;
        color: #E8EDF2;
    }
    .post-title, .author-name { color: #E8EDF2; }
    .post-excerpt, .author-bio { color: #A0B0C0; }
    .wp-block-table td { border-color: #2F4050; color: #C0D0E0; }
    .wp-block-table tbody tr:nth-child(even) { background-color: #141E28; }
    .wp-block-table tbody tr:hover { background-color: #1A2A36; }
}

/* --- REDUCED MOTION --- */
@media (prefers-reduced-motion: reduce) {
    * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* --- EXTRA: HOME PAGE SPECIFIC FIXES --- */
.najibul-ultimate-home {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.glass-effect {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

@media (prefers-color-scheme: dark) {
    .glass-effect {
        background: rgba(30, 42, 54, 0.95);
    }
}