/* ============================================
   MyByteNest - Books & Quotes Website
   ============================================ */

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

:root {
    --primary: #1a1a2e;
    --primary-light: #16213e;
    --accent: #e94560;
    --accent-hover: #c73a52;
    --gold: #d4a574;
    --gold-light: #e8c9a0;
    --text: #2d3436;
    --text-light: #636e72;
    --bg: #faf8f5;
    --bg-card: #ffffff;
    --bg-dark: #1a1a2e;
    --shadow: 0 2px 20px rgba(0,0,0,0.08);
    --shadow-hover: 0 8px 30px rgba(0,0,0,0.12);
    --radius: 12px;
    --transition: 0.3s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    font-family: 'Playfair Display', Georgia, serif;
    line-height: 1.3;
}

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

img {
    max-width: 100%;
    display: block;
}

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

/* ============================================
   Navigation
   ============================================ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(250, 248, 245, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    transition: all var(--transition);
}

.navbar.scrolled {
    box-shadow: var(--shadow);
}

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

.logo {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.logo img {
    height: 48px;
    width: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

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

.footer .logo img {
    height: 52px;
    filter: brightness(1.1);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 36px;
}

.nav-links a {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-light);
    position: relative;
    padding: 4px 0;
}

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

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
}

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

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--primary);
    transition: var(--transition);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-block;
    padding: 14px 32px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    border: none;
    font-family: 'Inter', sans-serif;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(233,69,96,0.3);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-2px);
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
    padding: 160px 0 100px;
    text-align: center;
    background: linear-gradient(180deg, var(--bg) 0%, #f0ebe3 100%);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '"';
    position: absolute;
    font-size: 400px;
    font-family: 'Playfair Display', serif;
    color: rgba(212, 165, 116, 0.08);
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    line-height: 1;
}

.hero h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    color: var(--primary);
    margin-bottom: 20px;
    position: relative;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto 40px;
    line-height: 1.8;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ============================================
   Daily Quote
   ============================================ */
.daily-quote {
    padding: 60px 0;
    margin-top: -40px;
    position: relative;
    z-index: 1;
}

.quote-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 36px;
    box-shadow: var(--shadow);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border-left: 4px solid var(--gold);
}

.quote-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
    border-left-color: var(--accent);
}

.quote-card.featured {
    background: var(--primary);
    color: #fff;
    text-align: center;
    padding: 60px 40px;
}

.quote-label {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 24px;
}

.quote-card blockquote {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.2rem, 2.5vw, 1.6rem);
    font-style: italic;
    line-height: 1.6;
    margin-bottom: 16px;
}

.quote-card cite {
    font-style: normal;
    font-size: 0.95rem;
    color: var(--gold-light);
    font-weight: 500;
}

.quote-card:not(.featured) cite {
    color: var(--text-light);
}

.quote-tag {
    display: inline-block;
    background: rgba(233, 69, 96, 0.1);
    color: var(--accent);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 12px;
}

/* ============================================
   Sections
   ============================================ */
.section {
    padding: 80px 0;
}

.section-title {
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    color: var(--primary);
    text-align: center;
    margin-bottom: 8px;
}

.section-subtitle {
    text-align: center;
    color: var(--text-light);
    font-size: 1.05rem;
    margin-bottom: 48px;
}

.section-cta {
    text-align: center;
    margin-top: 48px;
}

/* ============================================
   Categories Grid
   ============================================ */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.category-card {
    position: relative;
    border-radius: 16px;
    padding: 36px 28px;
    text-align: left;
    box-shadow: var(--shadow);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: none;
    overflow: hidden;
    color: #fff;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    transition: opacity 0.4s ease;
    border-radius: 16px;
}

.category-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.category-card:hover::before {
    opacity: 1;
}

/* Individual category gradients */
.category-card.cat-selfhelp {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.category-card.cat-selfhelp::before {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.category-card.cat-business {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}
.category-card.cat-business::before {
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
}

.category-card.cat-psychology {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}
.category-card.cat-psychology::before {
    background: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
}

.category-card.cat-fiction {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}
.category-card.cat-fiction::before {
    background: linear-gradient(135deg, #38f9d7 0%, #43e97b 100%);
}

.category-card.cat-philosophy {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}
.category-card.cat-philosophy::before {
    background: linear-gradient(135deg, #fee140 0%, #fa709a 100%);
}

.category-card.cat-science {
    background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%);
}
.category-card.cat-science::before {
    background: linear-gradient(135deg, #fbc2eb 0%, #a18cd1 100%);
}

.category-icon {
    width: 56px;
    height: 56px;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(8px);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    font-size: 1.6rem;
    transition: all 0.4s ease;
}

.category-card:hover .category-icon {
    background: rgba(255,255,255,0.35);
    transform: scale(1.1);
}

.category-card h3 {
    font-size: 1.3rem;
    color: #fff;
    margin-bottom: 6px;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.category-card p {
    font-size: 0.88rem;
    color: rgba(255,255,255,0.85);
    position: relative;
    z-index: 1;
    line-height: 1.5;
}

.category-count {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(8px);
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.5px;
}

/* ============================================
   Books Grid
   ============================================ */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 28px;
}

.book-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all var(--transition);
}

.book-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
}

.book-cover {
    height: 200px;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 16px;
}

.book-category {
    background: rgba(255,255,255,0.2);
    color: #fff;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    backdrop-filter: blur(4px);
}

.book-info {
    padding: 24px;
}

.book-info h3 {
    font-size: 1.3rem;
    color: var(--primary);
    margin-bottom: 4px;
}

.book-author {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.book-excerpt {
    font-size: 0.92rem;
    color: var(--text);
    margin-bottom: 16px;
    line-height: 1.6;
}

.read-more {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.9rem;
}

.read-more:hover {
    color: var(--accent-hover);
}

/* ============================================
   Quote Tags / Categories
   ============================================ */
.quote-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.tag {
    display: inline-block;
    padding: 14px 32px;
    background: var(--bg-card);
    border: 2px solid #e8e2d9;
    border-radius: 30px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.tag:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(233, 69, 96, 0.25);
}

.quote-categories {
    background: linear-gradient(180deg, #f0ebe3 0%, var(--bg) 100%);
}

/* ============================================
   Quotes Grid
   ============================================ */
.quotes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

/* ============================================
   Newsletter
   ============================================ */
.newsletter {
    padding: 40px 0 80px;
}

.newsletter-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    padding: 60px 40px;
    border-radius: var(--radius);
    text-align: center;
}

.newsletter-card h2 {
    font-size: 2rem;
    margin-bottom: 12px;
}

.newsletter-card p {
    color: rgba(255,255,255,0.8);
    margin-bottom: 28px;
    font-size: 1.05rem;
}

.newsletter-form {
    display: flex;
    gap: 12px;
    max-width: 480px;
    margin: 0 auto;
    flex-wrap: wrap;
    justify-content: center;
}

.newsletter-form input {
    flex: 1;
    min-width: 240px;
    padding: 14px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    outline: none;
}

.newsletter-form input:focus {
    box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.3);
}

/* ============================================
   Footer
   ============================================ */
.footer {
    background: var(--bg-dark);
    color: rgba(255,255,255,0.7);
    padding: 60px 0 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-about p {
    margin-top: 16px;
    font-size: 0.9rem;
    line-height: 1.7;
}

.footer-links h4,
.footer-social h4 {
    color: #fff;
    font-size: 1rem;
    margin-bottom: 16px;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    font-size: 0.9rem;
    transition: color var(--transition);
}

.footer-links a:hover {
    color: var(--accent);
}

.social-links {
    display: flex;
    gap: 16px;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    transition: all var(--transition);
}

.social-links a:hover {
    background: var(--accent);
    transform: translateY(-3px);
}

.social-links svg {
    width: 18px;
    height: 18px;
}

.footer-bottom {
    text-align: center;
    padding: 24px 0;
    font-size: 0.85rem;
}

/* ============================================
   Books Page
   ============================================ */
.page-header {
    padding: 120px 0 60px;
    text-align: center;
    background: linear-gradient(180deg, var(--bg) 0%, #f0ebe3 100%);
}

.page-header h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    color: var(--primary);
    margin-bottom: 12px;
}

.page-header p {
    color: var(--text-light);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Filter Buttons */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 40px;
}

.filter-btn {
    padding: 10px 24px;
    border: 2px solid #e8e2d9;
    border-radius: 30px;
    background: var(--bg-card);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    transition: all var(--transition);
    font-family: 'Inter', sans-serif;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* Book Summary Detail */
.book-summary {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 44px;
    margin-bottom: 32px;
    box-shadow: var(--shadow);
    border-left: 5px solid var(--gold);
    transition: all 0.3s ease;
}

.book-summary:hover {
    box-shadow: var(--shadow-hover);
    border-left-color: var(--accent);
}

.book-summary h3 {
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 4px;
}

.book-summary .book-meta {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.book-summary .book-meta span {
    font-size: 0.85rem;
    color: var(--text-light);
}

.book-summary .book-meta .category-badge {
    background: rgba(233, 69, 96, 0.1);
    color: var(--accent);
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
}

.book-summary h4 {
    font-size: 1.15rem;
    color: var(--primary);
    margin: 24px 0 12px;
}

.book-summary p {
    color: var(--text);
    margin-bottom: 12px;
    line-height: 1.8;
}

.book-summary ul {
    margin: 12px 0 12px 24px;
    color: var(--text);
}

.book-summary ul li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.book-summary .book-rating {
    color: var(--gold);
    font-size: 1.2rem;
    letter-spacing: 2px;
}

/* ============================================
   Quotes Page
   ============================================ */
.quotes-masonry {
    columns: 3;
    column-gap: 24px;
}

.quotes-masonry .quote-card {
    break-inside: avoid;
    margin-bottom: 24px;
    display: inline-block;
    width: 100%;
}

/* ============================================
   About Page
   ============================================ */
.about-content {
    max-width: 800px;
    margin: 0 auto;
}

.about-content p {
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: 20px;
    color: var(--text);
}

.about-content h3 {
    font-size: 1.4rem;
    color: var(--primary);
    margin: 40px 0 16px;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 968px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    .quotes-masonry {
        columns: 2;
    }
}

@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--bg);
        flex-direction: column;
        padding: 24px;
        gap: 16px;
        border-bottom: 1px solid rgba(0,0,0,0.05);
        box-shadow: var(--shadow);
    }

    .nav-links.active {
        display: flex;
    }

    .hero {
        padding: 130px 0 80px;
    }

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

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .quotes-masonry {
        columns: 1;
    }

    .book-summary {
        padding: 24px;
    }
}

@media (max-width: 968px) {
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .categories-grid {
        grid-template-columns: 1fr;
    }

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

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
}
