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

:root {
    /* Deep cosmic colors */
    --primary-color: #0a0e1a;
    --secondary-color: #1a1f2e;
    --accent-color: #d97706;
    --accent-gold: #f59e0b;
    --accent-purple: #8b5cf6;
    --bg-color: #0a0e1a;
    --bg-light: #1a1f2e;
    --text-color: #f7fafc;
    --text-secondary: #cbd5e0;
    --border-color: #2d3748;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 4px 16px rgba(217, 119, 6, 0.4);
    --gradient-cosmic: linear-gradient(135deg, #0a0e1a 0%, #1a1f2e 50%, #2d1b4e 100%);
    --gradient-nebula: linear-gradient(135deg, #d97706 0%, #f59e0b 50%, #8b5cf6 100%);
}

body {
    font-family: 'Tajawal', sans-serif;
    background: var(--gradient-cosmic);
    background-attachment: fixed;
    color: var(--text-color);
    line-height: 1.8;
    font-size: 18px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-top: 0;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(2px 2px at 20% 30%, white, transparent),
        radial-gradient(2px 2px at 60% 70%, white, transparent),
        radial-gradient(1px 1px at 50% 50%, white, transparent),
        radial-gradient(1px 1px at 80% 10%, white, transparent),
        radial-gradient(2px 2px at 90% 60%, white, transparent),
        radial-gradient(1px 1px at 33% 80%, white, transparent),
        radial-gradient(1px 1px at 15% 75%, white, transparent);
    background-size: 200% 200%;
    background-position: 0% 0%;
    opacity: 0.3;
    pointer-events: none;
    z-index: 0;
}

/* Page Container */
.page-container {
    height: 100vh;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.page {
    display: none;
    height: 100%;
    overflow-y: auto;
    padding: 2rem 1.5rem 4rem;
    animation: fadeIn 0.5s ease-in-out;
}

.page.active {
    display: block;
}

/* Hero Section */
.hero-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4rem;
    max-width: 1200px;
    margin: 0 auto 2rem;
    padding: 2rem 0;
}

.book-cover-container {
    flex: 0 0 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.book-cover-wrapper {
    position: relative;
    width: 100%;
}

.book-cover {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6),
                0 0 40px rgba(217, 119, 6, 0.3);
    border: 2px solid rgba(217, 119, 6, 0.2);
    transition: all 0.3s ease;
    display: block;
}

.book-cover:hover {
    transform: translateY(-10px);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8),
                0 0 60px rgba(217, 119, 6, 0.5);
}

.btn-buy {
    display: inline-block;
    background: var(--gradient-nebula);
    color: white;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.375rem;
    padding: 1.125rem 3.5rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(217, 119, 6, 0.4);
    text-align: center;
    margin-top: 1.5rem;
}

.btn-buy:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(217, 119, 6, 0.6);
}

.book-info {
    flex: 1;
    text-align: center;
}

.badge {
    position: absolute;
    top: -12px;
    right: -12px;
    background: var(--gradient-nebula);
    color: white;
    padding: 0.625rem 1.75rem;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    box-shadow: 0 6px 20px rgba(217, 119, 6, 0.5);
    z-index: 10;
    transform: rotate(5deg);
    transition: all 0.3s ease;
}

.badge:hover {
    transform: rotate(0deg) scale(1.05);
    box-shadow: 0 8px 25px rgba(217, 119, 6, 0.7);
}

.book-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.book-subtitle {
    font-size: 1.75rem;
    font-weight: 300;
    background: var(--gradient-nebula);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.book-author {
    font-size: 1.375rem;
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* Tabs */
.tabs-container {
    max-width: 1200px;
    margin: 0 auto;
}

.tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid rgba(217, 119, 6, 0.2);
    overflow-x: auto;
    padding-bottom: 0.5rem;
    position: sticky;
    top: 0;
    background: var(--gradient-cosmic);
    padding-top: 1rem;
    z-index: 100;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.375rem;
    font-weight: 500;
    font-family: 'Tajawal', sans-serif;
    padding: 0.875rem 1.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px 8px 0 0;
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--accent-gold);
    background: rgba(217, 119, 6, 0.1);
}

.tab-btn.active {
    color: var(--accent-gold);
    background: rgba(217, 119, 6, 0.2);
    border-bottom: 3px solid var(--accent-gold);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.tab-content.active {
    display: block;
}

.tab-panel {
    background: rgba(74, 85, 104, 0.3);
    padding: 2rem;
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

/* Section Styles */
.section-title {
    font-size: 2rem;
    font-weight: 600;
    margin: 2rem 0 1.5rem;
    color: var(--text-color);
}

.description {
    font-size: 1.375rem;
    line-height: 2;
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.text {
    font-size: 1.375rem;
    line-height: 2;
    color: var(--text-secondary);
    text-align: justify;
}

.reasons {
    display: grid;
    gap: 1rem;
    margin: 1.5rem 0;
}

.reason {
    background: var(--gradient-nebula);
    color: white;
    padding: 1.375rem 1.75rem;
    border-radius: 8px;
    font-size: 1.375rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(217, 119, 6, 0.3);
    transition: all 0.3s ease;
}

.reason:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(217, 119, 6, 0.5);
}

.features {
    display: grid;
    gap: 1rem;
}

.feature {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem;
    background-color: rgba(74, 85, 104, 0.4);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.feature:hover {
    background-color: rgba(74, 85, 104, 0.6);
    border-color: var(--accent-color);
    transform: translateX(-5px);
}

.feature-icon {
    color: var(--accent-gold);
    font-size: 1.75rem;
    font-weight: bold;
    flex-shrink: 0;
}

.feature p {
    font-size: 1.25rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin: 0;
}

/* Audience Styles */
.audience-section {
    margin: 2rem 0;
}

.audience-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.audience-list {
    display: grid;
    gap: 0.875rem;
}

.audience-item {
    padding: 1rem 1.5rem;
    background-color: rgba(74, 85, 104, 0.3);
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 1.25rem;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    position: relative;
    padding-right: 3rem;
}

.audience-item::before {
    content: "•";
    position: absolute;
    right: 1.25rem;
    color: var(--accent-gold);
    font-size: 1.5rem;
    font-weight: bold;
}

.audience-item:hover {
    border-color: var(--accent-color);
    background-color: rgba(74, 85, 104, 0.5);
    transform: translateX(-3px);
}

.not-for .audience-item {
    border-color: rgba(239, 68, 68, 0.5);
    background-color: rgba(127, 29, 29, 0.2);
}

.not-for .audience-item::before {
    content: "×";
    color: #ef4444;
}

.not-for .audience-item:hover {
    border-color: #ef4444;
}

.closing-text {
    font-size: 1.375rem;
    line-height: 2;
    text-align: center;
    color: var(--text-color);
    font-weight: 500;
    margin-top: 2rem;
    padding: 1.75rem;
    background: rgba(217, 119, 6, 0.15);
    border: 1px solid rgba(217, 119, 6, 0.3);
    border-radius: 8px;
}

/* Author Content in Tab */
.author-content {
    max-width: 1000px;
    margin: 0 auto;
}

.author-header {
    display: flex;
    gap: 3rem;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.author-photo-container {
    flex: 0 0 280px;
}

.author-photo {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6),
                0 0 40px rgba(217, 119, 6, 0.3);
    border: 3px solid rgba(217, 119, 6, 0.3);
    transition: all 0.3s ease;
}

.author-photo:hover {
    transform: scale(1.05);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8),
                0 0 60px rgba(217, 119, 6, 0.5);
}

.author-bio {
    flex: 1;
}

.author-name {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    background: var(--gradient-nebula);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bio-text {
    font-size: 1.375rem;
    line-height: 2;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    text-align: justify;
}

.bio-text strong {
    color: var(--accent-gold);
    font-weight: 600;
}

.author-credentials {
    display: grid;
    gap: 1rem;
    margin: 2rem 0;
    padding: 2rem 0;
    border-top: 1px solid rgba(217, 119, 6, 0.2);
    border-bottom: 1px solid rgba(217, 119, 6, 0.2);
}

.credential-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: rgba(217, 119, 6, 0.08);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.credential-item:hover {
    background: rgba(217, 119, 6, 0.15);
    transform: translateX(-5px);
}

.credential-icon {
    font-size: 1.75rem;
    flex-shrink: 0;
}

.credential-item p {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-secondary);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Responsive Design - Mobile First */

/* Small phones (max 480px) */
@media (max-width: 480px) {
    body {
        font-size: 14px;
    }

    .page {
        padding: 1rem 0.75rem 4rem;
    }


    .hero-section {
        flex-direction: column;
        gap: 1.5rem;
        padding: 1.5rem 0;
    }

    .book-cover-container {
        flex: 0 0 auto;
        width: 160px;
        margin: 0 auto;
    }

    .badge {
        font-size: 0.75rem;
        padding: 0.375rem 1rem;
        top: -8px;
        right: -8px;
    }

    .btn-buy {
        font-size: 1rem;
        padding: 0.875rem 2.5rem;
        margin-top: 1rem;
    }

    .book-title {
        font-size: 1.75rem;
    }

    .book-subtitle {
        font-size: 1.125rem;
    }

    .book-author {
        font-size: 1rem;
    }

    .form-group {
        flex-direction: column;
    }

    .btn-primary {
        width: 100%;
    }

    .tabs {
        gap: 0.25rem;
        flex-wrap: wrap;
    }

    .tab-btn {
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
    }

    .tab-panel {
        padding: 1rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .description, .text {
        font-size: 1rem;
    }

    .author-container {
        padding: 1.5rem 1rem;
    }

    .author-header {
        flex-direction: column;
        gap: 1.5rem;
    }

    .author-photo-container {
        width: 160px;
        margin: 0 auto;
    }

    .author-name {
        font-size: 1.5rem;
        text-align: center;
    }

    .bio-text {
        font-size: 1rem;
    }
}

/* Tablets and larger phones (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    .hero-section {
        flex-direction: column;
        gap: 2rem;
    }

    .book-cover-container {
        flex: 0 0 auto;
        width: 220px;
        margin: 0 auto;
    }

    .badge {
        font-size: 0.8125rem;
        padding: 0.4375rem 1.25rem;
        top: -9px;
        right: -9px;
    }

    .btn-buy {
        font-size: 1.0625rem;
        padding: 0.9375rem 2.75rem;
        margin-top: 1.25rem;
    }

    .book-title {
        font-size: 2.25rem;
    }

    .book-subtitle {
        font-size: 1.375rem;
    }

    .form-group {
        flex-direction: column;
    }

    .btn-primary {
        width: 100%;
    }

    .tabs {
        gap: 0.5rem;
    }

    .tab-btn {
        font-size: 1rem;
        padding: 0.625rem 1.25rem;
    }

    .tab-panel {
        padding: 1.75rem;
    }

    .author-container {
        padding: 2rem 1.5rem;
    }

    .author-header {
        flex-direction: column;
        gap: 2rem;
    }

    .author-photo-container {
        width: 220px;
        margin: 0 auto;
    }

    .author-name {
        font-size: 1.875rem;
        text-align: center;
    }

    .page {
        padding: 1.5rem 1rem 4rem;
    }
}
