/* ========================================
   SCREEN-SPECIFIC STYLES
   ======================================== */

/* Stories Grid */
.stories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.story-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px var(--shadow);
}

.story-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px var(--shadow);
    border-color: var(--primary-light);
}

.story-thumbnail {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, var(--surface-elevated), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.story-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.story-thumbnail i {
    font-size: 64px;
    color: var(--text-secondary);
    opacity: 0.3;
}

.story-info {
    padding: 16px;
}

.story-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.story-meta {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.story-meta i {
    width: 14px;
}

/* Character Grid */
.character-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.character-card {
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: all 0.3s ease;
    animation: cardSlideIn 0.6s ease-out both;
}

.character-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px var(--shadow);
    border-color: var(--primary-light);
}

.character-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.character-summary {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

/* Image Grid */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.image-card {
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.3s ease;
    animation: cardSlideIn 0.6s ease-out both;
}

.image-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px var(--shadow);
    border-color: var(--primary-light);
}

.image-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.image-card:hover img {
    transform: scale(1.05);
}

.image-caption {
    padding: 16px;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.4;
}

/* Image Review Card */
.image-review-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
}

.image-container {
    margin-bottom: 16px;
    text-align: center;
}

.page-image {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
}

.image-controls {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.page-text label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.page-text textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--background);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
}

.page-text textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.image-actions {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
}

.prompt-section {
    flex: 1;
}

.prompt-section label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.prompt-input {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--background);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
}

.prompt-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* PDF Section */
.pdf-section {
    text-align: center;
    margin-top: 40px;
}

.pdf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.pdf-card {
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    transition: all 0.3s ease;
    animation: cardSlideIn 0.6s ease-out both;
}

.pdf-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px var(--shadow);
    border-color: var(--primary-light);
}

.pdf-icon {
    font-size: 48px;
    color: var(--primary);
    margin-bottom: 16px;
}

.pdf-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.pdf-meta {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 20px;
}

.pdf-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--gradient-primary);
    color: white;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}

.pdf-download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
    text-decoration: none;
    color: white;
}

/* Generation Messages */
.generation-messages {
    text-align: center;
    margin-top: 20px;
}

.generation-message {
    display: none;
    font-size: 16px;
    color: var(--text-secondary);
    animation: fadeInOut 3s ease-in-out infinite;
}

.generation-message.active {
    display: block;
}
