/* =========================================
   VARIABLES & THEMING
   ========================================= */
:root {
    --primary-color: #002366; /* Royal Blue */
    --primary-light: #1a438e;
    --primary-dark: #001233;
    --accent-color: #f7b733; /* A warm gold strictly as accent, but mainly using white */
    
    --bg-color: #f8f9fa;
    --surface-color: #ffffff;
    
    --text-main: #333333;
    --text-muted: #666666;
    --text-light: #ffffff;
    
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    
    --shadow-sm: 0 4px 6px rgba(0, 35, 102, 0.08);
    --shadow-md: 0 10px 20px rgba(0, 35, 102, 0.12);
    --shadow-hover: 0 15px 30px rgba(0, 35, 102, 0.2);
    
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* =========================================
   RESET & BASE STYLES
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Cairo', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* =========================================
   TYPOGRAPHY
   ========================================= */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
}

/* =========================================
   NAVBAR
   ========================================= */
.navbar {
    background-color: rgba(0, 35, 102, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 1rem 0;
    box-shadow: var(--shadow-sm);
    color: var(--text-light);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-img {
    height: 80px;
    width: auto;
    object-fit: contain;
}

.brand-text {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    font-weight: 600;
    position: relative;
    padding: 0.5rem 0;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 2px;
    background-color: var(--surface-color);
    transition: var(--transition);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

/* =========================================
   HERO SECTION
   ========================================= */
.hero {
    position: relative;
    padding: 12rem 0 8rem 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: var(--text-light);
    overflow: hidden;
    text-align: center;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    animation: fadeUp 0.8s ease-out;
}

.hero-title .highlight {
    color: var(--accent-color);
    position: relative;
}

.hero-subtitle {
    font-size: 1.25rem;
    max-width: 600px;
    margin: 0 auto 3rem auto;
    opacity: 0.9;
    animation: fadeUp 1s ease-out;
}

.btn-primary {
    display: inline-block;
    background-color: var(--surface-color);
    color: var(--primary-color);
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 4px 15px rgba(255,255,255,0.2);
    animation: fadeUp 1.2s ease-out;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255,255,255,0.3);
    background-color: #f1f1f1;
}

/* Decorative Background Shapes */
.hero-shapes .shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    z-index: 1;
}

.shape-1 {
    width: 400px;
    height: 400px;
    top: -100px;
    right: -100px;
    animation: float 6s ease-in-out infinite;
}

.shape-2 {
    width: 300px;
    height: 300px;
    bottom: -50px;
    left: -50px;
    animation: float 8s ease-in-out infinite reverse;
}

/* =========================================
   BOOKS SECTION (GLASSMORPHISM CARDS)
   ========================================= */
.books-section {
    padding: 6rem 0;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 4rem;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 2.5rem;
}

/* Card Styling */
.book-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.book-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(0, 35, 102, 0.1);
}

.card-img-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 155 / 235;
    overflow: hidden;
}

.card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.card-img-wrapper img.cover-left  { object-position: 0% 50%; }
.card-img-wrapper img.cover-right { object-position: 100% 50%; }

.book-card:hover .card-img-wrapper img {
    transform: scale(1.05);
}

.hover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 35, 102, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.book-card:hover .hover-overlay {
    opacity: 1;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    color: var(--primary-color);
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.book-card:hover .btn-icon {
    transform: translateY(0);
}

.card-content {
    padding: 1.5rem;
}

.book-title {
    font-size: 1.25rem;
    color: var(--primary-dark);
    margin-bottom: 0.25rem;
}

.book-author {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

.price-action {
    border-top: 1px solid rgba(0,0,0,0.05);
    padding-top: 1.25rem;
}

.btn-buy {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-buy:hover {
    background: var(--primary-light);
    transform: scale(1.05);
}

/* =========================================
   FOOTER
   ========================================= */
.footer {
    background-color: var(--primary-dark);
    color: var(--text-light);
    padding: 4rem 0 0 0;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-info {
    flex: 1;
    min-width: 250px;
}

.footer-logo {
    height: 120px;
    margin-bottom: 1rem;
}

.footer-info h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.footer-info p {
    color: rgba(255, 255, 255, 0.7);
    max-width: 300px;
}

.contact-info {
    flex: 1;
    min-width: 250px;
}

.contact-info h4 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
}

.contact-info h4::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 0;
    width: 40px;
    height: 2px;
    background-color: var(--accent-color);
}

.contact-info ul li {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    color: rgba(255, 255, 255, 0.8);
}

.contact-info .icon {
    font-size: 1.2rem;
}

.contact-info a:hover {
    color: var(--surface-color);
}

.footer-bottom {
    text-align: center;
    padding: 1.5rem;
    background-color: rgba(0,0,0,0.2);
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
}

/* =========================================
   ANIMATIONS & RESPONSIVE
   ========================================= */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
    100% { transform: translateY(0px) rotate(0deg); }
}

/* =========================================
   MODAL
   ========================================= */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    max-width: 860px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    padding: 2.5rem 2rem 2rem;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
    animation: fadeUp 0.3s ease-out;
}

.btn-close {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--bg-color);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    transition: var(--transition);
}

.btn-close:hover {
    background: var(--primary-color);
    color: white;
}

.modal-body {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    align-items: flex-start;
}

.modal-images {
    display: flex;
    gap: 1rem;
    flex-shrink: 0;
}

.modal-cover {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

.cover-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 600;
}

.modal-cover img {
    width: 155px;
    height: 235px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
}

.modal-info {
    flex: 1;
    min-width: 220px;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.modal-info .book-title {
    font-size: 1.4rem;
    color: var(--primary-dark);
}

.modal-info .book-author,
.modal-info .book-year {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.modal-description {
    margin-top: 0.5rem;
}

.modal-description h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.modal-description p {
    color: var(--text-main);
    line-height: 1.85;
    white-space: pre-line;
    font-size: 0.93rem;
}

.modal-action {
    margin-top: auto;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: #16a34a;
    color: white;
    text-decoration: none;
    padding: 0.55rem 1.1rem;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-download:hover {
    background: #15803d;
    transform: scale(1.05);
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .nav-content {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-links {
        gap: 1rem;
    }

    .footer-content {
        flex-direction: column;
    }

    .modal-body {
        flex-direction: column;
        align-items: center;
    }

    .modal-images {
        justify-content: center;
    }

    .modal-cover img {
        width: 130px;
        height: 195px;
    }
}
