/* CSS Reset and Base Styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: #e0e7ff;
    --secondary-color: #10b981;
    --accent-color: #f59e0b;
    --background: #f8fafc;
    --surface: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --transition: all 0.2s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #8b5cf6 100%);
    color: white;
    padding: 2rem 1.5rem;
    text-align: center;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.logo-img {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
}

.header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.tagline {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    margin-top: 0.5rem;
}

/* Main Content */
.main-content {
    flex: 1;
    max-width: 900px;
    margin: 0 auto;
    padding: 1.5rem;
    width: 100%;
}

/* Section Styles */
.section {
    margin-bottom: 2rem;
}

.section h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

/* Concept Grid */
.concept-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
}

.concept-card {
    background: var(--surface);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

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

.concept-card.selected {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.concept-icon {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    display: block;
}

.concept-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* Difficulty Buttons */
.difficulty-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.difficulty-btn {
    background: var(--surface);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.difficulty-btn:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.difficulty-btn.active {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.difficulty-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.difficulty-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.difficulty-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Generate Button */
.generate-section {
    text-align: center;
}

.generate-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, #8b5cf6 100%);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    padding: 1rem 2.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-md);
}

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

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

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

.btn-icon {
    font-size: 1.25rem;
}

/* Prompt Card */
.prompt-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.prompt-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #8b5cf6 100%);
    color: white;
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.prompt-header h2 {
    color: white;
    margin: 0;
    font-size: 1.25rem;
}

.prompt-badges {
    display: flex;
    gap: 0.5rem;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.concept-badge {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.difficulty-badge {
    background: var(--secondary-color);
    color: white;
}

.prompt-content {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.prompt-text {
    font-size: 1.25rem;
    line-height: 1.7;
    color: var(--text-primary);
    font-style: italic;
}

.prompt-details {
    padding: 1.5rem;
}

.detail-section {
    margin-bottom: 1.25rem;
}

.detail-section:last-child {
    margin-bottom: 0;
}

.detail-section h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.detail-section p,
.detail-section li {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.example-text {
    background: var(--background);
    padding: 1rem;
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary-color);
    font-style: italic;
}

.detail-section ul {
    list-style: none;
    padding: 0;
}

.detail-section li {
    padding: 0.25rem 0;
    padding-left: 1.25rem;
    position: relative;
}

.detail-section li::before {
    content: "•";
    color: var(--primary-color);
    position: absolute;
    left: 0;
}

.prompt-actions {
    padding: 1rem 1.5rem;
    background: var(--background);
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.action-btn {
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.copy-btn {
    background: var(--surface);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.copy-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.new-btn {
    background: var(--primary-color);
    border: none;
    color: white;
}

.new-btn:hover {
    background: var(--primary-hover);
}

/* Feedback Section */
.feedback-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.feedback-card h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.feedback-buttons {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.feedback-btn {
    background: var(--surface);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
}

.feedback-btn:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.feedback-btn.selected {
    border-color: var(--secondary-color);
    background: #d1fae5;
}

.feedback-icon {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.feedback-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.feedback-message {
    margin-top: 1rem;
    padding: 0.75rem;
    background: #d1fae5;
    border-radius: var(--radius-sm);
    color: var(--secondary-color);
    font-weight: 500;
}

/* Saved Prompts */
.saved-prompts {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
    font-size: 0.9rem;
}

.saved-prompt-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.saved-prompt-item:last-child {
    border-bottom: none;
}

.saved-prompt-text {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.saved-prompt-meta {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.saved-prompt-meta .badge {
    font-size: 0.7rem;
    background: var(--background);
    color: var(--text-secondary);
}

.saved-prompt-actions {
    display: flex;
    gap: 0.5rem;
}

.saved-prompt-actions button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.25rem;
    opacity: 0.6;
    transition: var(--transition);
}

.saved-prompt-actions button:hover {
    opacity: 1;
}

/* Footer */
.footer {
    background: var(--text-primary);
    color: white;
    padding: 1.5rem;
    text-align: center;
}

.footer-content p {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
}

.footer a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.footer a:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.prompt-section {
    animation: fadeIn 0.3s ease-out;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        padding: 1.5rem 1rem;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .logo-img {
        width: 40px;
        height: 40px;
    }

    .main-content {
        padding: 1rem;
    }

    .concept-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 0.5rem;
    }

    .concept-card {
        padding: 0.75rem;
    }

    .concept-icon {
        font-size: 1.5rem;
    }

    .concept-name {
        font-size: 0.75rem;
    }

    .difficulty-buttons {
        grid-template-columns: 1fr;
    }

    .difficulty-btn {
        flex-direction: row;
        justify-content: flex-start;
        gap: 1rem;
        text-align: left;
    }

    .difficulty-icon {
        margin-bottom: 0;
    }

    .generate-btn {
        width: 100%;
        justify-content: center;
        padding: 1rem;
    }

    .prompt-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .prompt-text {
        font-size: 1.1rem;
    }

    .prompt-actions {
        flex-direction: column;
    }

    .action-btn {
        width: 100%;
        justify-content: center;
    }

    .feedback-buttons {
        gap: 0.5rem;
    }

    .feedback-btn {
        min-width: 70px;
        padding: 0.5rem 0.75rem;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.25rem;
    }

    .tagline {
        font-size: 0.875rem;
    }

    .section h2 {
        font-size: 1rem;
    }

    .concept-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
