/* --- RESET E VARIABILI (TEMA SCURO) --- */
:root {
    --bg-dark: #121212;        /* Sfondo principale scuro */
    --bg-card: #1e1e1e;        /* Sfondo sezioni/card */
    --bg-header: #1a1a1a;      /* Sfondo header */
    
    --text-main: #e0e0e0;      /* Testo principale */
    --text-muted: #b0b0b0;     /* Testo secondario */
    
    --primary-color: #bb86fc;  /* Viola chiaro per titoli/accenti */
    --accent-color: #03dac6;   /* Turchese per bottoni secondari */
    --btn-buy: #cf6679;        /* Rosso scuro per bottone acquisto */
    
    --font-main: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth; /* Scorrimento fluido per i link del menu */
}

body {
    font-family: var(--font-main);
    color: var(--text-main);
    background-color: var(--bg-dark);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.3s;
}

ul {
    list-style: none;
}

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

/* --- HEADER --- */
header {
    background-color: var(--bg-header);
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid #333;
}

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

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

nav ul {
    display: flex;
    gap: 20px;
}

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

.auth-buttons {
    display: flex;
    gap: 10px;
}

.btn-login {
    padding: 8px 15px;
    border: 1px solid var(--text-main);
    border-radius: 4px;
    color: var(--text-main);
}

.btn-login:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-register {
    padding: 8px 15px;
    background-color: var(--primary-color);
    color: #000; /* Testo nero su viola per contrasto */
    border-radius: 4px;
    font-weight: bold;
}

.btn-register:hover {
    background-color: #9965f4;
}

/* --- HERO SECTION --- */
.hero {
    /* Sfondo leggermente più chiaro o grigio per distinguersi */
    background: linear-gradient(135deg, #1e1e1e 0%, #121212 100%);
    padding: 100px 0;
    display: flex;
    align-items: center;
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

.hero-text {
    flex: 1;
}

.hero-text h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    color: var(--primary-color);
    line-height: 1.2;
}

.hero-text p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    color: var(--text-muted);
}

.hero-actions {
    display: flex;
    gap: 15px;
}

.btn {
    display: inline-block;
    padding: 12px 25px;
    border-radius: 5px;
    font-weight: bold;
    text-align: center;
    cursor: pointer;
}

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

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

.btn-outline:hover {
    background-color: var(--primary-color);
    color: #000;
}

.hero-image img {
    max-width: 200px;  /* Imposta la larghezza massima a 350 pixel */
    height: auto;      /* Mantiene le proporzioni verticali */
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(187, 134, 252, 0.2);
    border: 1px solid #333;
}

/* --- SEZIONI GENERALI --- */
.section-content {
    padding: 80px 0;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 40px;
    color: var(--primary-color);
    border-bottom: 2px solid var(--accent-color);
    display: inline-block;
    padding-bottom: 10px;
}

.alt-bg {
    background-color: var(--bg-card);
    border-top: 1px solid #333;
    border-bottom: 1px solid #333;
}

/* --- LAYOUT LIBRO & AUTORE --- */
.content-layout, .author-layout {
    display: flex;
    gap: 50px;
    align-items: flex-start;
}

.book-cover, .author-photo {
    flex: 0 0 300px;
    position: sticky;
    top: 100px;
}

.book-cover img, .author-photo img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border: 1px solid #333;
}

.text-block, .author-bio {
    flex: 1;
}

/* --- SINOSSI --- */
.synopsis-text p {
    margin-bottom: 20px;
    font-size: 1.1rem;
    color: #d0d0d0;
    text-align: justify;
}

.synopsis-text strong {
    color: var(--primary-color);
}

/* --- CTA ACQUISTO --- */
.cta-purchase {
    background: #252525;
    padding: 25px;
    border-radius: 8px;
    border-left: 5px solid var(--btn-buy);
    margin-top: 40px;
}

.price {
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-main);
    display: block;
    margin-bottom: 15px;
}

.btn-buy {
    background-color: var(--btn-buy);
    color: white;
    padding: 15px 30px;
    width: 100%;
    max-width: 250px;
    display: block;
    margin-bottom: 10px;
    border: none;
}

.btn-buy:hover {
    background-color: #b5465b;
}

/* --- AUTORE --- */
.author-bio h3 {
    font-size: 1.8rem;
    color: var(--accent-color);
    margin-bottom: 20px;
}

.author-bio p {
    margin-bottom: 15px;
    color: var(--text-muted);
}

/* --- FOOTER --- */
footer {
    background-color: #000;
    color: var(--text-muted);
    padding: 40px 0;
    margin-top: 50px;
    text-align: center;
    border-top: 1px solid #333;
}

.footer-links {
    margin-top: 10px;
}

.footer-links a {
    margin: 0 10px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

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

/* --- RESPONSIVE (MOBILE) --- */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        height: auto;
        padding: 15px 0;
    }

    nav ul {
        margin: 15px 0;
        flex-wrap: wrap;
        justify-content: center;
        font-size: 0.9rem;
    }

    .hero-content {
        flex-direction: column-reverse; /* Immagine sopra il testo su mobile */
        text-align: center;
    }

    .hero-text h1 {
        font-size: 2.2rem;
    }

    .hero-actions {
        justify-content: center;
    }

    .content-layout, .author-layout {
        flex-direction: column;
    }

    .book-cover, .author-photo {
        flex: none;
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
        position: static; /* Disabilita sticky su mobile */
    }
    
    .btn-buy {
        max-width: 100%;
    }
}