html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.story-content {
    font-family: 'Arial, sans-serif';
    line-height: 1.6;
    font-size: 16px;
    color: #333;
}

.story-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 20px auto;
    border: 2px solid #ddd;
    border-radius: 8px;
}

/* TTS Controls Styling */
.tts-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.tts-controls .btn {
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.tts-controls .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.tts-controls .btn:disabled {
    opacity: 0.6;
    transform: none;
    box-shadow: none;
}

.tts-controls .form-select {
    border-radius: 20px;
    border: 1px solid #dee2e6;
    padding: 6px 12px;
    font-size: 0.875rem;
    min-width: 150px;
}

/* Speed Controls Styling */
.tts-controls .d-flex.align-items-center {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 4px 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.tts-controls .form-range {
    height: 6px;
    border-radius: 3px;
    background: #e9ecef;
    margin: 0;
}

.tts-controls .form-range::-webkit-slider-thumb {
    appearance: none;
    height: 18px;
    width: 18px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.tts-controls .form-range::-moz-range-thumb {
    height: 18px;
    width: 18px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.tts-controls #speedValue {
    font-weight: 600;
    font-size: 0.875rem;
    min-width: 30px;
    text-align: center;
}

/* Story Display Styling */
.story-metadata {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    border-left: 4px solid #007bff;
}

.story-text {
    font-size: 18px;
    line-height: 1.8;
    color: #2c3e50;
}

.story-text p {
    margin-bottom: 1.5rem;
    text-align: justify;
}

/* Progress Info Styling */
.progress-info {
    font-weight: 500;
    color: #6c757d;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tts-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .tts-controls .btn-group {
        display: flex;
        justify-content: center;
    }
    
    .tts-controls .form-select {
        min-width: auto;
    }
    
    .card-header .d-flex {
        flex-direction: column;
        gap: 15px;
    }
    
    .card-header h3 {
        text-align: center;
    }
}

/* Animation for play button */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.tts-controls .btn:not(:disabled):hover {
    animation: pulse 0.3s ease-in-out;
}

.nav-link.active {
    font-weight: bold;
    color: #007bff !important;
    border-bottom: 2px solid #007bff;
    background-color: #f0f8ff;
}

/* TTS Generation Modal Controls */
.modal .form-range {
    height: 6px;
    border-radius: 3px;
    background: #e9ecef;
    margin: 0;
}

.modal .form-range::-webkit-slider-thumb {
    appearance: none;
    height: 18px;
    width: 18px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.modal .form-range::-moz-range-thumb {
    height: 18px;
    width: 18px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.modal .d-flex.align-items-center {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 8px 12px;
    border: 1px solid #dee2e6;
}

.modal .badge {
    font-size: 0.75rem;
    padding: 4px 8px;
}

/* Word Highlighting for TTS */
.word-highlight {
    display: inline;
    transition: all 0.3s ease-in-out;
    border-radius: 4px;
    padding: 2px 1px;
    margin: 0 1px;
    cursor: default;
}

.word-highlight.active {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #2c3e50;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(255, 215, 0, 0.3);
    transform: scale(1.02);
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
    animation: wordPulse 0.8s ease-in-out;
}

.word-highlight:hover {
    background: rgba(255, 215, 0, 0.15);
    border-radius: 4px;
    padding: 2px 1px;
}

@keyframes wordPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 2px 6px rgba(255, 215, 0, 0.3);
    }
    50% {
        transform: scale(1.03);
        box-shadow: 0 3px 12px rgba(255, 215, 0, 0.5);
    }
    100% {
        transform: scale(1.02);
        box-shadow: 0 2px 6px rgba(255, 215, 0, 0.3);
    }
}

/* Story text styling for better readability */
.story-text {
    line-height: 1.8;
    font-size: 1.1rem;
    color: #2c3e50;
}

.story-text p {
    margin-bottom: 1rem;
}

/* Ensure images don't interfere with word highlighting */
.story-image {
    display: block;
    margin: 1.5rem auto;
}