/* ===================================
   ShaFX Global Styles
   =================================== */

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    width: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Kufi Arabic', sans-serif;
    background-color: #191d34;
    color: #fff;
    direction: rtl;
    line-height: 1.6;
}

/* Header Styles */
header {
    background-color: #ffcc00;
    color: #191d34;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo img {
    height: 50px;
    transition: transform 0.3s ease;
}

.logo img:hover {
    transform: scale(1.05);
}

/* Navigation */
nav {
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 20px;
}

nav ul li a {
    color: #191d34;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    padding: 5px 10px;
    border-radius: 4px;
}

nav ul li a:hover {
    background-color: rgba(25, 29, 52, 0.1);
    transform: translateY(-2px);
}

/* Splash Screen */
.splash-screen {
    position: fixed;
    width: 100%;
    height: 100vh;
    background: #000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.splash-screen img {
    width: 100px;
    height: 100px;
    animation: pulse 1.5s infinite;
}

.splash-screen h2 {
    color: #ffcc00;
    font-size: 22px;
    margin-top: 10px;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Main Content Container */
main {
    min-height: calc(100vh - 200px);
    padding: 20px;
}

.container, .content, .main-wrapper {
    max-width: 100%;
    overflow-x: hidden;
}

/* Blog Home Styles */
.blog-home {
    max-width: 1200px;
    margin: 30px auto;
    padding: 30px;
    background: #fff;
    color: #191d34;
    border-radius: 12px;
    box-shadow: 0px 0px 20px rgba(0,0,0,0.1);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 0.8s ease-in-out forwards;
}

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

.blog-home h1 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 2.5em;
    color: #191d34;
    border-bottom: 3px solid #ffcc00;
    padding-bottom: 15px;
}

/* Category Filter */
.category-filter {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.category-btn {
    padding: 10px 20px;
    background-color: #f0f0f0;
    color: #191d34;
    border: 2px solid transparent;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    font-weight: 600;
}

.category-btn:hover,
.category-btn.active {
    background-color: #ffcc00;
    border-color: #191d34;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Blog Grid */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

/* Article Card */
article {
    background: #fff;
    padding: 0;
    border-radius: 12px;
    box-shadow: 0px 4px 15px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

article:hover {
    transform: translateY(-8px);
    box-shadow: 0px 8px 25px rgba(0,0,0,0.2);
}

article img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 0;
}

article .article-content {
    padding: 20px;
}

article h2 {
    font-size: 1.3em;
    margin: 10px 0;
    color: #191d34;
    line-height: 1.4;
    min-height: 60px;
}

article p {
    color: #666;
    margin: 10px 0;
    line-height: 1.6;
    min-height: 48px;
}

article .article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 15px 0;
    font-size: 0.9em;
    color: #999;
}

article .category-tag {
    display: inline-block;
    padding: 5px 12px;
    background-color: #ffcc00;
    color: #191d34;
    border-radius: 15px;
    font-size: 0.85em;
    font-weight: 600;
}

/* Read More Button */
.read-more {
    display: inline-block;
    margin-top: 10px;
    padding: 12px 24px;
    background-color: #ffcc00;
    color: #191d34;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 600;
}

.read-more:hover {
    background-color: #e6b800;
    transform: translateX(-5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Article Container (Single Post) */
.article-container {
    max-width: 900px;
    margin: 30px auto;
    padding: 40px;
    background: #fff;
    color: #191d34;
    border-radius: 12px;
    box-shadow: 0px 0px 20px rgba(0,0,0,0.1);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 0.8s ease-in-out forwards;
}

.article-container h1 {
    font-size: 2.2em;
    margin-bottom: 20px;
    color: #191d34;
    line-height: 1.3;
}

.article-image {
    width: 100%;
    border-radius: 8px;
    margin: 20px 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.article-container p {
    margin: 15px 0;
    line-height: 1.8;
    font-size: 1.1em;
}

/* Article Meta Info */
.article-info {
    display: flex;
    gap: 20px;
    margin: 20px 0;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 8px;
    border-right: 4px solid #ffcc00;
}

.article-info span {
    color: #666;
    font-size: 0.95em;
}

/* Related Posts */
.related-posts {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 2px solid #f0f0f0;
}

.related-posts h2 {
    font-size: 1.8em;
    margin-bottom: 25px;
    color: #191d34;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.related-card {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
}

.related-card:hover {
    background: #ffcc00;
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.related-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 10px;
}

.related-card h3 {
    font-size: 1.1em;
    margin: 10px 0;
    color: #191d34;
}

/* CTA Section */
.cta-section {
    margin: 40px 0;
    padding: 30px;
    background: linear-gradient(135deg, #ffcc00 0%, #e6b800 100%);
    border-radius: 12px;
    text-align: center;
    color: #191d34;
}

.cta-section h3 {
    font-size: 1.8em;
    margin-bottom: 15px;
}

.cta-section p {
    margin-bottom: 20px;
    font-size: 1.1em;
}

.cta-button {
    display: inline-block;
    padding: 15px 35px;
    background-color: #191d34;
    color: #ffcc00;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.1em;
    transition: all 0.3s ease;
}

.cta-button:hover {
    background-color: #0d0f1a;
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.3);
}

/* Navigation Buttons */
.back-button,
.nav-buttons a {
    display: inline-block;
    margin: 20px 10px 0 0;
    padding: 12px 24px;
    background-color: #ffcc00;
    color: #191d34;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 600;
}

.back-button:hover,
.nav-buttons a:hover {
    background-color: #e6b800;
    transform: translateX(-5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.nav-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #f0f0f0;
}

/* Pagination */
.pagination {
    text-align: center;
    margin-top: 40px;
    padding: 20px 0;
}

.pagination a {
    display: inline-block;
    padding: 10px 15px;
    margin: 5px;
    background-color: #ffcc00;
    color: #191d34;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 600;
}

.pagination a:hover,
.pagination a.active {
    background-color: #191d34;
    color: #ffcc00;
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Footer */
footer {
    text-align: center;
    padding: 25px;
    background: #ffcc00;
    color: #191d34;
    margin-top: 50px;
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
    font-weight: 600;
}

footer p {
    margin: 0;
}

/* Images */
img {
    max-width: 100%;
    height: auto;
}

/* Flex Container */
.flex-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    header {
        padding: 10px 15px;
        flex-direction: column;
        gap: 10px;
    }

    .logo img {
        height: 40px;
    }

    nav ul {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .blog-home {
        padding: 20px;
        margin: 15px;
    }

    .blog-home h1 {
        font-size: 1.8em;
    }

    .blog-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .article-container {
        padding: 20px;
        margin: 15px;
    }

    .article-container h1 {
        font-size: 1.6em;
    }

    .category-filter {
        flex-direction: column;
        align-items: stretch;
    }

    .category-btn {
        width: 100%;
    }

    .nav-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .nav-buttons a {
        text-align: center;
    }

    .related-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .blog-home h1 {
        font-size: 1.5em;
    }

    article h2 {
        font-size: 1.1em;
        min-height: auto;
    }

    .article-container h1 {
        font-size: 1.4em;
    }

    .cta-section h3 {
        font-size: 1.4em;
    }
}

/* Print Styles */
@media print {
    header, footer, .related-posts, .cta-section, .nav-buttons, .back-button {
        display: none;
    }

    .article-container {
        box-shadow: none;
        padding: 0;
    }
}
