/*
Theme Name: AlFahmi Publications
Theme URI: https://alfahmipublications.com
Author: Muhammad Anas
Description: A modern, responsive WordPress theme for AlFahmi Publications.
Version: 1.0.0
Author URI: https://nexfloww.tech
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: alfahmipublications
*/

:root {
    --emerald: #064e3b;
    --gold: #b45309;
    --cream: #fdfcf7;
    --text: #1f2937;
    --text-light: #6b7280;
    --white: #ffffff;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--cream);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3 {
    font-family: 'Playfair Display', serif;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Next-Gen Fixed Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 2000;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 30px 0;
    will-change: padding, background;
}

header.scrolled {
    padding: 12px 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.06);
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: transparent;
    padding: 10px 30px;
    border-radius: 100px;
    transition: all 0.4s ease;
}

header.scrolled .nav-wrapper {
    background: rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 32px rgba(6, 78, 59, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.logo a {
    text-decoration: none;
}

.logo-text {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--emerald);
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.logo-text span {
    font-weight: 400;
    color: var(--gold);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 5px;
}

header.scrolled .logo-text {
    font-size: 1.6rem;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 10px;
    position: relative;
    padding: 5px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 50px;
}

header.scrolled .nav-links {
    background: transparent;
}

.nav-links li {
    position: relative;
}

.nav-links a {
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 10px 22px;
    border-radius: 50px;
    display: block;
    transition: all 0.3s ease;
    z-index: 2;
}

.nav-links a.active {
    background: var(--emerald);
    color: var(--white);
    box-shadow: 0 10px 20px rgba(6, 78, 59, 0.2);
}

.nav-links a:not(.active):hover {
    background: rgba(6, 78, 59, 0.05);
    color: var(--emerald);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.cart-icon {
    width: 45px;
    height: 45px;
    background: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    color: var(--emerald);
}

.menu-toggle {
    display: none;
    width: 45px;
    height: 45px;
    background: var(--emerald);
    color: var(--white);
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(6, 78, 59, 0.2);
    transition: all 0.3s ease;
}

.menu-toggle:hover {
    background: var(--gold);
}

.cart-icon:hover {
    transform: translateY(-3px);
    background: var(--emerald);
    color: var(--white);
}

#cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--gold);
    color: var(--white);
    font-size: 0.7rem;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 2px solid var(--white);
}

/* Islamic Pattern Background (CSS SVG) */
.hero {
    height: 100vh;
    background: linear-gradient(rgba(255, 255, 255, 0.8), rgba(122, 240, 208, 0.8)), 
                url("assets/hero.webp");
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
    padding-top: 80px;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M40 0l20 20-20 20-20-20L40 0zm0 40l20 20-20 20-20-20 20-20z' fill='%23064e3b' fill-opacity='0.02' fill-rule='evenodd'/%3E%3C/svg%3E");
    z-index: -1;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.book-card {
    animation: fadeIn 0.6s ease-out forwards;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.book-card:nth-child(2) { animation-delay: 0.1s; }
.book-card:nth-child(3) { animation-delay: 0.2s; }
.book-card:nth-child(4) { animation-delay: 0.3s; }
.book-card:nth-child(5) { animation-delay: 0.4s; }
.book-card:nth-child(6) { animation-delay: 0.5s; }
.book-card:nth-child(7) { animation-delay: 0.6s; }

/* Enhanced Typography */
h1 {
    font-size: 4.5rem;
    letter-spacing: -1px;
    line-height: 1.1;
}

.section-title::after {
    content: "";
    display: block;
    width: 60px;
    height: 3px;
    background: var(--gold);
    margin: 15px auto 0;
}

/* Glassmorphism Product Card */
/* Modern 4.0 Book Cards */
.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    padding: 20px 0;
}

.book-card {
    background: var(--white);
    border-radius: 20px;
    padding: 0;
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 5px 15px rgba(0,0,0,0.02);
}

.book-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 40px 70px -15px rgba(6, 78, 59, 0.15);
    border-color: rgba(6, 78, 59, 0.1);
}

.book-badges {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 5;
}

.badge-level {
    background: var(--emerald);
    color: white;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.book-img-wrapper {
    position: relative;
    height: 320px;
    overflow: hidden;
}

.book-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s ease;
}

.book-card:hover .book-img-wrapper img {
    transform: scale(1.1);
}

.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(6, 78, 59, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.4s ease;
}

.book-card:hover .card-overlay {
    opacity: 1;
}

.view-btn {
    background: var(--white);
    color: var(--emerald);
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.85rem;
    transform: translateY(20px);
    transition: all 0.4s ease;
}

.book-card:hover .view-btn {
    transform: translateY(0);
}

.book-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.book-category {
    font-size: 0.7rem;
    color: var(--gold);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.book-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.4;
    color: var(--emerald);
}

.book-meta-inline {
    display: flex;
    gap: 15px;
    font-size: 0.75rem;
    color: var(--text-light);
    margin-bottom: 20px;
    opacity: 0.8;
}

.book-card-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid rgba(0,0,0,0.05);
}

.price-pill {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--emerald);
}

.icon-btn-cart {
    width: 40px;
    height: 40px;
    background: rgba(6, 78, 59, 0.05);
    color: var(--emerald);
    border: none;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.icon-btn-cart:hover {
    background: var(--emerald);
    color: white;
}

@media (max-width: 768px) {
    .modal-grid { grid-template-columns: 1fr; }
    .modal-title { font-size: 1.8rem; }
}

.btn-secondary {
    background: #e5e7eb;
    color: var(--text);
}

.btn-secondary:hover {
    background: #d1d5db;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 40px;
    width: 95%;
    max-width: 1000px;
    border-radius: 24px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.detail-content {
    max-width: 900px;
}

.close-modal {
    position: absolute;
    right: 25px;
    top: 20px;
    font-size: 30px;
    cursor: pointer;
    color: var(--text-light);
}

/* Modern Modal Layout 4.0 */
.modern-modal-layout {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    gap: 40px;
}

.modal-img-container {
    position: sticky;
    top: 0;
}

.modal-img-container img {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.isbn-tag {
    margin-top: 15px;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-light);
    letter-spacing: 1px;
}

.modal-header-top {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.modal-category, .modal-level {
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
}

.modal-category { background: rgba(180, 83, 9, 0.1); color: var(--gold); }
.modal-level { background: rgba(6, 78, 59, 0.1); color: var(--emerald); }

.modal-main-title {
    font-size: 2.4rem;
    line-height: 1.2;
    margin-bottom: 10px;
    color: var(--emerald);
}

.modal-author-name {
    margin-bottom: 30px;
    font-size: 0.95rem;
    color: var(--text-light);
}

.detailed-metadata {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 35px;
    background: #f8f8f8;
    padding: 20px;
    border-radius: 12px;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.detail-item i {
    color: var(--emerald);
    font-size: 1.1rem;
}

.detail-item label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-light);
}

.detail-item span {
    font-weight: 700;
    color: var(--text);
}

.modal-description-box h3 {
    font-size: 1.1rem;
    margin-bottom: 12px;
    color: var(--text);
}

.modal-description-box p {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-light);
}

.modal-action-bar {
    margin-top: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 30px;
    border-top: 2px solid #eee;
}

.modal-price-display label {
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    opacity: 0.6;
}

.modal-price-display span {
    font-size: 2rem;
    font-weight: 800;
    color: var(--emerald);
}

/* Global Button Refinement (Themed) */
.btn, .btn-theme-premium, .btn-premium {
    background: var(--emerald);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(6, 78, 59, 0.15);
}

.btn:hover, .btn-theme-premium:hover {
    background: #054131;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(6, 78, 59, 0.25);
    color: var(--gold);
}

.btn:active {
    transform: scale(0.98);
}

.about-features .btn-secondary, .btn-secondary {
    background: transparent;
    border: 2px solid var(--emerald);
    color: var(--emerald);
}

.btn-secondary:hover {
    background: var(--emerald);
    color: white;
}

/* Restored Footer & Sections */
#main-footer {
    background: var(--emerald);
    padding: 100px 0 40px;
    color: var(--white);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 60px;
    margin-bottom: 80px;
}

.brand-col p {
    opacity: 0.7;
    margin-bottom: 30px;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--gold);
    transform: translateY(-5px);
}

.footer-col h4 {
    margin-bottom: 30px;
    position: relative;
    padding-bottom: 10px;
}

.footer-col h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background: var(--gold);
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 15px;
}

.footer-col ul a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--transition);
}

.footer-col ul a:hover {
    color: var(--gold);
    padding-left: 5px;
}

.footer-bottom {
    padding-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    opacity: 0.6;
}

.mission-section {
    padding: 100px 0;
}

.mission-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.impact-stats {
    display: flex;
    gap: 30px;
    margin-top: 40px;
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-num {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--emerald);
    font-family: 'Playfair Display', serif;
}

.stat-desc {
    font-size: 0.9rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

.hero-btns {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

@media (max-width: 992px) {
    .mission-grid, .grid-3, .content-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .mission-image {
        order: -1;
    }

    .impact-stats {
        justify-content: center;
    }

    h1 {
        font-size: 3rem;
    }

    /* Header Responsiveness */
    .menu-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: var(--white);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 20px;
        transition: 0.5s ease;
        box-shadow: -10px 0 30px rgba(0,0,0,0.1);
        z-index: 3000;
        border-radius: 0;
        padding: 40px;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links li {
        width: 100%;
        text-align: center;
    }

    .nav-links a {
        font-size: 1.2rem;
        padding: 15px;
    }

    /* Footer Responsiveness */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }

    .footer-col h4::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .social-links {
        justify-content: center;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
}
