:root {
    --primary: #42b883;
    --primary-dark: #3eb482;
    --dark: #1a1a1a;
    --light: #f5f5f5;
    --highlight: #ffeb3b;
    --zebra-even: #DDD;
    --zebra-odd: #BBB;
    --active-bg: #fff9c4;
    --secondary: #666;
    --secondary-dark: #555;
    --background: #CCC;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    color: var(--dark);
}

.app-container {
    background: var(--background);
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 800px;
}

h1 {
    margin-bottom: 2rem;
    color: var(--dark);
    text-align: center;
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 10px;
}

/* --- Book Table Styles --- */
.table-wrapper {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 2rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background-color: #eee;
    text-align: left;
    padding: 12px;
    font-weight: 600;
}

td {
    padding: 12px;
    border-bottom: 1px solid #eee;
}

tr:hover {
    background-color: #f9f9f9;
    transition: all 0.2s;
}

.text-cell {
    color: #333;
}

.clickable-cell {
    color: #3f51b5;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.clickable-cell:hover {
    background-color: #e3f2fd;
    color: #000;
    text-decoration: underline;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-secondary {
    background-color: var(--secondary);
    color: white;
}

.btn-secondary:hover {
    background-color: var(--secondary-dark);
}

/* --- Reader Styles --- */
.reading-area {
    font-size: 20px;
    height: auto;
    min-height: 60px;
    margin-bottom: 2rem;
    color: var(--dark);
    line-height: 1.6;
    text-align: center;
    word-wrap: break-word;
    display: flex;
}

.word {
    display: inline-block;
    padding: 0 2px;
    transition: all 0.2s ease;
    border-radius: 4px;
    margin: 0 2px;
    width: 10em;

}

.word.active {
    /*    color: #333;*/
    transform: scale(1.2);
    /* text-shadow: 0 0 10px rgba(66, 184, 131, 0.6); */
    /*    background-color: #fff;*/
}

/* Zebra Striping Logic */
.zebra-row .word:nth-child(even) {
    background-color: var(--zebra-even);
}

.zebra-row .word:nth-child(odd) {
    background-color: var(--zebra-odd);
}

/* --- Controls & Stats --- */
.controls-area {
    border-top: 1px solid #eee;
    padding-top: 2rem;
    margin-top: 2rem;
}

.controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.input-group {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f0f0f0;
    padding: 5px 10px;
    border-radius: 6px;
}

input[type="number"] {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    width: 70px;
    text-align: center;
}

.stats {
    font-size: 14px;
    color: var(--secondary);
    display: flex;
    justify-content: space-between;
    background: #f9f9f9;
    padding: 10px;
    border-radius: 6px;
}

.loading-state {
    text-align: center;
    padding: 40px;
    font-size: 1.2rem;
    color: var(--secondary);
}

.error-state {
    text-align: center;
    padding: 20px;
    color: red;
}

.clickable {
    cursor: pointer;
}