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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.tagline {
    font-size: 1.2rem;
    opacity: 0.95;
}

.card {
    background: white;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.card h2 {
    margin-bottom: 20px;
    color: #667eea;
}

/* Auth Section */
.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
}

.user-name {
    font-weight: 600;
    font-size: 1.1rem;
}

.user-email {
    color: #666;
    font-size: 0.9rem;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

#generate-btn {
    width: 100%;
    justify-content: center;
    font-size: 1.05rem;
    padding: 14px 20px;
    letter-spacing: 0.2px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.rss-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.rss-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.inline-player {
    margin-top: 15px;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #f9f9ff;
}

.inline-player-title {
    font-weight: 700;
    margin-bottom: 8px;
}

.episode-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.chip {
    padding: 6px 10px;
    border-radius: 16px;
    border: 1px solid #ddd;
    background: #fff;
    cursor: pointer;
    font-size: 0.9rem;
}

.chip-active {
    border-color: #667eea;
    color: #667eea;
    background: #eef0ff;
}

.btn-large {
    width: 100%;
    padding: 16px;
    font-size: 1.1rem;
    margin-top: 20px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Form */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

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

/* Topics Grid */
.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.topic-checkbox {
    display: flex;
    align-items: center;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.topic-checkbox:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.topic-checkbox input {
    margin-right: 8px;
}

.topic-checkbox input:checked+span {
    font-weight: 600;
    color: #667eea;
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Error Message */
.error-message {
    background: #fee;
    color: #c33;
    padding: 12px;
    border-radius: 8px;
    margin-top: 15px;
    border-left: 4px solid #c33;
}

/* Audio Player */
.player-container {
    text-align: center;
}

#audio-player {
    width: 100%;
    margin-bottom: 20px;
    border-radius: 8px;
}

.player-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* Podcasts List */
.podcasts-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.podcast-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    background: #f9f9f9;
}

.podcast-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.podcast-date {
    font-size: 0.9rem;
    color: #666;
}

.podcast-status {
    font-size: 0.8rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

.status-completed {
    background: #e6fffa;
    color: #047481;
}

.status-processing {
    background: #ebf8ff;
    color: #2b6cb0;
}

.status-error {
    background: #fff5f5;
    color: #c53030;
}

.podcast-topics {
    font-weight: 600;
    margin-bottom: 10px;
}

.podcast-audio {
    width: 100%;
    margin-top: 10px;
}

.podcast-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    font-size: 0.9rem;
}

.podcast-actions a {
    color: #667eea;
    text-decoration: none;
}

.podcast-actions a:hover {
    text-decoration: underline;
}

.inline-spinner {
    width: 12px;
    height: 12px;
    border-width: 2px;
    border-color: #2b6cb0;
    border-top-color: transparent;
    margin-left: 5px;
    vertical-align: middle;
}


/* Responsive */
@media (max-width: 600px) {
    header h1 {
        font-size: 2.5rem;
    }

    .topics-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }

    .user-info {
        flex-direction: column;
        text-align: center;
    }

    .footer-topics a {
        display: inline-block;
        margin-bottom: 5px;
    }
}

/* Footer */
footer {
    margin-top: 50px;
    padding: 40px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px 16px 0 0;
    color: white;
    text-align: center;
}

.footer-content p {
    margin-bottom: 20px;
    font-weight: 600;
}

.footer-topics {
    font-size: 0.9rem;
    opacity: 0.8;
}

.footer-topics span {
    display: block;
    margin-bottom: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-topics a {
    color: white;
    text-decoration: none;
    margin: 0 5px;
    transition: opacity 0.3s;
}

.footer-topics a:hover {
    opacity: 1;
    text-decoration: underline;
}

/* Content Wrapper */
.content-wrapper {
    min-height: 60vh;
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
