:root {
    --primary-color: #6366f1;
    --primary-hover: #5855eb;
    --secondary-color: #f3f4f6;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --background: #ffffff;
    --card-background: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --border-radius: 8px;
    --border-radius-lg: 12px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

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

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 3rem;
    color: white;
}

.logo h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(45deg, #ffffff, #f0f9ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1.2rem;
    font-weight: 400;
    opacity: 0.9;
}

.tagline {
    font-size: 1.1rem;
    margin-top: 1rem;
    opacity: 0.8;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Main Content */
.main-content {
    background: var(--card-background);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.content-form {
    padding: 2rem;
}

/* Form Sections */
.form-section {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.section-title {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    font-size: 0.9rem;
    font-weight: 600;
    margin-right: 1rem;
}

/* Platform Grid */
.platform-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.platform-card {
    padding: 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--card-background);
}

.platform-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.platform-card.selected {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
}

.platform-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.platform-card h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.platform-card p {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 0.5rem;
}

.platform-length {
    font-size: 0.8rem;
    font-weight: 500;
    opacity: 0.7;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    display: inline-block;
}

.platform-card.selected .platform-length {
    background: rgba(255, 255, 255, 0.2);
}

/* Topic Filters */
.topic-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    background: var(--secondary-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    font-weight: 500;
}

.filter-btn:hover {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

.filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Topic Search */
.topic-search {
    margin-bottom: 1.5rem;
}

.topic-search input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.topic-search input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Topics Grid */
.topics-grid {
    display: grid;
    gap: 1rem;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.seed-details {
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: #fafbff;
}

.seed-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.seed-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.seed-section {
    margin-top: 0.75rem;
}

.seed-section h4 {
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.seed-pre {
    background: #f3f4f6;
    padding: 0.5rem;
    border-radius: 6px;
}

.topic-card {
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--card-background);
}

.topic-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.no-topics {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
    color: #666;
    font-style: italic;
}

.topic-card.selected {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(99, 102, 241, 0.1));
}

.topic-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.topic-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.topic-category, .topic-complexity {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
}

.topic-category {
    background: var(--primary-color);
    color: white;
}

.topic-complexity {
    background: var(--secondary-color);
    color: var(--text-secondary);
}

.topic-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Format Options */
.format-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.format-card {
    padding: 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--card-background);
}

.format-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.format-card.selected {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
}

.format-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.format-card h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.format-card p {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 1rem;
}

.format-card ul {
    list-style: none;
    font-size: 0.85rem;
}

.format-card li {
    padding: 0.25rem 0;
    opacity: 0.8;
}

.format-card li:before {
    content: "✓ ";
    margin-right: 0.5rem;
    opacity: 0.8;
}

/* Customization Options */
.customization-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.option-group {
    display: flex;
    flex-direction: column;
}

.option-group label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.option-group select,
.option-group textarea {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    transition: border-color 0.2s ease;
}

.option-group textarea {
    min-height: 100px;
    resize: vertical;
    font-family: inherit;
}

.option-group select:focus,
.option-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Generate Section */
.generate-section {
    text-align: center;
    padding: 2rem;
    background: var(--secondary-color);
    border-radius: var(--border-radius);
}

.generate-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 200px;
    position: relative;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.btn-loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin-left: 0.5rem;
}

.generate-btn.loading .btn-text {
    opacity: 0.7;
}

.generate-btn.loading .btn-loader {
    display: block;
}

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

.generate-note {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* Results Section */
.results-section {
    margin-top: 2rem;
    padding: 2rem;
    background: var(--card-background);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
}

.results-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 1rem;
}

.results-info {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.results-info span {
    padding: 0.25rem 0.75rem;
    background: var(--secondary-color);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.results-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.results-actions button {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    background: var(--card-background);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    font-weight: 500;
}

.results-actions button:hover {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

.content-output {
    background: #f8fafc;
    border-radius: var(--border-radius);
    padding: 2rem;
    border: 1px solid var(--border-color);
    white-space: pre-wrap;
    font-family: 'Inter', monospace;
    line-height: 1.6;
    max-height: 600px;
    overflow-y: auto;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .logo h1 {
        font-size: 2rem;
    }
    
    .platform-grid {
        grid-template-columns: 1fr;
    }
    
    .format-options {
        grid-template-columns: 1fr;
    }
    
    .customization-options {
        grid-template-columns: 1fr;
    }
    
    .results-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .results-actions {
        justify-content: center;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--secondary-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

