/* ========== Variables ========== */
:root {
    --color-primary: #1a1a2e;
    --color-secondary: #16213e;
    --color-accent: #e94560;
    --color-text: #eee;
    --color-text-muted: rgba(255,255,255,0.7);
    --color-bg: #0f3460;
    --font-sans: 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    --transition: all 0.3s ease;
}

/* ========== Reset & Base ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: var(--font-sans);
    background: var(--color-primary);
    color: var(--color-text);
}

/* ========== Welcome Screen ========== */
.welcome-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 40%, #0f3460 100%);
    padding: 40px 20px;
    overflow-y: auto;
}

.welcome-content {
    max-width: 800px;
    width: 100%;
    text-align: center;
}

/* ========== Hero Image ========== */
.hero-image {
    max-width: 400px;
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    border: 4px solid var(--color-accent);
    box-shadow: 0 0 30px rgba(233, 69, 96, 0.3);
    margin-bottom: 24px;
}

/* ========== Title & Author ========== */
.welcome-title {
    font-size: 42px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 6px;
    margin-bottom: 12px;
    text-shadow: 0 2px 10px rgba(233, 69, 96, 0.4);
}

.welcome-subtitle {
    font-size: 24px;
    font-weight: 400;
    color: #d6caca;
    letter-spacing: 7px;
    margin-bottom: 25px;
    text-shadow: 0 2px 10px rgba(233, 69, 96, 0.4);
}

.welcome-author {
    font-size: 20px;
    color: var(--color-text-muted);
    margin-bottom: 6px;
}

.author-email {
    font-size: 16px;
    color: var(--color-accent);
    text-decoration: none;
    transition: var(--transition);
    display: inline-block;
    margin-bottom: 40px;
}

.author-email:hover {
    color: #fff;
    text-shadow: 0 0 8px rgba(233, 69, 96, 0.5);
}

/* ========== Book Covers ========== */
.book-covers {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.book-cover {
    width: 220px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    transition: var(--transition);
}

.book-cover:hover {
    transform: scale(1.03);
    box-shadow: 0 12px 40px rgba(233, 69, 96, 0.3);
    cursor: pointer;
}

/* ========== Lightbox ========== */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 20px;
    animation: fadeIn 0.25s ease;
}

.lightbox img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 0 40px rgba(233, 69, 96, 0.3);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ========== Buy Section ========== */
.buy-section {
    margin-top: 40px;
}

.buy-label {
    font-size: 16px;
    color: var(--color-text-muted);
    margin-bottom: 14px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.buy-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.buy-btn {
    display: inline-block;
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 10px;
    transition: var(--transition);
    letter-spacing: 0.5px;
}

.buy-btn--bookmundo {
    color: #fff;
    background: #2a7ae2;
    border: 2px solid #2a7ae2;
}

.buy-btn--bookmundo:hover {
    background: transparent;
    color: #5a9ff5;
    border-color: #5a9ff5;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(42, 122, 226, 0.3);
}

.buy-btn--amazon {
    color: #111;
    background: #ff9900;
    border: 2px solid #ff9900;
}

.buy-btn--amazon:hover {
    background: transparent;
    color: #ff9900;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 153, 0, 0.3);
}

/* ========== Options Grid ========== */
.options-grid {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.option-card {
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 28px 40px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    backdrop-filter: blur(10px);
}

.option-card:hover {
    transform: translateY(-4px);
    background: rgba(233, 69, 96, 0.15);
    border-color: var(--color-accent);
    box-shadow: 0 8px 24px rgba(233, 69, 96, 0.2);
}

.option-icon {
    font-size: 40px;
}

.option-title {
    font-size: 17px;
    font-weight: 600;
    color: #fff;
}

/* ========== Loading ========== */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--color-primary);
    z-index: 999;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255,255,255,0.1);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading p {
    margin-top: 20px;
    color: var(--color-text-muted);
    font-size: 16px;
}

/* ========== PDF Container ========== */
.pdf-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #525659;
    overflow: hidden;
}

.pdf-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #525659;
}

/* ========== Back Button ========== */
.back-btn {
    position: absolute;
    top: 16px;
    left: 16px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: white;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    z-index: 10;
}

.back-btn:hover {
    background: var(--color-accent);
    border-color: var(--color-accent);
}

/* ========== Utility ========== */
.hidden {
    display: none !important;
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
    .welcome-screen {
        padding: 30px 15px;
    }

    .hero-image {
        max-width: 280px;
    }

    .welcome-title {
        font-size: 30px;
        letter-spacing: 4px;
    }

    .welcome-author {
        font-size: 17px;
    }

    .author-email {
        font-size: 14px;
        margin-bottom: 30px;
    }

    .book-covers {
        gap: 20px;
    }

    .book-cover {
        width: 170px;
    }

    .option-card {
        padding: 22px 30px;
    }
}

@media (max-width: 480px) {
    .hero-image {
        max-width: 220px;
    }

    .welcome-title {
        font-size: 24px;
        letter-spacing: 3px;
    }

    .welcome-author {
        font-size: 15px;
    }

    .author-email {
        font-size: 13px;
    }

    .book-cover {
        width: 140px;
    }

    .option-card {
        padding: 18px 24px;
        flex: 1;
        min-width: 140px;
    }

    .option-icon {
        font-size: 32px;
    }

    .option-title {
        font-size: 15px;
    }
}
