:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.05);
    --input-bg: rgba(15, 23, 42, 0.6);
    --btn-radius: 8px;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    background-image: 
        radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(139, 92, 246, 0.15) 0px, transparent 50%);
    background-attachment: fixed;
}

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

/* Header */
.app-header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.8s ease;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 1rem;
}

.logo {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.app-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #60a5fa, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Sections */
.step-section {
    display: none;
    animation: fadeIn 0.5s ease forwards;
}

.step-section.active {
    display: block;
}

/* Card */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

.card h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.instruction-text {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

/* Forms & Inputs */
textarea, input[type="text"] {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: var(--btn-radius);
    padding: 1rem;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
    resize: vertical;
}

textarea:focus, input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

textarea {
    min-height: 150px;
}

.large-textarea {
    min-height: 300px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 500;
    color: #e2e8f0;
}

/* Button Groups (Toggle style) */
.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.btn-option {
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 0.75rem 1.25rem;
    border-radius: var(--btn-radius);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.btn-option:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.btn-option.active {
    background: rgba(59, 130, 246, 0.2);
    border-color: var(--primary-color);
    color: #60a5fa;
    font-weight: 500;
}

/* Primary Actions */
.action-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

.action-buttons.top-right {
    justify-content: flex-end;
    margin-top: 0;
    margin-bottom: 1rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: var(--btn-radius);
    border: none;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn.small {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

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

.btn.primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn.secondary {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn.secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Loading State */
.center-content {
    text-align: center;
    padding: 4rem 2rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
    margin: 0 auto 1.5rem auto;
}

.timer {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-top: 1.5rem;
    font-family: monospace;
    background: rgba(15, 23, 42, 0.5);
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
}

/* Markdown Result styling */
.markdown-body {
    background: rgba(15, 23, 42, 0.4);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    max-height: 60vh;
    overflow-y: auto;
    font-size: 0.95rem;
}
.markdown-body h1, .markdown-body h2, .markdown-body h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: #e2e8f0;
}
.markdown-body p, .markdown-body ul, .markdown-body ol {
    margin-bottom: 1rem;
    color: #cbd5e1;
}
.markdown-body ul {
    padding-left: 1.5rem;
}
.markdown-body pre {
    background: #000;
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    margin-bottom: 1rem;
}
.markdown-body code {
    font-family: monospace;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-size: 0.85em;
}

/* Idea Finder Card */
.idea-finder-card {
    margin-top: 1.25rem;
    padding: 1.75rem 2rem;
}

.idea-finder-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.idea-finder-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: #e2e8f0;
}

.idea-finder-body {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--glass-border);
}

.idea-finder-choice {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.idea-choice-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    text-align: left;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: var(--btn-radius);
    padding: 1.1rem 1.25rem;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
}

.idea-choice-btn:hover {
    border-color: var(--primary-color);
    background: rgba(59, 130, 246, 0.08);
    transform: translateY(-2px);
}

.idea-choice-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.idea-choice-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.idea-finder-questions {
    margin-top: 0.25rem;
}

.idea-finder-loading {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    padding: 1rem 0;
}

.idea-finder-loading[hidden] {
    display: none;
}

.spinner.small {
    width: 22px;
    height: 22px;
    border-width: 2px;
    margin: 0;
}

.idea-results {
    display: grid;
    gap: 0.9rem;
    margin-top: 1rem;
}

.idea-result-card {
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--btn-radius);
    padding: 1.1rem 1.25rem;
    animation: fadeIn 0.4s ease forwards;
}

.idea-result-card h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #93c5fd;
    margin-bottom: 0.4rem;
}

.idea-result-card p {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 0.85rem;
}

.idea-result-card .btn {
    width: 100%;
}

.idea-finder-error {
    color: #fca5a5;
    font-size: 0.88rem;
    padding: 0.75rem 0;
}

@media (max-width: 640px) {
    .idea-finder-choice {
        grid-template-columns: 1fr;
    }
    .idea-finder-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Footer */
.app-footer {
    text-align: center;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--glass-border);
    color: var(--text-muted);
    font-size: 0.85rem;
}

.app-footer .footer-meta {
    font-size: 0.78rem;
    margin-top: 0.25rem;
    opacity: 0.7;
}

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

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

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