/* ===== GOOGLE FONTS IMPORTS ===== */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700;900&family=Lato:wght@300;400;700&family=Lavishly+Yours&family=Bungee+Spice&family=Kalnia+Glaze:wght@100..700&display=swap');

/* ===== GLOBAL STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1a1a2e;
    --secondary-color: #16213e;
    --accent-color: #e94560;
    --accent-light: #ff6b6b;
    --text-light: #f1f1f1;
    --text-dark: #333;
    --overlay-dark: rgba(0, 0, 0, 0.85);
    --transition-speed: 0.4s;
}

body {
    font-family: 'Lato', sans-serif;
    background: #000;
    color: var(--text-light);
    min-height: 100vh;
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
}

.parallax-bg {
    position: fixed;
    top: -100%;
    left: 0;
    width: 100%;
    height: 300vh;
    background: url('../images/Background.webp') no-repeat center center;
    background-size: cover;
    z-index: -2;
    will-change: transform;
}

.parallax-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        rgba(15, 12, 41, 0.85) 0%, 
        rgba(233, 69, 96, 0.3) 25%,
        rgba(48, 43, 99, 0.85) 50%, 
        rgba(78, 205, 196, 0.3) 75%,
        rgba(36, 36, 62, 0.85) 100%);
    background-size: 400% 400%;
    animation: gradientFlow 15s ease infinite;
}

/* ===== TOP BAR EMAIL SIGNUP ===== */
.top-bar {
    background: rgba(15, 12, 41, 0.95);
    backdrop-filter: blur(10px);
    padding: 0.8rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 102;
}

.email-signup {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: center;
}

.email-signup input[type="email"] {
    flex: 1;
    max-width: 400px;
    padding: 0.6rem 1rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: rgba(26, 26, 46, 0.6);
    color: var(--text-light);
    font-size: 0.95rem;
    transition: border-color 0.3s, background 0.3s;
}

.email-signup input[type="email"]::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.email-signup input[type="email"]:focus {
    outline: none;
    border-color: var(--accent-light);
    background: rgba(26, 26, 46, 0.8);
}

.email-signup button {
    padding: 0.6rem 1.5rem;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
}

.email-signup button:hover {
    background: var(--accent-light);
    transform: translateY(-2px);
}

/* ===== HEADER & NAVIGATION ===== */
header {
    background: linear-gradient(to right, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.5) 25%, rgba(26, 26, 46, 0.3) 50%, rgba(26, 26, 46, 0.3) 100%);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 101;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

nav {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: 'Kalnia Glaze', serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent-light);
    letter-spacing: 1px;
    -webkit-text-stroke: 2px #ffffff;
    paint-order: stroke fill;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2.5rem;
    align-items: center;
}

.hamburger {
    display: none;
    flex-direction: column;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 101;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--text-light);
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.nav-links a {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 400;
    transition: color var(--transition-speed);
    font-size: 1.05rem;
}

.nav-links a:hover {
    color: var(--accent-light);
}

/* ===== MAIN CONTENT ===== */
main {
    padding-top: 140px;
}

/* ===== HERO SECTION ===== */
.hero {
    text-align: center;
    padding: 4rem 2rem;
    max-width: 900px;
    margin: 0 auto;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: -4rem;
    left: 50%;
    transform: translateX(-50%);
    width: 100vw;
    height: 400px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.7) 30%, transparent 100%);
    z-index: -1;
    pointer-events: none;
}

.hero h1 {
    font-family: 'Kalnia Glaze', serif;
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #ff6b6b;
    animation: fadeInDown 1s ease-out, warmGlow 3s ease-in-out infinite, floatText 4s ease-in-out infinite;
    text-shadow: 0 0 30px rgba(255, 107, 107, 0.8), 0 0 60px rgba(255, 107, 107, 0.5);
    -webkit-text-stroke: 3px #ffffff;
    paint-order: stroke fill;
    letter-spacing: 3px;
    transform-style: preserve-3d;
}

.subtitle {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 300;
    animation: fadeInUp 1s ease-out, subtleShimmer 4s ease-in-out infinite;
    text-shadow: 0 2px 10px rgba(78, 205, 196, 0.4), 0 0 20px rgba(255, 255, 255, 0.2);
    letter-spacing: 1.5px;
    font-style: italic;
}

/* ===== BOOKS GRID ===== */
.books-grid {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(200px, auto);
    gap: 1.2rem;
    grid-auto-flow: dense;
}

/* Different book card sizes */
.book-card.large {
    grid-column: span 2;
    grid-row: span 3;
}

.book-card.medium {
    grid-column: span 1;
    grid-row: span 3;
}

.book-card.small {
    grid-column: span 1;
    grid-row: span 1;
}

.book-card {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.3s ease-out;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    /* This enforces the 2:3 ratio on ALL cards, regardless of size */
    aspect-ratio: 2 / 3;
    will-change: transform;
    opacity: 0;
    transform: translateY(50px);
    display: block;
    text-decoration: none;
    color: inherit;
}

.book-card.visible {
    animation: fadeInUp 0.8s ease-out forwards;
}

.book-card:hover {
    transform: translateY(-8px) !important;
}

.book-cover {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform var(--transition-speed), filter var(--transition-speed);
}

.book-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    transition: opacity var(--transition-speed);
}

.book-card:hover .book-cover img {
    filter: brightness(0.4);
    transform: scale(1.05);
}

.book-card:hover .book-overlay {
    opacity: 1;
}

.synopsis {
    text-align: center;
    color: var(--text-light);
}

.synopsis h3 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.2rem, 4vw, 1.8rem);
    margin-bottom: 1rem;
    color: var(--accent-light);
}

.synopsis p {
    font-size: clamp(0.8rem, 2.5vw, 1rem);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.read-more {
    display: inline-block;
    color: var(--accent-light);
    text-decoration: none;
    font-weight: 600;
    border: 2px solid var(--accent-light);
    padding: clamp(0.5rem, 2vw, 0.7rem) clamp(1rem, 4vw, 1.5rem);
    border-radius: 30px;
    transition: all var(--transition-speed);
    font-size: clamp(0.8rem, 2.5vw, 1rem);
}

/* Larger text for large book cards */
.book-card.large .synopsis h3 {
    font-size: clamp(2.4rem, 8vw, 3.6rem);
    margin-bottom: 1.5rem;
}

.book-card.large .synopsis p {
    font-size: clamp(1.6rem, 5vw, 2rem);
    line-height: 1.6;
    margin-bottom: 2rem;
}

.book-card.large .read-more {
    font-size: clamp(1.6rem, 5vw, 2rem);
    padding: clamp(1rem, 4vw, 1.4rem) clamp(2rem, 8vw, 3rem);
    border-width: 3px;
}

.read-more:hover {
    background: var(--accent-light);
    color: white;
    transform: scale(1.05);
}

/* ===== ABOUT PAGE ===== */
.about-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.about-card {
    background: rgba(26, 26, 46, 0.8);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 3rem;
    align-items: start;
    border: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    transform: translateY(50px);
    animation: fadeInUp 0.8s ease-out forwards;
    animation-delay: 0.3s;
}

.about-image {
    width: 100%;
    aspect-ratio: 3 / 4;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.about-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.about-image img:hover {
    transform: scale(1.05);
}

.about-content h2 {
    font-family: 'Kalnia Glaze', serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-light);
    margin-bottom: 1.5rem;
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.3);
    paint-order: stroke fill;
}

.about-content p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1.5rem;
}

.about-content p:last-child {
    margin-bottom: 0;
}

/* ===== CONTACT PAGE ===== */
.contact-card {
    grid-template-columns: 1fr;
    max-width: 800px;
    margin: 0 auto;
}

.contact-info h2,
.contact-form-container h2 {
    font-family: 'Kalnia Glaze', serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-light);
    margin-bottom: 2rem;
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.3);
    paint-order: stroke fill;
}

.contact-methods {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.contact-method h3 {
    font-size: 1.3rem;
    color: var(--accent-light);
    margin-bottom: 0.8rem;
}

.contact-method p {
    font-size: 1.05rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.9);
}

.contact-method a {
    color: var(--accent-light);
    text-decoration: none;
    transition: color 0.3s;
}

.contact-method a:hover {
    color: #fff;
    text-decoration: underline;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 1rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.form-group input,
.form-group textarea {
    padding: 0.8rem 1rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(26, 26, 46, 0.6);
    color: var(--text-light);
    font-size: 1rem;
    font-family: 'Lato', sans-serif;
    transition: border-color 0.3s, background 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-light);
    background: rgba(26, 26, 46, 0.8);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.submit-btn {
    padding: 1rem 2rem;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
    align-self: flex-start;
}

.submit-btn:hover {
    background: var(--accent-light);
    transform: translateY(-2px);
}

/* ===== FOOTER ===== */
footer {
    text-align: center;
    padding: 2rem;
    background: var(--primary-color);
    margin-top: 4rem;
    border-top: 2px solid var(--accent-color);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes warmGlow {
    0% {
        color: #ff6b6b;
        text-shadow: 0 0 30px rgba(255, 107, 107, 0.8), 0 0 60px rgba(255, 107, 107, 0.5);
    }
    50% {
        color: #fff;
        text-shadow: 0 0 40px rgba(255, 255, 255, 1), 0 0 80px rgba(255, 220, 180, 0.9), 0 0 120px rgba(255, 180, 120, 0.7);
    }
    100% {
        color: #ff6b6b;
        text-shadow: 0 0 30px rgba(255, 107, 107, 0.8), 0 0 60px rgba(255, 107, 107, 0.5);
    }
}

@keyframes floatText {
    0%, 100% {
        transform: translateY(0px) scale(1);
    }
    50% {
        transform: translateY(-10px) scale(1.02);
    }
}

@keyframes subtleShimmer {
    0%, 100% {
        opacity: 0.9;
        text-shadow: 0 2px 10px rgba(78, 205, 196, 0.4), 0 0 20px rgba(255, 255, 255, 0.2);
    }
    50% {
        opacity: 1;
        text-shadow: 0 2px 15px rgba(78, 205, 196, 0.7), 0 0 30px rgba(255, 255, 255, 0.4), 0 0 40px rgba(69, 183, 209, 0.3);
    }
}

@keyframes gradientFlow {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1200px) {
    .books-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .books-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columns on tablet */
        gap: 1.2rem;
    }
}

@media (max-width: 600px) {
    .books-grid {
        grid-template-columns: 1fr; /* 1 column on mobile */
        gap: 1rem;
    }
    .book-card.large,
    .book-card.medium,
    .book-card.small {
        grid-column: span 1;
        grid-row: span 1;
    }
    
    /* Make all text larger on mobile for better readability */
    .synopsis h3 {
        font-size: clamp(2.4rem, 8vw, 3.6rem);
        margin-bottom: 1.5rem;
    }
    
    .synopsis p {
        font-size: clamp(1.6rem, 5vw, 2rem);
        line-height: 1.6;
        margin-bottom: 2rem;
    }
    
    .read-more {
        font-size: clamp(1.6rem, 5vw, 2rem);
        padding: clamp(1rem, 4vw, 1.4rem) clamp(2rem, 8vw, 3rem);
        border-width: 3px;
    }
}

@media (max-width: 768px) {
    .top-bar {
        padding: 0.6rem 1rem;
    }
    
    .email-signup {
        gap: 0.5rem;
    }
    
    .email-signup input[type="email"] {
        font-size: 0.9rem;
        padding: 0.5rem 0.8rem;
    }
    
    .email-signup button {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
        white-space: nowrap;
    }
    
    .hamburger {
        display: flex;
    }
    
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 70%;
        max-width: 300px;
        background: rgba(26, 26, 46, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        gap: 2rem;
        padding: 2rem;
        transition: right 0.4s ease;
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.5);
        z-index: 103;
    }
    
    .nav-links.active {
        right: 0;
    }
    
    .nav-links li {
        width: 100%;
        text-align: center;
    }
    
    .nav-links a {
        font-size: 1.2rem;
        display: block;
        padding: 0.5rem;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .cart-sidebar {
        width: 100%;
        right: -100%;
    }
    
    .about-card {
        grid-template-columns: 1fr;
        padding: 2rem;
        gap: 2rem;
    }
    
    .about-image {
        max-width: 400px;
        margin: 0 auto;
    }
    
    .contact-card {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.3rem;
    }
    
    .nav-links {
        gap: 1rem;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .about-card {
        padding: 1.5rem;
        gap: 1.5rem;
    }
    
    .about-content h2 {
        font-size: 2rem;
    }
    
    .about-content p {
        font-size: 1rem;
    }
    
    .contact-info h2,
    .contact-form-container h2 {
        font-size: 1.8rem;
    }
    
    .contact-method h3 {
        font-size: 1.1rem;
    }
}