@import url('https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900&display=swap');
body {
    font-family: 'Lato', sans-serif;
    line-height: 1.6;
    margin: 0;
    background: #fbf4de;
    color: #333;
    transition: background 0.3s, color 0.3s;
}

h1 {
    margin: 0;
    font-size: 1.8em;
}

#content {
    margin: 20px auto;
    min-height: 300px;
    transition: background 0.3s, color 0.3s;
    max-width: 800px;
    padding: 0 40px;
}

button {
    padding: 10px 20px;
    margin: 5px;
    background-color: #c982ed;
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 5px;
}

button:hover {
    background-color: #b663e0;
}

button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.upload-btn {
    background-color: #1b60d0;
}

.upload-btn:hover {
    background-color: #051289;
}

.controls {
    text-align: center;
    margin: 10px 0;
    position: relative;
    z-index: 1000;
}

.nav-btn {
    padding: 12px 25px; 
    font-size: 15px;    
    border-radius: 8px; 
    transition: background-color 0.3s ease;
}

.header {
    display: flex;
    justify-content: space-between; 
    align-items: center;
    padding: 10px 20px;
    background-color: #9dc5e2;
    border-bottom: 1px solid #ddd;
}

.header h1 {
    margin: 0;
}

.header button {
    padding: 0;
    background: none;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 28px;
    min-width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.header button:hover {
    background: none;
    transform: scale(1.1);
}

.dark-mode {
    background-color: #121212;
    color: #e8e8e8;
}

/*.dark-mode #content {
    background-color: #1e1e1e;
    color: #f9f9f9;
}*/

.dark-mode button {
    background-color: #666;
    color: #f9f9f9;
}

.dark-mode button:hover {
    background-color: #555;
}

.dark-mode .header {
    background-color: #1e1e1e;
}

.dark-mode .header button {
    background: none;
    color: #e8e8e8;
}

.dark-mode .header button:hover {
    background: none;
    transform: scale(1.1);
}

.intro {
    text-align: center;
    margin: 40px auto;
    max-width: 600px;
    font-size: 1.1em;
    color: #555;
}

.intro h2 {
    font-size: 1.8em;
    margin-bottom: 10px;
    color: #333;
}

.dark-mode .intro {
    color: #e8e8e8;
}

.dark-mode .intro h2 {
    color: #e8e8e8;
}

.home-link {
    text-decoration: none; 
    color: #333; 
    transition: color 0.3s ease; 
}

.home-link:hover {
    color: #ffffff; 
}

.dark-mode .home-link:hover {
    color: #ffffff; 
}

.dark-mode h1,
.dark-mode .home-link {
    color: #e8e8e8;
}

.upload-form {
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-form input[type="file"] {
    margin-bottom: 10px; 
}

.upload-form button {
    margin-top: 5px; 
}

.floating-nav {
    position: fixed;
    right: 15px;
    bottom: 15px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.floating-btn {
    width: 40px;
    height: 40px;
    background: none !important;
    border: none !important;
    outline: none !important;
    cursor: pointer;
    font-size: 24px;
    color: rgba(201, 130, 237, 0.7);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    box-shadow: none !important;
}

.floating-btn:hover {
    color: rgba(201, 130, 237, 1);
    transform: scale(1.1);
    text-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
    background: none !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.floating-btn:focus {
    background: none !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.floating-btn:active {
    background: none !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.chapter-dropdown {
    position: relative;
    display: inline-block;
}

.chapter-selector {
    cursor: pointer;
    padding: 8px 12px;
    background-color: #f0f0f0;
    border-radius: 5px;
    transition: background-color 0.2s ease;
    user-select: none;
}

.chapter-selector:hover {
    background-color: #e0e0e0;
}

.chapter-dropdown-content {
    position: absolute;
    top: calc(100% + 5px);
    left: 50%;
    transform: translateX(-50%);
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    min-width: 150px;
    max-height: 200px;
    overflow-y: auto;
    display: none;
}

.chapter-dropdown-content.show {
    display: block;
}

.chapter-dropdown-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
    transition: background-color 0.2s ease;
}

.chapter-dropdown-item:last-child {
    border-bottom: none;
}

.chapter-dropdown-item:hover {
    background-color: #f8f8f8;
}

.chapter-dropdown-item.active {
    background-color: #c982ed;
    color: white;
}

.dark-mode .chapter-selector {
    background-color: #2a2a2a;
    color: #e8e8e8;
}

.dark-mode .chapter-selector:hover {
    background-color: #333;
}

.dark-mode .chapter-dropdown-content {
    background-color: #2a2a2a;
    border-color: #444;
}

.dark-mode .chapter-dropdown-item {
    color: #e8e8e8;
    border-bottom-color: #444;
}

.dark-mode .chapter-dropdown-item:hover {
    background-color: #333;
}

.dark-mode .chapter-dropdown-item.active {
    background-color: #c982ed;
    color: white;
}

@media (max-width: 768px) {
    .header {
        padding: 10px 20px;
    }
    
    .intro {
        margin: 40px 20px;
        padding: 0 10px;
    }
    
    #content {
        margin: 20px 20px;
        padding: 0 10px;
    }
    
    .upload-form {
        padding: 0 20px;
    }
    
    .controls {
        padding: 0 20px;
    }
    
    .floating-nav {
        right: 10px;
        bottom: 10px;
    }
    
    .floating-btn {
        width: 35px;
        height: 35px;
        font-size: 20px;
    }
    
    .chapter-dropdown-content {
        min-width: 140px;
        max-height: 180px;
    }
    
    .nav-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .header h1 {
        font-size: 1.4em;
    }
}
