/* Regolamento Plugin Styles - Stile Libro */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.regolamento-container {
    max-width: 1400px;
    margin: 20px auto;
    padding: 20px;
    font-family: 'Calibri', 'Calibri', serif;
    background: linear-gradient(135deg, #f5f3f0 0%, #e8e2db 100%);
    border-radius: 15px;
    min-height: calc(100vh - 40px);
}

/* Stile del libro aperto */
.book-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    background: #fff;
    border-radius: 15px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    position: relative;
    min-height: 80vh;
}

.book-container::before {
    content: '';
    position: absolute;
    left: 299px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, 
        transparent 0%, 
        rgba(0, 0, 0, 0.1) 20%, 
        rgba(0, 0, 0, 0.15) 50%, 
        rgba(0, 0, 0, 0.1) 80%, 
        transparent 100%);
    z-index: 10;
}

/* Indice a sinistra */
.book-index {
    background: linear-gradient(135deg, #f8f6f3 0%, #f0ede8 100%);
    padding: 30px 20px;
    border-right: 3px solid #d4af37;
    position: relative;
    overflow-y: auto;
    max-height: 80vh;
}

.book-index::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 10px;
    background: linear-gradient(to right, 
        transparent, 
        rgba(0, 0, 0, 0.05));
}

.index-title {
    font-size: 1.8rem;
    color: #8b4513;
    margin-bottom: 25px;
    text-align: center;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(139, 69, 19, 0.1);
    border-bottom: 2px solid #d4af37;
    padding-bottom: 15px;
}

.chapter-nav {
    list-style: none;
}

.chapter-item {
    margin-bottom: 15px;
}

.chapter-link {
    display: block;
    padding: 12px 15px;
    color: #8b4513;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    border-left: 4px solid transparent;
}

.chapter-link:hover {
    background: rgba(212, 175, 55, 0.1);
    border-left-color: #d4af37;
    transform: translateX(5px);
}

.chapter-link.active {
    background: rgba(212, 175, 55, 0.2);
    border-left-color: #d4af37;
    color: #5d2f0a;
}

.paragraph-nav {
    list-style: none;
    margin-left: 20px;
    margin-top: 8px;
    border-left: 2px solid rgba(212, 175, 55, 0.3);
    padding-left: 15px;
}

.paragraph-item {
    margin-bottom: 8px;
}

.paragraph-link {
    display: block;
    padding: 8px 12px;
    color: #666;
    text-decoration: none;
    font-size: 0.95rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.paragraph-link:hover {
    background: rgba(212, 175, 55, 0.1);
    color: #8b4513;
}

.paragraph-link.active {
    background: rgba(212, 175, 55, 0.15);
    color: #8b4513;
    font-weight: 500;
}

/* Contenuto pagina a destra */
.book-content {
    padding: 40px;
    background: #fff;
    position: relative;
    overflow-y: auto;
    max-height: 80vh;
}

.book-content::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    height: 1px;
    background: linear-gradient(to right, 
        transparent, 
        rgba(212, 175, 55, 0.3) 50%, 
        transparent);
}

.content-header {
    margin-bottom: 30px;
    border-bottom: 3px solid #d4af37;
    padding-bottom: 20px;
}

.content-title {
    font-size: 2.2rem;
    color: #8b4513;
    margin-bottom: 10px;
    font-weight: bold;
}

.content-subtitle {
    font-size: 1.1rem;
    color: #666;
    font-style: italic;
}

.chapter-content {
    display: none;
    animation: fadeInUp 0.5s ease;
}

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

.chapter-title {
    font-size: 2rem;
    color: #8b4513;
    margin-bottom: 25px;
    border-left: 5px solid #d4af37;
    padding-left: 20px;
    background: linear-gradient(to right, rgba(212, 175, 55, 0.1), transparent);
    padding-top: 15px;
    padding-bottom: 15px;
}

.paragraph-section {
    margin-bottom: 35px;
    padding: 25px;
    background: #fafafa;
    border-radius: 10px;
    border: 1px solid #eee;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: background-color 0.5s ease;
}

.paragraph-title {
    font-size: 1.4rem;
    color: #5d2f0a;
    margin-bottom: 15px;
    font-weight: 600;
    border-bottom: 2px solid rgba(212, 175, 55, 0.3);
    padding-bottom: 8px;
}

.paragraph-content {
    display: block;
}

.paragraph-image {
    width: 200px;
    height: 200px;
    margin: 0 auto 20px auto;
    display: block;
    text-align: center;
}

.paragraph-image img {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 3px solid #f0ede8;
    transition: transform 0.3s ease;
}

.paragraph-image img:hover {
    transform: scale(1.05);
}

.paragraph-text {
    line-height: 1.8;
    font-size: 1.05rem;
    color: #333;
    text-align: justify;
}

.paragraph-text p {
    margin-bottom: 10px;
}

.paragraph-text strong {
    color: #8b4513;
    font-weight: bold;
}

/* Stile per elenco puntato con <ep> */
.bullet-point {
    color: #333;
    font-weight: bold;
    font-size: 1.2em;
    margin-right: 8px;
    display: inline-block;
    margin-left: 20px;
    vertical-align: top;
}

/* Welcome screen */
.welcome-content {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    display: none;
}

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

.welcome-title {
    font-size: 2.5rem;
    color: #8b4513;
    margin-bottom: 20px;
    font-weight: bold;
}

.welcome-text {
    font-size: 1.2rem;
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

.book-icon {
    font-size: 4rem;
    color: #d4af37;
    margin-bottom: 30px;
    display: block;
}

/* Messaggio di errore */
.regolamento-error {
    background: #ffe6e6;
    color: #c33;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #ffcccc;
    text-align: center;
    font-weight: 500;
    margin: 20px;
}

/* Animazioni */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pageFlip {
    from {
        transform: rotateY(-90deg);
        opacity: 0;
    }
    to {
        transform: rotateY(0deg);
        opacity: 1;
    }
}

.chapter-content.active {
    animation: pageFlip 0.6s ease;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .regolamento-container {
        margin: 10px;
        padding: 10px;
    }
    
    .book-container {
        grid-template-columns: 280px 1fr;
    }
    
    .book-container::before {
        left: 279px;
    }
    
    .book-index {
        padding: 20px 15px;
    }
    
    .book-content {
        padding: 30px 25px;
    }
}

@media (max-width: 768px) {
    .regolamento-container {
        grid-template-columns: 1fr;
        gap: 0;
        margin: 5px;
        padding: 5px;
    }
    
    .book-container {
        grid-template-columns: 1fr;
    }
    
    .book-container::before {
        display: none;
    }
    
    .book-index {
        border-right: none;
        border-bottom: 3px solid #d4af37;
        max-height: 40vh;
        padding: 20px;
    }
    
    .book-content {
        max-height: 60vh;
        padding: 25px 20px;
    }
    
    .paragraph-content {
        grid-template-columns: 1fr;
    }
    
    .paragraph-image {
        max-width: 100%;
        text-align: center;
        order: -1;
    }
    
    .chapter-title {
        font-size: 1.6rem;
        padding: 12px 15px;
    }
    
    .paragraph-title {
        font-size: 1.2rem;
    }
    
    .paragraph-text {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .welcome-title {
        font-size: 2rem;
    }
    
    .book-icon {
        font-size: 3rem;
    }
    
    .index-title {
        font-size: 1.5rem;
    }
    
    .chapter-link {
        font-size: 1rem;
        padding: 10px 12px;
    }
    
    .paragraph-link {
        font-size: 0.9rem;
        padding: 6px 10px;
    }
    
    .paragraph-section {
        padding: 20px 15px;
    }
}

/* Scrollbar personalizzata */
.book-index::-webkit-scrollbar,
.book-content::-webkit-scrollbar {
    width: 8px;
}

.book-index::-webkit-scrollbar-track,
.book-content::-webkit-scrollbar-track {
    background: rgba(212, 175, 55, 0.1);
    border-radius: 4px;
}

.book-index::-webkit-scrollbar-thumb,
.book-content::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.5);
    border-radius: 4px;
}

.book-index::-webkit-scrollbar-thumb:hover,
.book-content::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 175, 55, 0.7);
}

/* Accessibilità */
@media (prefers-reduced-motion: reduce) {
    .chapter-content,
    .paragraph-section,
    .chapter-link,
    .paragraph-link,
    .paragraph-image img {
        animation: none;
        transition: none;
    }
}

/* Print styles */
@media print {
    .regolamento-container {
        background: none;
        box-shadow: none;
    }
    
    .book-container {
        box-shadow: none;
        border: 1px solid #000;
        grid-template-columns: 1fr;
    }
    
    .book-container::before {
        display: none;
    }
    
    .book-index {
        display: none;
    }
    
    .chapter-content {
        display: block !important;
        page-break-before: always;
    }
    
    .welcome-content {
        display: none !important;
    }
    
    .paragraph-section {
        break-inside: avoid;
        margin-bottom: 20px;
    }
    
    .chapter-title {
        break-after: avoid;
    }
    
    .paragraph-title {
        break-after: avoid;
    }
}