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

body {
    font-family: 'Georgia', serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.story-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 800px;
    height: 80vh;
    min-height: 500px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.story-header {
    background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.story-title {
    font-size: 1.8em;
    font-weight: bold;
    margin-bottom: 5px;
}

.page-indicator {
    font-size: 0.9em;
    opacity: 0.9;
}

.story-content {
    flex: 1;
    padding: 30px;
    overflow: hidden;
    line-height: 1.6;
    font-size: 1.1em;
    color: #333;
    position: relative;
    display: flex;
    flex-direction: column;
}

.story-text {
    white-space: pre-wrap;
    word-wrap: break-word;
    animation: fadeIn 0.5s ease-in-out;
    flex: 1;
    overflow: hidden;
    cursor: text;
    position: relative;
}

.word {
    display: inline;
    padding: 1px 2px;
    border-radius: 3px;
    transition: background-color 0.2s ease;
}

.word:hover {
    background-color: rgba(102, 126, 234, 0.1);
}

.word.highlighted {
    background-color: rgba(102, 126, 234, 0.3);
    box-shadow: 0 0 0 1px rgba(102, 126, 234, 0.5);
}

.reading-cursor {
    position: absolute;
    width: 2px;
    height: 1.2em;
    background-color: #4facfe;
    animation: blink 1s infinite;
    pointer-events: none;
    z-index: 10;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.story-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: rgba(0, 0, 0, 0.05);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.control-btn {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    min-width: 100px;
}

.control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.control-btn:active {
    transform: translateY(0);
}

.control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.page-input-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-input {
    width: 60px;
    padding: 8px;
    border: 2px solid #ddd;
    border-radius: 10px;
    text-align: center;
    font-size: 1em;
}

.page-input:focus {
    outline: none;
    border-color: #667eea;
}

.file-upload-section {
    text-align: center;
    padding: 20px;
    border: 2px dashed #ccc;
    border-radius: 10px;
    margin: 20px;
    background: rgba(255, 255, 255, 0.8);
}

.file-input {
    margin: 10px 0;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white;
}

.load-btn {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 1em;
    margin: 10px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .story-container {
        height: 90vh;
        border-radius: 15px;
    }

    .story-header {
        padding: 15px;
    }

    .story-title {
        font-size: 1.5em;
    }

    .story-content {
        padding: 20px;
        font-size: 1em;
    }

    .story-controls {
        padding: 15px 20px;
        flex-wrap: wrap;
        gap: 10px;
        justify-content: center;
    }

    .control-btn {
        padding: 10px 20px;
        font-size: 0.9em;
        min-width: 80px;
    }

    .page-input-container {
        order: 3;
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .story-content {
        padding: 15px;
        font-size: 0.95em;
    }

    .story-title {
        font-size: 1.3em;
    }
}

.hidden {
    display: none;
} 