/* Hero-секция категории */
.category-hero {
    margin-bottom: 40px;
    text-align: center;
}
.hero-content {
    width: 100%;
}
.hero-title {
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--hero-left-h1);
    margin-bottom: 12px;
    line-height: 1.2;
    text-align: center;
}
.hero-title .accent-text {
    color: var(--accent);
}
.hero-subtitle {
    font-size: 1.1rem;
    color: var(--hero-left-p);
    margin-bottom: 30px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

/* Генератор (градиентная кнопка) */
.generator-card {
    background: var(--card-bg);
    border-radius: 28px;
    padding: 30px;
    border: 1px solid var(--border-light);
    box-shadow: 0 12px 30px var(--shadow-heavy);
    margin-bottom: 20px;
    text-align: left;
}
.form-group {
    margin-bottom: 20px;
}
.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-size: 1rem;
}
.prompt-input {
    width: 100%;
    min-height: 130px;
    background: var(--input-bg);
    border: 2px solid var(--input-border);
    border-radius: 16px;
    padding: 16px;
    color: var(--text-primary);
    font-size: 1rem;
    resize: vertical;
    transition: all 0.3s;
    font-family: inherit;
}
.prompt-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--shadow-glow);
}
.input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.char-counter { font-weight: 600; }
.char-counter.warning { color: #e53e3e; }
.slider-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
}
.length-slider {
    flex: 1;
    height: 8px;
    border-radius: 5px;
    background: var(--input-border);
    outline: none;
    -webkit-appearance: none;
}
.length-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px; height: 22px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
}
.length-value {
    font-weight: 600;
    color: var(--accent);
    min-width: 80px;
    text-align: center;
}
.generate-btn {
    width: 100%;
    background: linear-gradient(135deg, #D63384, #E91E63);
    color: white;
    border: none;
    padding: 18px;
    border-radius: 16px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
    transition: 0.3s;
    box-shadow: 0 8px 25px var(--shadow-glow);
}
.generate-btn:hover {
    background: linear-gradient(135deg, #C12A74, #D63384);
}
.cta-features {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
    color: var(--text-secondary);
}
.cta-feature { display: flex; align-items: center; gap: 8px; }

/* Секция с рассказами */
.stories-section {
    margin-top: 40px;
}
.section-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    color: var(--hero-left-h1);
    margin-bottom: 8px;
}
.section-subtitle {
    text-align: center;
    font-size: 1rem;
    color: var(--hero-left-p);
    margin-bottom: 25px;
}

/* Сортировка */
.sorting-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}
.sort-options {
    display: flex;
    gap: 10px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 6px;
    border: 1px solid var(--glass-border);
}
.sort-btn {
    padding: 10px 18px;
    border-radius: 14px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    transition: 0.2s;
}
.sort-btn.active {
    background: linear-gradient(135deg, #D63384, #E91E63);
    color: white;
    box-shadow: 0 4px 12px rgba(214, 51, 132, 0.3);
}
.all-categories-btn {
    background: linear-gradient(135deg, #D63384, #E91E63);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 14px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(214, 51, 132, 0.3);
}
.all-categories-btn:hover {
    background: linear-gradient(135deg, #C12A74, #D63384);
}

/* Список рассказов */
.stories-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.story-row {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 20px;
    border: 1px solid var(--border-light);
    box-shadow: 0 8px 20px rgba(214, 51, 132, 0.06);
    display: flex;
    align-items: flex-start;
    gap: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
}
.story-row:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(214, 51, 132, 0.1);
    border-color: var(--accent);
}
.story-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: linear-gradient(135deg, #D63384, #E91E63);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    flex-shrink: 0;
}
.story-content {
    flex: 1;
    min-width: 0;
}
.story-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.3;
}
.story-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
}
.story-meta i {
    margin-right: 4px;
    color: var(--accent);
}
.story-excerpt {
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 8px;
    font-size: 0.9rem;
}
.story-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.story-category {
    background: rgba(214, 51, 132, 0.08);
    color: var(--accent);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
}
.story-category:hover {
    background: rgba(214, 51, 132, 0.2);
}

/* Блок действий (растянутая кнопка + аудио под ней) */
.story-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
    width: 100%;
    max-width: 200px;
}
@media (max-width: 768px) {
    .story-actions {
        max-width: 100%;
    }
}
.story-read {
    background: linear-gradient(135deg, #D63384, #E91E63);
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s;
    width: 100%;
    box-shadow: 0 4px 12px rgba(214, 51, 132, 0.3);
}
.story-read:hover {
    background: linear-gradient(135deg, #C12A74, #D63384);
}

/* Аудиоплеер (растянутый под кнопкой) */
.audio-player-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(214, 51, 132, 0.05);
    border-radius: 12px;
    padding: 8px 12px;
    border: 1px solid rgba(214, 51, 132, 0.1);
    width: 100%;
}
.play-btn-sm {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
    flex-shrink: 0;
}
.play-btn-sm:hover { background: var(--accent-hover); }
.audio-progress {
    flex: 1;
    height: 4px;
    background: rgba(214, 51, 132, 0.1);
    border-radius: 2px;
    overflow: hidden;
    cursor: pointer;
    min-width: 50px;
}
.audio-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.1s linear;
}
.audio-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
    min-width: 70px;
    text-align: right;
    flex-shrink: 0;
}
.volume-control {
    display: flex;
    align-items: center;
    position: relative;
    flex-shrink: 0;
}
.volume-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.volume-popup-wrapper {
    position: absolute;
    bottom: calc(100% + 10px);
    right: -10px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 10;
}
.volume-control:hover .volume-popup-wrapper {
    opacity: 1;
    visibility: visible;
}
.volume-popup {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border: 1px solid var(--border-light);
}
.volume-slider {
    width: 80px;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}
.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
}

/* Адаптив */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    .story-row {
        flex-direction: column;
        gap: 12px;
        padding: 16px;
    }
    .story-icon {
        align-self: flex-start;
    }
    .story-actions {
        width: 100%;
        max-width: 100%;
    }
}

.story-title {
    cursor: pointer;
}
.story-title:hover {
    text-decoration: underline;
}

.story-title {
    cursor: pointer;
    transition: text-decoration 0.2s;
}
.story-title:hover {
    text-decoration: underline;
}