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

body {
    font-family: 'Noto Sans KR', sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Hero Section */
.hero-section {
    text-align: center;
    padding: 60px 0;
    color: white;
}

.hero-content {
    max-width: 600px;
    margin: 0 auto;
}

.hero-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero-subtitle {
    font-size: 1.3rem;
    font-weight: 500;
    margin-bottom: 15px;
    opacity: 0.9;
}

.hero-description {
    font-size: 1rem;
    opacity: 0.8;
    line-height: 1.6;
}

/* Main Content */
.main-content {
    background: white;
    border-radius: 20px 20px 0 0;
    margin-top: 30px;
    padding: 40px 0;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.1);
}

.section-header {
    text-align: center;
    margin-bottom: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.section-header.with-button {
    flex-direction: column;
    gap: 20px;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
    padding: 20px;
    border-radius: 10px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
}

.section-header.with-button:hover {
    background: #edf2f7;
}

.section-toggle-icon {
    margin-left: 10px;
    transition: transform 0.3s ease;
    color: #667eea;
}

.section-header.expanded .section-toggle-icon {
    transform: rotate(180deg);
}

.knowledge-section-content {
    max-height: 2000px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.knowledge-section-content.collapsed {
    max-height: 0;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #4a5568;
}

.section-header p {
    color: #718096;
    font-size: 1rem;
}

/* Generator Section */
.generator-section {
    background: #f8fafc;
    padding: 40px;
    border-radius: 15px;
    margin: 0 20px 40px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.episode-selector {
    margin-bottom: 30px;
}

.input-label {
    display: block;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.input-label i {
    margin-right: 8px;
    color: #667eea;
}

.episode-input {
    width: 200px;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1.1rem;
    transition: border-color 0.3s ease;
}

.episode-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Theme Input Section */
.theme-input-section {
    margin-bottom: 30px;
}

.theme-input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    margin-bottom: 15px;
}

.theme-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.theme-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.suggestion-label {
    font-size: 0.9rem;
    color: #718096;
    font-weight: 500;
    margin-right: 10px;
}

.suggestion-btn {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #4a5568;
}

.suggestion-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-1px);
}

/* Action Buttons */
.action-buttons {
    text-align: center;
}

.generate-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 16px 40px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.4);
}

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

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

/* Loading Indicator */
.loading-indicator {
    text-align: center;
    padding: 40px;
    color: #718096;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Result Section */
.result-section {
    margin: 0 20px 40px;
    background: #f8fafc;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.result-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    justify-content: center;
}

.word-count {
    background: #e2e8f0;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    color: #4a5568;
}

.download-btn {
    background: #38a169;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.download-btn:hover {
    background: #2f855a;
    transform: translateY(-1px);
}

.script-preview {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 30px;
    margin-top: 20px;
    max-height: 600px;
    overflow-y: auto;
}

.script-preview pre {
    white-space: pre-wrap;
    line-height: 1.8;
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 1rem;
    color: #2d3748;
}

/* Episodes List - Compact Style */
.existing-episodes {
    margin: 0 20px 40px;
}

.episodes-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.episode-card {
    background: white;
    border-radius: 8px;
    padding: 16px 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid #667eea;
}

.episode-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    transform: translateX(5px);
}

.episode-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.episode-number {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-weight: 600;
    font-size: 0.85rem;
    min-width: 40px;
    text-align: center;
}

.episode-details h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: #2d3748;
    line-height: 1.3;
}

.episode-details p {
    color: #718096;
    font-size: 0.85rem;
    line-height: 1.4;
    margin: 0;
}

.episode-actions {
    display: flex;
    gap: 8px;
}

.view-btn, .download-episode-btn {
    padding: 6px 12px;
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.view-btn {
    background: #e2e8f0;
    color: #4a5568;
}

.view-btn:hover {
    background: #cbd5e0;
}

.download-episode-btn {
    background: #667eea;
    color: white;
}

.download-episode-btn:hover {
    background: #5a67d8;
}

/* Knowledge Base */
.knowledge-base-section {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 2px solid #e2e8f0;
}

.knowledge-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.knowledge-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border-left: 4px solid #667eea;
    overflow: hidden;
}

.knowledge-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

.knowledge-header {
    padding: 16px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.2s ease;
}

.knowledge-header:hover {
    background: #f8fafc;
}

.knowledge-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.knowledge-header-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.knowledge-category {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.75rem;
    align-self: flex-start;
}

.knowledge-title {
    font-size: 1rem;
    font-weight: 600;
    color: #2d3748;
    margin: 0;
    line-height: 1.3;
}

.knowledge-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.knowledge-quick-toggle {
    background: transparent;
    border: 2px solid #e2e8f0;
    color: #4a5568;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.knowledge-quick-toggle:hover {
    border-color: #667eea;
}

.knowledge-quick-toggle.active {
    background: #48bb78;
    color: white;
    border-color: #48bb78;
}

.knowledge-quick-toggle.inactive {
    background: #fed7d7;
    color: #742a2a;
    border-color: #feb2b2;
}

.expand-icon {
    transition: transform 0.3s ease;
    color: #667eea;
    font-size: 1.2rem;
}

.knowledge-card.expanded .expand-icon {
    transform: rotate(180deg);
}

.knowledge-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.knowledge-card.expanded .knowledge-content {
    max-height: 1000px;
}

.knowledge-body {
    padding: 20px;
}

.knowledge-description {
    color: #4a5568;
    line-height: 1.6;
    margin-bottom: 15px;
}

.knowledge-insights {
    margin-top: 15px;
}

.knowledge-insights h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 8px;
}

.insight-item {
    background: #f8fafc;
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 0.85rem;
    color: #4a5568;
    border-left: 3px solid #667eea;
}

.knowledge-actions {
    display: flex;
    gap: 8px;
    margin-top: 15px;
    flex-wrap: wrap;
}

/* Enhanced Knowledge Form Styles */
.form-description {
    color: #718096;
    font-size: 0.9rem;
    margin-bottom: 20px;
    line-height: 1.5;
}

.input-methods {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.input-method-btn {
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    color: #4a5568;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-method-btn:hover {
    border-color: #667eea;
}

.input-method-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.input-method-content {
    margin-bottom: 20px;
}

.file-input {
    display: none;
}

.file-upload-area {
    border: 2px dashed #cbd5e0;
    border-radius: 10px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8fafc;
}

.file-upload-area:hover {
    border-color: #667eea;
    background: #eef2ff;
}

.file-upload-area i {
    font-size: 2rem;
    color: #667eea;
    margin-bottom: 10px;
}

.file-upload-area p {
    margin: 10px 0 5px;
    font-weight: 500;
    color: #4a5568;
}

.file-upload-area small {
    color: #718096;
}

.analysis-preview {
    background: #f0fff4;
    border: 2px solid #9ae6b4;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
}

.analysis-preview h4 {
    color: #276749;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.preview-item {
    display: flex;
    margin-bottom: 10px;
    align-items: flex-start;
    gap: 10px;
}

.preview-item label {
    font-weight: 600;
    color: #276749;
    min-width: 80px;
}

.preview-item span {
    color: #22543d;
}

.preview-item ul {
    margin: 0;
    padding-left: 20px;
    color: #22543d;
}

.analyze-btn {
    background: linear-gradient(135deg, #9f7aea 0%, #805ad5 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.analyze-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(159, 122, 234, 0.3);
}

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

/* Modal for viewing episodes */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 2% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e2e8f0;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2d3748;
}

.close {
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    color: #718096;
    transition: color 0.2s ease;
}

.close:hover {
    color: #2d3748;
}

.modal-body {
    line-height: 1.8;
    color: #4a5568;
    white-space: pre-wrap;
}

/* Knowledge Management Styles */
.add-knowledge-btn {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.add-knowledge-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(72, 187, 120, 0.3);
}

.btn-text {
    display: inline;
}

.add-knowledge-form {
    background: #f8fafc;
    border-radius: 12px;
    padding: 30px;
    margin: 20px 0;
    border: 2px solid #e2e8f0;
}

.add-knowledge-form h3 {
    color: #2d3748;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

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

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

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    font-family: 'Noto Sans KR', sans-serif;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.save-btn {
    background: #48bb78;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.save-btn:hover {
    background: #38a169;
}

.cancel-btn {
    background: #e2e8f0;
    color: #4a5568;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cancel-btn:hover {
    background: #cbd5e0;
}

.knowledge-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0;
    padding: 15px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.filter-controls {
    display: flex;
    gap: 10px;
}

.filter-btn {
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    color: #4a5568;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.filter-btn:hover {
    border-color: #667eea;
}

.filter-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.knowledge-stats {
    font-size: 0.9rem;
    color: #718096;
    font-weight: 500;
}

/* Enhanced Knowledge Cards */
.knowledge-card {
    position: relative;
    transition: all 0.3s ease;
}

.knowledge-card.inactive {
    opacity: 0.6;
    background: #f7fafc;
    border-left-color: #cbd5e0;
}

.knowledge-card.inactive .knowledge-category {
    background: #cbd5e0;
}

.knowledge-status {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    gap: 8px;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-active {
    background: #c6f6d5;
    color: #22543d;
}

.status-inactive {
    background: #fed7d7;
    color: #742a2a;
}

.knowledge-actions {
    display: flex;
    gap: 8px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.toggle-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 5px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toggle-btn:hover {
    background: #5a67d8;
}

.toggle-btn.deactivate {
    background: #f56565;
}

.toggle-btn.deactivate:hover {
    background: #e53e3e;
}

.delete-btn {
    background: #e53e3e;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 5px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.delete-btn:hover {
    background: #c53030;
}

/* Responsive Updates */
@media (max-width: 768px) {
    .knowledge-controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .filter-controls {
        justify-content: center;
    }
    
    .add-knowledge-btn {
        margin-left: 0;
        margin-top: 10px;
        width: 100%;
    }
    
    .section-header {
        flex-direction: column;
        text-align: center;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .knowledge-actions {
        justify-content: center;
    }
    
    .input-methods {
        flex-direction: column;
    }
    
    .knowledge-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .knowledge-toggle {
        align-self: flex-end;
    }
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px 20px;
    color: white;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Mobile First - 768px and below */
@media (max-width: 768px) {
    .container {
        padding: 0 10px;
    }
    
    /* Hero Section Mobile */
    .hero-section {
        padding: 40px 0;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-description {
        font-size: 0.9rem;
    }
    
    /* Generator Section Mobile */
    .generator-section, 
    .result-section {
        margin: 0 0 20px;
        padding: 20px 15px;
        border-radius: 10px;
    }
    
    .existing-episodes {
        margin: 0 0 20px;
    }
    
    /* Section Headers Mobile */
    .section-header h2 {
        font-size: 1.25rem;
        margin-bottom: 6px;
        line-height: 1.4;
    }
    
    .section-header p {
        font-size: 0.9rem;
        line-height: 1.4;
    }
    
    /* Episode Input Mobile */
    .episode-selector {
        margin-bottom: 20px;
    }
    
    .episode-input {
        width: 100%;
        padding: 15px;
        font-size: 1rem;
    }
    
    /* Theme Input Mobile */
    .theme-suggestions {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        margin-top: 10px;
    }
    
    .suggestion-label {
        grid-column: 1 / -1;
        text-align: center;
        margin-bottom: 5px;
    }
    
    .suggestion-btn {
        font-size: 0.8rem;
        padding: 8px 12px;
        text-align: center;
    }
    
    /* Episode Cards Mobile - Stack Vertically */
    .episode-card {
        flex-direction: column;
        align-items: stretch;
        padding: 15px;
        gap: 12px;
    }
    
    .episode-info {
        width: 100%;
    }
    
    .episode-number {
        align-self: flex-start;
    }
    
    .episode-actions {
        width: 100%;
        justify-content: stretch;
        gap: 10px;
    }
    
    .view-btn, .download-episode-btn {
        flex: 1;
        text-align: center;
        padding: 10px;
    }
    
    /* Knowledge Section Mobile */
    .section-header.with-button {
        padding: 15px;
        gap: 15px;
    }
    
    .add-knowledge-btn {
        width: 100%;
        justify-content: center;
        padding: 15px;
        font-size: 1rem;
    }
    
    .btn-text {
        display: inline;
    }
    
    /* Knowledge Controls Mobile */
    .knowledge-controls {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    
    .filter-controls {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .filter-btn {
        padding: 10px 8px;
        font-size: 0.85rem;
        text-align: center;
    }
    
    .knowledge-stats {
        text-align: center;
        font-size: 0.85rem;
    }
    
    /* Knowledge Cards Mobile - Full Width Stack */
    .knowledge-header {
        padding: 15px;
        gap: 10px;
    }
    
    .knowledge-header-top {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .knowledge-header-info {
        align-items: flex-start;
    }
    
    .knowledge-header-actions {
        justify-content: space-between;
        width: 100%;
    }
    
    .knowledge-quick-toggle {
        flex: 1;
        text-align: center;
        margin: 0 5px;
    }
    
    .expand-icon {
        align-self: center;
    }
    
    /* Knowledge Body Mobile */
    .knowledge-body {
        padding: 15px;
    }
    
    .knowledge-actions {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        margin-top: 15px;
    }
    
    .toggle-btn, .delete-btn {
        padding: 10px 8px;
        font-size: 0.8rem;
        text-align: center;
    }
    
    /* Form Mobile */
    .add-knowledge-form {
        padding: 20px 15px;
        margin: 15px 0;
    }
    
    .input-methods {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .input-method-btn {
        padding: 12px 8px;
        font-size: 0.9rem;
        text-align: center;
    }
    
    .form-actions {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-top: 20px;
    }
    
    .analyze-btn, .save-btn, .cancel-btn {
        padding: 15px;
        font-size: 1rem;
    }
    
    .analyze-btn {
        grid-column: 1 / -1;
    }
    
    /* Result Section Mobile */
    .result-actions {
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }
    
    .word-count {
        font-size: 1rem;
        padding: 10px 20px;
    }
    
    .download-btn {
        width: 100%;
        padding: 15px;
        font-size: 1rem;
    }
    
    /* Modal Mobile */
    .modal-content {
        margin: 5% auto;
        padding: 15px;
        width: 95%;
        max-height: 90vh;
    }
    
    .modal-title {
        font-size: 1.1rem;
        line-height: 1.3;
    }
    
    .modal-body {
        font-size: 0.9rem;
        line-height: 1.6;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 8px;
    }
    
    .hero-icon {
        font-size: 2.5rem;
    }
    
    .hero-title {
        font-size: 1.8rem;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
    }
    
    .hero-description {
        font-size: 0.85rem;
    }
    
    /* Section Headers Small Mobile */
    .section-header h2 {
        font-size: 1.1rem;
        margin-bottom: 5px;
        line-height: 1.3;
    }
    
    .section-header p {
        font-size: 0.85rem;
        line-height: 1.3;
    }
    
    /* Generator Section Small Mobile */
    .generator-section, 
    .result-section {
        padding: 15px 10px;
        margin: 0 0 15px;
    }
    
    .generate-btn {
        padding: 16px 20px;
        font-size: 1rem;
        width: 100%;
    }
    
    /* Theme Input Small Mobile */
    .theme-suggestions {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    
    .suggestion-btn {
        padding: 10px;
        font-size: 0.85rem;
    }
    
    /* Knowledge Section Small Mobile */
    .section-header.with-button {
        padding: 12px;
    }
    
    .add-knowledge-btn {
        padding: 12px 15px;
        font-size: 0.9rem;
    }
    
    .btn-text {
        font-size: 0.85rem;
    }
    
    /* Knowledge Controls Small Mobile */
    .knowledge-controls {
        padding: 12px;
        gap: 12px;
    }
    
    .filter-controls {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }
    
    .filter-btn {
        padding: 8px 6px;
        font-size: 0.8rem;
    }
    
    /* Knowledge Cards Small Mobile */
    .knowledge-header {
        padding: 12px;
    }
    
    .knowledge-category {
        font-size: 0.7rem;
        padding: 3px 8px;
    }
    
    .knowledge-title {
        font-size: 0.9rem;
        line-height: 1.2;
    }
    
    .knowledge-quick-toggle {
        font-size: 0.75rem;
        padding: 4px 8px;
        margin: 0 2px;
    }
    
    .expand-icon {
        font-size: 1rem;
    }
    
    /* Knowledge Body Small Mobile */
    .knowledge-body {
        padding: 12px;
    }
    
    .knowledge-description {
        font-size: 0.85rem;
        line-height: 1.5;
    }
    
    .knowledge-actions {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    
    .view-btn, .download-episode-btn, .toggle-btn, .delete-btn {
        padding: 12px;
        font-size: 0.85rem;
        width: 100%;
    }
    
    /* Form Small Mobile */
    .add-knowledge-form {
        padding: 15px 10px;
        margin: 10px 0;
    }
    
    .form-description {
        font-size: 0.85rem;
        line-height: 1.4;
    }
    
    .input-methods {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .input-method-btn {
        padding: 15px 12px;
        font-size: 0.9rem;
    }
    
    .form-actions {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .analyze-btn, .save-btn, .cancel-btn {
        padding: 16px;
        font-size: 0.95rem;
    }
    
    /* Episode Cards Small Mobile */
    .episode-card {
        padding: 12px;
        gap: 10px;
    }
    
    .episode-number {
        font-size: 0.8rem;
        padding: 4px 10px;
    }
    
    .episode-details h3 {
        font-size: 0.9rem;
        line-height: 1.2;
    }
    
    .episode-details p {
        font-size: 0.8rem;
    }
    
    .episode-actions {
        gap: 8px;
    }
    
    .view-btn, .download-episode-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
}