/* Stili generali */
:root {
    /* Tema chiaro (default) */
    --primary-color: #2980b9;    /* Blu per il primo lettore */
    --secondary-color: #27ae60;  /* Verde per il secondo lettore */
    --accent-color: #e74c3c;
    --text-color: #333333;
    --background-color: #ffffff;
    --card-background: #ffffff;
    --border-radius: 4px;
    --shadow: 0 2px 4px rgba(0,0,0,0.1);
    --border-color: #e0e0e0;
}

[data-theme="dark"] {
    --primary-color: #1a5c8f;
    --secondary-color: #2573a7;
    --background-color: #1a1a1a;
    --text-color: #ffffff;
    --border-color: #404040;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* Animazioni */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

/* Header */
.header {
    padding: 1.5rem 0 2.5rem 0;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    margin-bottom: 2rem;
}

.main-title {
    font-size: 2.5rem;
    font-weight: 600;
    margin: 1rem 0 0.5rem 0;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 1rem;
}

.author {
    font-size: 1rem;
    opacity: 0.8;
    margin-bottom: 1.5rem;
}

.author-link {
    color: white;
    text-decoration: underline;
}

/* Content */
.content-wrapper {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

.info-card {
    background: var(--card-background);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}

/* Steps */
.steps-container {
    margin: 2rem 0;
}

.step {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    padding: 1rem;
    background: rgba(52, 152, 219, 0.1);
    border-radius: var(--border-radius);
}

.step-number {
    background: var(--secondary-color);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    font-weight: 600;
}

/* Alert */
.alert-custom {
    display: flex;
    align-items: flex-start;
    background: rgba(231, 76, 60, 0.1);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin: 2rem 0;
}

.alert-icon {
    font-size: 1.5rem;
    margin-right: 1rem;
}

/* Buttons */
.start-button {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
    width: 100%;
    margin-top: 2rem;
}

.start-button:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.button-icon {
    margin-left: 1rem;
}

/* App principale */
.app-header {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: var(--card-background);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.back-button {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    color: var(--primary-color);
}

.readers-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.reader-controls {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    margin: 2rem auto;
    max-width: 1200px;
    padding: 0 1rem;
}

.reader-section {
    flex: 1;
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    min-width: 300px;
    transition: transform 0.2s;
}

.reader-section:hover {
    transform: translateY(-2px);
}

.reader-section h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.parameter-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
}

.selector-value {
    flex: 1;
    text-align: center;
    font-size: 1rem;
    padding: 0.25rem;
    min-width: 120px;
}

.selector-arrow {
    cursor: pointer;
    padding: 0.5rem 1rem;
    color: white;
    border-radius: var(--border-radius);
    user-select: none;
    transition: background-color 0.2s;
}

.selector-arrow.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.selector-arrow.disabled:hover {
    background-color: inherit;  /* Mantiene il colore base quando disabilitato */
}

#uno_customrow, #due_customrow {
    display: none;
}

#uno_customrow.visible, #due_customrow.visible {
    display: flex;
    align-items: center;
}

input[type="number"] {
    width: 80px;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
}

label {
    flex: 1;
    font-size: 0.9rem;
    color: #666;
}

/* Sezione testo */
.comparison-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}

.text-section {
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

/* Primo lettore */
.text-section:first-child {
    background: white;
}

/* Secondo lettore - esplicitamente bianco */
.text-section:nth-child(2) {
    background: white !important;  /* Forza il background bianco */
}

/* Header dei lettori con selettori specifici */
#primotitolo .reader-header,
#secondotitolo .reader-header {
    color: white;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    padding: 1rem;
}

#primotitolo .reader-header .reader-title,
#secondotitolo .reader-header .reader-title {
    font-size: 1.8rem;
    margin-bottom: 0.8rem;
    font-weight: bold;
}

#primotitolo .reader-header .reader-params,
#secondotitolo .reader-header .reader-params {
    font-size: 1.4rem;
    opacity: 0.9;
    margin-top: 0.6rem;
    margin-bottom: 0.6rem;
}

#primotitolo .reader-header .reader-speed,
#primotitolo .reader-header .reader-syllables,
#secondotitolo .reader-header .reader-speed,
#secondotitolo .reader-header .reader-syllables {
    font-size: 1.2rem;
    margin-top: 0.5rem;
}

/* Primo lettore - header blu scuro */
#primotitolo .reader-header {
    background: #1a5c8f;
}

/* Secondo lettore - header verde */
#secondotitolo .reader-header {
    background: var(--secondary-color);
}

/* Stili per i parametri nei reader-header */
.reader-params {
    display: block;
    font-size: 1.6rem;
    opacity: 0.9;
    margin-top: 0.8rem;
}

/* Contenuto del testo */
.text-content {
    padding: 1rem;
    overflow-y: auto;
    line-height: 1.8;
    font-size: 1.2rem;
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
    border-top: 1px solid #ddd;
    font-size: 0.9rem;
    opacity: 0.8;
}

.mezzoschermo{
	width:50%;
	float:left;
	border:1px solid black;
	padding:10px;
	min-height:100vh;
}
.top{
	text-align:center;
	margin-bottom:20px;
}

.mezzoschermo{
display:none;	
}
#uno_customrow,#due_customrow{
padding-bottom:10px;	
}

#avvia{
margin-top:20px;	
}

.destra,.sinistra{
cursor:pointer;	
}

#uno_custom, #due_custom{
	width:100px;
	height:30px;
	line-height:30px;
	float:right;
	font-size:24px;
	text-align:right;
}

#primo,#secondo{
	margin:10px;
	height:30px;
	width:100%;
}

.innerheader{
	font-size:1.2em;
	font-weight:bold;
	text-align:center;
	line-height:2em;
}

#footer{
	bottom:0px;
	left:0px;
	position:fixed;
	text-align:justify;
	background-color:lightyellow;
	padding:10px;
}

@media screen and (max-width: 400px) {
	.mezzoschermo{
	height: calc( 50vh - 140px);
	border:1px solid black;
	padding:10px;
}

.top{
	height:80px;
	margin-bottom:20px;
	background-color:lightblue;
}

.mezzoschermo{
	min-height: calc( 50vh - 180px);
	border:1px solid black;
	padding:5px;
	font-size:0.8em;
}

.innerheader{
	font-size:1em;
	font-weight:bold;
	text-align:center;
	line-height:2em;
}

#primo,#secondo{
	margin:10px auto;
	height:30px;
	width:90%;
}

.top{
	text-align:center;
}
h1{
	font-size:1.2em;
	font-weight:bold;
	margin:5px;
}
h2{
	margin:5px;
	font-size:1em;
}
#footer{
	font-size:0.7em;
}
}

.spiegazione {
    max-width: 800px;
    margin: 30px auto;
    padding: 20px;
}

.spiegazione h2, .spiegazione h3 {
    margin-bottom: 20px;
}

.spiegazione ol {
    margin: 20px 0;
    padding-left: 20px;
}

.spiegazione li {
    margin-bottom: 10px;
}

.alert {
    margin: 30px 0;
}

#iniziaApp {
    margin-top: 30px;
}

/* Header con logo */
.main-header {
    width: 100%;
    padding: 0.5rem;
    background-color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1000;
}

.logo-link {
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
}

.logo-image {
    height: 40px;
    width: auto;
    transition: transform 0.2s ease;
}

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

/* Aggiusta il padding del contenuto per il nuovo header */
.container-fluid {
    padding-top: 0;
}

#timer-container {
    margin: 2rem 0;
    padding: 1rem;
    background: var(--primary-color);
    color: white;
    border-radius: var(--border-radius);
    text-align: center;
}

#timer {
    font-size: 1.5rem;
    font-weight: 500;
}

.comparison-container {
    margin-top: 3rem;  /* Aumentato il margine superiore */
    border-top: 2px solid var(--border-color);
    padding-top: 2rem;
}

.text-header {
    background: var(--primary-color);
    color: white;
    padding: 1rem;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    margin-bottom: 0;
}

.text-section {
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: white;
}

.pause-button {
    margin-top: 1rem;
    padding: 0.5rem 2rem;
    font-size: 1.1rem;
    border: none;
    border-radius: var(--border-radius);
    background-color: white;
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.pause-button:hover {
    background-color: #f0f0f0;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0,0,0,0.15);
}

.pause-button.play {
    background-color: var(--primary-color);
    color: white;
}

.pause-button.play:hover {
    background-color: var(--secondary-color);
}

#timer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

/* Stili per il contenitore principale */
#appPrincipale {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Stili per il pulsante di avvio */
#avvia {
    display: block;
    margin: 2rem auto;
    padding: 0.8rem 2rem;
    font-size: 1.1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background-color 0.2s;
}

#avvia:hover {
    background: var(--secondary-color);
}

.parola-corrente {
    display: inline-block;
}

.progress {
    transition: width 0.3s ease-in-out;
}

@media (max-width: 768px) {
    .reader-controls {
        flex-direction: column;
        gap: 1rem;
    }
    
    .reader-section {
        width: 100%;
    }
    
    .comparison-container {
        flex-direction: column;
    }
    
    .text-section {
        width: 100%;
        margin-bottom: 1rem;
    }
    
    .parameter-row {
        flex-wrap: wrap;
    }
}

/* Pulsante per cambiare tema */
.theme-toggle {
    position: fixed;
    top: 1rem;
    right: 1rem;
    padding: 0.5rem;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    cursor: pointer;
}

.reader-header {
    margin-bottom: 1rem;
    padding: 0.5rem;
    background-color: #f8f9fa;
    border-radius: 4px;
    font-size: 1.1rem;
}

.reader-params {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.reader-speed {
    font-size: 0.9rem;
    color: #fff;
}

/* Stili base per le sezioni di testo */
.text-section {
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

/* Stile per la scrollbar */
.text-content::-webkit-scrollbar {
    width: 8px;
}

.text-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.text-content::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.text-content::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* Progress bar container */
.progress-container {
    margin-top: 2rem;
    padding: 1rem;
    background: #1a5c8f;
    border-radius: var(--border-radius);
    color: white;
    width: calc(100% - 2rem);  /* Larghezza totale meno il padding */
    box-sizing: border-box;
    margin-left: auto;
    margin-right: auto;
}

/* Progress bar */
.progress-bar {
    width: 100%;
    height: 20px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 1rem;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.progress {
    width: 0;
    height: 100%;
    transition: width 0.3s ease-in-out;
}

.progress-primo {
    background-color: #3498db;
}

.progress-secondo {
    background-color: var(--secondary-color);
}

/* Animazione del gradiente per le barre */
@keyframes progressAnimation {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.progress {
    background-size: 200% 200%;
    animation: progressAnimation 2s linear infinite;
    background-image: linear-gradient(
        45deg, 
        rgba(255,255,255,0.15) 25%, 
        transparent 25%, 
        transparent 50%, 
        rgba(255,255,255,0.15) 50%, 
        rgba(255,255,255,0.15) 75%, 
        transparent 75%, 
        transparent
    );
    background-size: 20px 20px;
}

/* Etichette delle progress bar */
.progress-label[for="progress_primotesto"] {
    color: var(--primary-color);
}

.progress-label[for="progress_secondotesto"] {
    color: var(--secondary-color);
}

/* Progress bar hover effects */
.progress-bar:hover .progress-primo {
    background-color: #5dade2;
}

.progress-bar:hover .progress-secondo {
    background-color: #2ecc71;
}

/* Box del secondo lettore */
.text-section:nth-child(2) {
    background-color: var(--secondary-color);
}

.text-section:nth-child(2) .text-content {
    background: white;
    margin-top: 0;
}

/* Rimuovi eventuali margini extra */
.progress-container > :last-child {
    margin-bottom: 0;
}

/* Pulsanti del primo lettore (blu) */
.reader-section:first-child .selector-arrow {
    background: var(--primary-color);
}

.reader-section:first-child .selector-arrow:hover {
    background: #3498db;  /* Blu più chiaro per hover */
}

/* Pulsanti del secondo lettore (verde) */
.reader-section:nth-child(2) .selector-arrow {
    background: var(--secondary-color);
}

.reader-section:nth-child(2) .selector-arrow:hover {
    background: #2ecc71;  /* Verde più chiaro per hover */
}

/* Disabilita gli stili generici precedenti per i selector-arrow */
.selector-arrow {
    cursor: pointer;
    padding: 0.5rem 1rem;
    color: white;
    border-radius: var(--border-radius);
    user-select: none;
    transition: background-color 0.2s;
}

.selector-arrow.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.selector-arrow.disabled:hover {
    background-color: inherit;  /* Mantiene il colore base quando disabilitato */
}

/* Secondo lettore - text content */
.text-section:nth-child(2) .text-content {
    margin-top: 0;
}

/* Text header specifici */
.text-header-blue {
    background: white;
    font-size: 1.2rem;
}

.text-header-green {
    background: #d4efdf;
    margin-top: 0;
    font-size: 1.2rem;
}

.form-select {
    flex: 1;
    padding: 0.7rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background-color: white;
    min-width: 200px;
    font-size: 1.3rem;
    color: #333;
    transition: all 0.3s ease;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
}

.form-select:hover:not(:disabled) {
    border-color: #007bff;
}

.form-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.25);
}

.form-select:disabled {
    background-color: #f8f9fa;
    cursor: not-allowed;
    opacity: 0.7;
}

.confirm-button {
    padding: 0.7rem 1.2rem;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

.confirm-button:hover:not(:disabled) {
    background-color: #0056b3;
    transform: translateY(-1px);
}

.confirm-button:active:not(:disabled) {
    transform: translateY(0);
}

.confirm-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
}

.reset-button {
    padding: 0.7rem 1.2rem;
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
}

.reset-button:hover {
    background-color: #c82333;
}

/* Aumenta dimensione dei testi nella sezione di confronto */
.text-content {
    font-size: 1.5rem;
    line-height: 1.8;
}

/* Aumenta dimensione dei bottoni */
.confirm-button,
.reset-button {
    font-size: 1.2rem;
    padding: 0.7rem 1.2rem;
}

/* Aumenta dimensione dei controlli */
.parameter-row label {
    font-size: 1.3rem;
}

.parameter-row input[type="number"] {
    font-size: 1.3rem;
    padding: 0.7rem;
}

.reader-header {
    font-size: 1.4rem;
}

/* Rimuovo lo stile generico della sillaba-corrente */
.sillaba-corrente {
    transition: background-color 0.3s ease;
}

/* Stile specifico per il primo brano */
#primotesto .sillaba-corrente {
    background-color: #1a5c8f00;
}

/* Stile specifico per il secondo brano */
#secondotesto .sillaba-corrente {
    background-color: #27ae5f00;
}

.parola-corrente {
    display: inline-block;
}
