/**
 * Blog Premium Styles
 * تنسيقات احترافية للمقالات - جداول وCTA
 * مؤسسة روائع الكريستال
 */

/* ============================================
   PREMIUM CTA COMPONENT
   ============================================ */

.article-cta {
    background: linear-gradient(135deg, #1e3a5f 0%, #0d1f33 100%) !important;
    padding: 3rem !important;
    border-radius: 1.5rem !important;
    margin: 3rem 0 !important;
    text-align: center !important;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* Glassmorphism overlay */
.article-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

/* Decorative circles */
.article-cta::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(37, 211, 102, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.article-cta h3 {
    font-size: 1.75rem !important;
    margin-bottom: 0.75rem !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    position: relative;
    z-index: 1;
}

.article-cta p {
    margin-bottom: 2rem !important;
    color: rgba(255, 255, 255, 0.95) !important;
    font-size: 1.1rem !important;
    position: relative;
    z-index: 1;
}

.article-cta .cta-buttons {
    display: flex !important;
    gap: 1rem !important;
    justify-content: center !important;
    flex-wrap: wrap !important;
    position: relative;
    z-index: 1;
}

.article-cta .cta-buttons a {
    padding: 1rem 2rem !important;
    border-radius: 3rem !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
    font-weight: 600 !important;
    font-size: 1rem !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.article-cta .cta-buttons a:first-child {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%) !important;
    color: white !important;
}

.article-cta .cta-buttons a:first-child:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.4) !important;
}

.article-cta .cta-buttons a:last-child {
    background: rgba(255, 255, 255, 0.95) !important;
    color: #1e3a5f !important;
}

.article-cta .cta-buttons a:last-child:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.3) !important;
    background: #ffffff !important;
}

/* ============================================
   PREMIUM TABLES
   ============================================ */

.comparison-table,
.blog-article table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 2rem 0;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    background: #fff;
}

/* Robust Table Header Styling */
.comparison-table thead,
.blog-article table thead,
.blog-article table tr:first-child {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 100%) !important;
    color: #ffffff !important;
}

.comparison-table th,
.blog-article table th,
.blog-article table tr:first-child td,
.blog-article table tr:first-child th {
    padding: 1.25rem 1.5rem;
    text-align: right;
    color: #ffffff !important;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    text-transform: none;
    border: none;
    background-color: transparent !important;
    /* Let row background show through */
}

/* Corner radius for header */
.comparison-table thead th:first-child,
.blog-article table thead th:first-child,
.blog-article table tr:first-child th:first-child,
.blog-article table tr:first-child td:first-child {
    border-radius: 0 1rem 0 0;
}

.comparison-table thead th:last-child,
.blog-article table thead th:last-child,
.blog-article table tr:first-child th:last-child,
.blog-article table tr:first-child td:last-child {
    border-radius: 1rem 0 0 0;
}

.comparison-table td,
.blog-article table td {
    padding: 1.25rem 1.5rem;
    text-align: right;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
    font-size: 0.95rem;
    color: #333;
}

.comparison-table tbody tr,
.blog-article table tbody tr {
    background: #fff;
    transition: all 0.2s ease;
}

/* Zebra striping with subtle color */
.comparison-table tbody tr:nth-child(even),
.blog-article table tbody tr:nth-child(even) {
    background: #f8fafc;
}

/* Hover effect */
.comparison-table tbody tr:hover,
.blog-article table tbody tr:hover {
    background: linear-gradient(90deg, rgba(30, 58, 95, 0.05) 0%, rgba(30, 58, 95, 0.02) 100%);
    transform: scale(1.005);
}

/* First column highlight */
.comparison-table td:first-child,
.blog-article table td:first-child {
    font-weight: 600;
    color: #1e3a5f;
}

/* Price/value column styling */
.comparison-table td:last-child,
.blog-article table td:last-child {
    color: #059669;
    font-weight: 600;
}

/* Links in tables */
.comparison-table a,
.blog-article table a {
    color: #2563eb;
    text-decoration: none;
    border-bottom: 1px dashed #2563eb;
    transition: all 0.2s ease;
}

.comparison-table a:hover,
.blog-article table a:hover {
    color: #1e3a5f;
    border-bottom-style: solid;
}

/* ============================================
   PREMIUM RELATED ARTICLES
   ============================================ */

.related-articles {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%) !important;
    padding: 2rem !important;
    border-radius: 1rem !important;
    margin: 2rem 0 !important;
    border: 1px solid rgba(30, 58, 95, 0.1);
}

.related-articles h3 {
    color: #1e3a5f !important;
    margin-bottom: 1.25rem !important;
    font-size: 1.25rem !important;
    font-weight: 700 !important;
}

.related-articles ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: grid !important;
    gap: 0.75rem !important;
}

.related-articles li a {
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
    padding: 0.875rem 1rem !important;
    background: rgba(255, 255, 255, 0.8) !important;
    border-radius: 0.75rem !important;
    color: #1e3a5f !important;
    text-decoration: none !important;
    transition: all 0.25s ease !important;
    border: 1px solid transparent;
    font-weight: 500;
}

.related-articles li a:hover {
    background: #ffffff !important;
    transform: translateX(-5px);
    border-color: rgba(30, 58, 95, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.related-articles li a span {
    color: #25D366 !important;
    font-size: 1.2rem;
    transition: transform 0.2s ease;
}

.related-articles li a:hover span {
    transform: translateX(-5px);
}

/* ============================================
   FAQ SECTION ENHANCEMENT
   ============================================ */

.faq-section {
    margin: 2rem 0;
}

.faq-item {
    background: #fff;
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
}

.faq-item:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.faq-item h3 {
    color: #1e3a5f;
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ============================================
   RESPONSIVE TABLES & RTL FIXES
   ============================================ */

.table-responsive-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 2rem 0;
    border-radius: 1rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
}

.comparison-table,
.blog-article table {
    width: 100%;
    min-width: 600px;
    /* Ensure table doesn't collapse too much */
    border-collapse: separate;
    /* Changed from collapse for border-radius */
    border-spacing: 0;
    margin: 0;
    /* Margin handled by wrapper */
}

/* ============================================
   INTERACTIVE FAQ ACCORDION
   ============================================ */

.faq-section .faq-item {
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    /* Reset padding for accordion */
    overflow: hidden;
}

.faq-section .faq-item h3 {
    padding: 1.5rem;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 1.1rem;
    user-select: none;
}

/* Chevron Icon */
.faq-section .faq-item h3::after {
    content: '';
    width: 12px;
    height: 12px;
    border-right: 2px solid #1e3a5f;
    border-bottom: 2px solid #1e3a5f;
    transform: rotate(45deg);
    transition: transform 0.3s ease;
    margin-right: auto;
    /* Push to left in RTL */
    margin-left: 1rem;
}

/* Active State (Open) */
.faq-section .faq-item.active {
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.08);
    border-color: #2563eb;
}

.faq-section .faq-item.active h3 {
    background: #f8fafc;
    color: #2563eb;
}

.faq-section .faq-item.active h3::after {
    transform: rotate(225deg);
    border-color: #2563eb;
}

.faq-section .faq-item p {
    padding: 0 1.5rem 1.5rem 1.5rem;
    margin: 0;
    display: none;
    /* Hidden by default */
    color: #4b5563;
    line-height: 1.7;
    border-top: 1px solid transparent;
}

.faq-section .faq-item.active p {
    display: block;
    animation: slideDown 0.3s ease-out;
    border-top-color: rgba(0, 0, 0, 0.05);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Rich Content in FAQ (Lists, Bold) */
.faq-item p ul,
.faq-item p ol {
    margin: 1rem 1.5rem 0 0;
    padding-right: 1.5rem;
}

.faq-item p li {
    margin-bottom: 0.5rem;
}

.faq-item p strong {
    color: #1e3a5f;
}

/* Removed duplicate .faq-item p rule - using .faq-section .faq-item p above */

/* ============================================
   MOBILE RESPONSIVENESS
   ============================================ */

@media (max-width: 768px) {

    .comparison-table,
    .blog-article table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .comparison-table th,
    .comparison-table td,
    .blog-article table th,
    .blog-article table td {
        padding: 0.75rem;
        font-size: 0.875rem;
        white-space: normal;
        min-width: 120px;
        /* Ensure columns don't get too squeezed */
    }

    .article-cta {
        padding: 2rem 1.5rem !important;
    }

    .article-cta h3 {
        font-size: 1.4rem !important;
    }

    .article-cta .cta-buttons {
        flex-direction: column !important;
    }

    .article-cta .cta-buttons a {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================
   ANIMATION KEYFRAMES
   ============================================ */

@keyframes subtlePulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.85;
    }
}

.article-cta .cta-buttons a:first-child {
    animation: subtlePulse 2s ease-in-out infinite;
}

.article-cta .cta-buttons a:first-child:hover {
    animation: none;
}

/* ============================================
   TABLE OF CONTENTS
   ============================================ */

.article-toc {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 1.5rem 2rem;
    margin: 2rem 0;
    position: relative;
}

.article-toc::before {
    content: '📋';
    position: absolute;
    top: -12px;
    right: 20px;
    background: #fff;
    padding: 0 0.5rem;
    font-size: 1.5rem;
}

.article-toc h4 {
    color: #1e3a5f;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.article-toc ol {
    list-style: none;
    counter-reset: toc;
    padding: 0;
    margin: 0;
}

.article-toc li {
    counter-increment: toc;
    margin-bottom: 0.5rem;
}

.article-toc li::before {
    content: counter(toc) ".";
    color: #10b981;
    font-weight: 700;
    margin-left: 0.5rem;
}

.article-toc a {
    color: #475569;
    text-decoration: none;
    transition: all 0.2s ease;
}

.article-toc a:hover {
    color: #10b981;
    padding-right: 5px;
}

/* ============================================
   HIGHLIGHT BOX / STATS BOX
   ============================================ */

.article-highlight-box {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 2px solid #10b981;
    border-radius: 1rem;
    padding: 1.5rem 2rem;
    margin: 2rem 0;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    position: relative;
    overflow: hidden;
}

.article-highlight-box::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 120px;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(16, 185, 129, 0.1) 100%);
}

.article-highlight-box .highlight-icon {
    font-size: 3rem;
    flex-shrink: 0;
}

.article-highlight-box .highlight-content {
    flex: 1;
}

.article-highlight-box .highlight-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: #059669;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.article-highlight-box .highlight-text {
    color: #065f46;
    font-weight: 500;
}

/* Multiple stats grid */
.article-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.article-stats-grid .stat-card {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #bae6fd;
    border-radius: 1rem;
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.2s ease;
}

.article-stats-grid .stat-card:hover {
    transform: translateY(-3px);
}

.article-stats-grid .stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: #0369a1;
    display: block;
}

.article-stats-grid .stat-label {
    color: #0c4a6e;
    font-size: 0.9rem;
    font-weight: 500;
}

/* ============================================
   STEP-BY-STEP GUIDE
   ============================================ */

.article-steps {
    margin: 2rem 0;
    padding: 0;
    list-style: none;
    counter-reset: steps;
}

.article-steps .step-item {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    position: relative;
    transition: all 0.2s ease;
}

.article-steps .step-item:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transform: translateX(-5px);
}

.article-steps .step-item::before {
    counter-increment: steps;
    content: counter(steps);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-radius: 50%;
    font-size: 1.25rem;
    font-weight: 700;
    flex-shrink: 0;
}

.article-steps .step-content {
    flex: 1;
}

.article-steps .step-content h4 {
    color: #1e293b;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.article-steps .step-content p {
    color: #64748b;
    margin: 0;
    line-height: 1.7;
}

/* ============================================
   DIAGRAM CONTAINER
   ============================================ */

.article-diagram {
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 1rem;
    padding: 1.5rem;
    margin: 2rem 0;
    text-align: center;
}

.article-diagram img,
.article-diagram svg {
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    display: block;
}

.article-diagram figcaption {
    color: #64748b;
    font-size: 0.9rem;
    margin-top: 1rem;
    font-style: italic;
}

/* Inline article images */
.article-inline-image {
    width: 100%;
    border-radius: 1rem;
    margin: 2rem 0;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

/* ============================================
   ORDERED LISTS ENHANCEMENT
   ============================================ */

.article-body ol {
    counter-reset: list;
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}

.article-body ol li {
    counter-increment: list;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem 1.25rem;
    background: #f8fafc;
    border-radius: 0.75rem;
    border-right: 4px solid #10b981;
}

.article-body ol li::before {
    content: counter(list);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #10b981;
    color: white;
    border-radius: 50%;
    font-size: 0.85rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* ============================================
   CALLOUT BOXES
   ============================================ */

.article-callout {
    border-radius: 1rem;
    padding: 1.5rem 2rem;
    margin: 2rem 0;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.article-callout.info {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #93c5fd;
}

.article-callout.info::before {
    content: 'ℹ️';
    font-size: 1.5rem;
}

.article-callout.warning {
    background: linear-gradient(135deg, #fefce8 0%, #fef9c3 100%);
    border: 1px solid #fde047;
}

.article-callout.warning::before {
    content: '⚠️';
    font-size: 1.5rem;
}

.article-callout.tip {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 1px solid #86efac;
}

.article-callout.tip::before {
    content: '💡';
    font-size: 1.5rem;
}

.article-callout.important {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 1px solid #fca5a5;
}

.article-callout.important::before {
    content: '🔴';
    font-size: 1.5rem;
}

.article-callout p {
    margin: 0 !important;
    color: #334155;
}

/* ============================================
   AUTHOR & UPDATE INFO
   ============================================ */

.article-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.article-meta .author-avatar {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
}

.article-meta .author-info {
    flex: 1;
}

.article-meta .author-name {
    font-weight: 700;
    color: #1e293b;
    font-size: 1.1rem;
}

.article-meta .article-date {
    color: #64748b;
    font-size: 0.9rem;
}

.article-meta .reading-time {
    background: #e0f2fe;
    color: #0369a1;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.85rem;
    font-weight: 600;
}

/* ============================================
   CHECKLIST STYLE
   ============================================ */

.article-checklist {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}

.article-checklist li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
}

.article-checklist li:hover {
    background: #f0fdf4;
}

.article-checklist li::before {
    content: '✅';
    font-size: 1.1rem;
}

/* ============================================
   MOBILE RESPONSIVENESS FOR NEW COMPONENTS
   ============================================ */

@media (max-width: 768px) {
    .article-highlight-box {
        flex-direction: column;
        text-align: center;
    }

    .article-steps .step-item {
        flex-direction: column;
        text-align: center;
    }

    .article-steps .step-item::before {
        margin: 0 auto 1rem;
    }

    .article-meta {
        flex-direction: column;
        text-align: center;
    }

    .article-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .article-callout {
        flex-direction: column;
        text-align: center;
    }
}