* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Helvetica Neue', sans-serif;
}

body {
    background-color: #eef6ff;
    min-height: 100vh;
    padding: 40px 20px;
    color: #1e293b;
}

.main-container {
    max-width: 800px;
    margin: 0 auto;
    transition: all 0.3s ease;
}

.main-container.with-preview {
    max-width: 1400px;
    display: flex;
    gap: 30px;
    align-items: flex-start;

}

.wizard-container {
    width: 100%;
    transition: all 0.3s ease;
}

.main-container.with-preview .wizard-container {
    flex: 1;
    max-width: 1200px;
}

.preview-container {
    display: none;
    flex: 1;
    max-width: 600px;
    position: sticky;
    top: 40px;
}


.main-container.with-preview .preview-container {
    display: none;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.progress-container {
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
}

.progress-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    width: 100%;
    max-width: 600px;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: #e2e8f0;
    transform: translateY(-50%);
    z-index: 1;
}

.progress-fill {
    position: absolute;
    top: 50%;
    left: 0;
    height: 2px;
    background: #0066ff;
    transform: translateY(-50%);
    z-index: 2;
    transition: width 0.3s ease;
    width: 0%;
}

.step {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #64748b;
    position: relative;
    z-index: 3;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid #e2e8f0;
}

.step.active {
    background: #0066ff;
    color: white;
    border-color: #0066ff;
}

.step.completed {
    background: #0066ff;
    color: white;
    border-color: #0066ff;
}

.step.completed::after {
    content: '✓';
    font-size: 14px;
}

.stage-title {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 30px;
    color: #1e293b;
    font-weight: 600;
}

.stage-content {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

.stage {
    display: none;
    animation: fadeIn 0.3s ease;
}

.stage.active {
    display: block;
}

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

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #1e293b;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    background: #ffffff;
    color: #1e293b;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #0066ff;
    box-shadow: 0 0 0 2px rgba(0, 102, 255, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #94a3b8;
}

.upload-area {
    border: 1px dashed #cbd5e1;
    border-radius: 6px;
    padding: 20px;
    text-align: center;
    transition: border-color 0.3s ease;
    background: #f8fafc;
}

.upload-area:hover {
    border-color: #0066ff;
}

.upload-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    color: #1e293b;
    font-weight: 500;
    font-size: 0.9rem;
}

.upload-btn svg {
    margin-right: 8px;
}

.upload-btn:hover {
    background: #e2e8f0;
}

.upload-area input[type="file"] {
    display: none;
}

.audience-grid,
.pov-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.audience-item,
.pov-item {
    padding: 15px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    transition: all 0.3s ease;
    cursor: pointer;
    background: #f8fafc;
    color: #1e293b;
}

.audience-item:hover,
.pov-item:hover {
    border-color: #0066ff;
    background: #f0f7ff;
}

.audience-item.selected,
.pov-item.selected {
    border-color: #0066ff;
    background: #0066ff;
    color: white;
}

.audience-item input,
.pov-item input {
    display: none;
}

.slider-group {
    margin-top: 20px;
}

.slider-item {
    margin-bottom: 25px;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.875rem;
    color: #64748b;
}

.slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e2e8f0;
    outline: none;
    -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #0066ff;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #0066ff;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.goal-description {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 20px;
    font-style: italic;
}

.navigation-buttons {
    display: flex;
    justify-content: space-between;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #0066ff;
    color: white;
}

.btn-primary:hover {
    background: #0052cc;
}

.btn-secondary {
    background: #f1f5f9;
    color: #64748b;
}

.btn-secondary:hover {
    background: #e2e8f0;
    color: #1e293b;
}

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

.btn svg {
    margin-right: 6px;
    vertical-align: middle;
}

.preview-card {
    background: white;
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.preview-header {
    background: #f8fafc;
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.preview-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #1e293b;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
}

.preview-subtitle {
    color: #64748b;
    font-size: 14px;
}

.ai-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #0066ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: white;
}

.preview-content {
    padding: 20px;
    background: white;
}

.ai-response-bubble {
    background: #f0f7ff;
    border: 1px solid #e0f2fe;
    border-radius: 12px;
    padding: 20px;
    color: #1e293b;
    line-height: 1.6;
    border-left: 4px solid #0066ff;
}

.response-content h4 {
    color: #1e293b;
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 600;
}

.response-content p {
    margin-bottom: 15px;
    font-size: 14px;
    color: #334155;
}

.response-content strong {
    font-weight: 600;
    color: #1e293b;
}

.response-content em {
    font-style: italic;
    color: #475569;
}

.preview-actions {
    padding: 20px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    display: flex;
    gap: 10px;
}

.preview-btn {
    padding: 8px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    color: #64748b;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.preview-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #1e293b;
}

.preview-btn.primary {
    background: #0066ff;
    border-color: #0066ff;
    color: white;
}

.preview-btn.primary:hover {
    background: #0052cc;
    border-color: #0052cc;
}

.generation-section {
    margin-bottom: 30px;
}

.content-summary {
    background: #f8fafc;
    padding: 20px;
    border-radius: 8px;
    margin: 15px 0;
    border: 1px solid #e2e8f0;
}

.summary-details {
    margin: 15px 0;
}

.summary-details p {
    margin-bottom: 8px;
}

.generated-content-area {
    background: #ffffff;
    padding: 20px;
    border-radius: 6px;
    margin-top: 15px;
    border-left: 4px solid #0066ff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.generate-btn {
    margin-top: 15px;
}

.adjust-section {
    border-top: 1px solid #e2e8f0;
    padding-top: 30px;
}

.parameter-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.parameter-item {
    background: #f8fafc;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.parameter-item label {
    font-weight: 600;
    margin-bottom: 10px;
    display: block;
}

@media (max-width: 1200px) {
    .main-container.with-preview {
        flex-direction: column;
        max-width: 800px;
    }
    .preview-container {
        position: static;
        max-width: none;
    }
}

@media (max-width: 768px) {
    .stage-content {
        padding: 25px;
    }
    .audience-grid,
    .pov-list {
        grid-template-columns: 1fr;
    }
    .action-buttons {
        flex-direction: column;
    }
    .btn-large {
        width: 100%;
    }
}

/* Results page styles */
.results-container {
    display: none;
    animation: fadeIn 0.5s ease;
    width: 100%;
}

.results-container.active {
    display: block;
}

.results-header {
    text-align: center;
    margin-bottom: 30px;
}

.results-title {
    font-size: 1.8rem;
    color: #1e293b;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.success-icon {
    color: #10b981;
    font-size: 1.8rem;
}

.results-subtitle {
    color: #64748b;
    font-size: 1rem;
}

.content-stats {
    display: flex;
    justify-content: space-around;
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: bold;
    color: #0066ff;
}

.stat-label {
    font-size: 0.8rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.final-content-display {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

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

.content-title {
    font-size: 1.3rem;
    color: #1e293b;
    font-weight: 600;
}

.content-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.meta-item {
    background: #f8fafc;
    padding: 12px;
    border-radius: 6px;
    border-left: 3px solid #0066ff;
}

.meta-label {
    font-size: 0.8rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.meta-value {
    color: #1e293b;
    font-weight: 500;
}

.final-content-text {
    background: #f8fafc;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    line-height: 1.7;
    color: #1e293b;
    font-size: 1rem;
}

.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-large {
    padding: 12px 24px;
    font-size: 1rem;
    min-width: 180px;
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.generation-section {
    margin-bottom: 30px;
}

.content-summary {
    background: #f8fafc;
    padding: 20px;
    border-radius: 8px;
    margin: 15px 0;
    border: 1px solid #e2e8f0;
}

.summary-details {
    margin: 15px 0;
}

.summary-details p {
    margin-bottom: 8px;
}

.generated-content-area {
    background: #ffffff;
    padding: 20px;
    border-radius: 6px;
    margin-top: 15px;
    border-left: 4px solid #0066ff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.generate-btn {
    margin-top: 15px;
}

.adjust-section {
    border-top: 1px solid #e2e8f0;
    padding-top: 30px;
}

.parameter-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.parameter-item {
    background: #f8fafc;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.parameter-item label {
    font-weight: 600;
    margin-bottom: 10px;
    display: block;
}

@media (max-width: 1200px) {
    .main-container.with-preview {
        flex-direction: column;
        max-width: 800px;
    }

    .preview-container {
        position: static;
        max-width: none;
    }
}

@media (max-width: 768px) {
    .stage-content {
        padding: 25px;
    }

    .audience-grid,
    .pov-list {
        grid-template-columns: 1fr;
    }

    .action-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn-large {
        width: 100%;
    }

    .content-meta {
        grid-template-columns: 1fr;
    }
}

#backToChatBtn {
    background-color: #f8f9fa;
    border: 1px solid #ccc;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 10px;
}

#backToChatBtn:hover {
    background-color: #e9ecef;
}


.chat-container {
    flex: 2;
    width: auto;
    height: auto;
    /*height: 650px;*/
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    /*display: flex;*/
    flex-direction: row;
    overflow: hidden;
    position: relative;
}

.chat-messages {
    height: 80%;
    flex: 1;
    padding: 1rem 1rem 2.5rem; /* bottom padding added */
    overflow-y: auto;
    border-bottom: 1px solid #ddd;
}

.message {
    margin-bottom: 12px;
    line-height: 1.4;
}

.user {
    max-width: 70%;
    background-color: #4b4c4c;
    color: white;
    padding: 12px 16px;
    margin: 8px 0;
    border-radius: 12px 12px 12px 4px;
    font-size: 15px;
    line-height: 1.5;
    text-align: left;
    margin-left: auto; /* push user messages to the right */
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.bot {
    max-width: 100%;              /* limit width like chat bubbles */
    color: #1e293b;              /* professional dark text */
    padding: 12px 16px;
    margin: 8px 0;
    border-radius: 12px 12px 12px 4px; /* speech bubble shape */
    font-size: 15px;
    line-height: 1.5;
    text-align: left;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); /* subtle shadow */
}

.chat-input {
    width: 100%;
    display: flex;
    padding: 5px 5px; /* Increased vertical padding */
    gap: 5px;
    background-color: #fff;
    min-height: 80px; /* Optional: sets a minimum height */
    align-items: flex-end; /* keep aligned at bottom */
}
.chat-input textarea {
    flex: 1; /* takes up all remaining space */
    min-height: 45px;
    max-height: 200px; /* stops growing too tall */
    resize: none;
    overflow-y: auto;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.4;
    box-sizing: border-box;
}
.chat-input input[type="file"] {
    display: none; /* hide ugly default */
}
.chat-input button {
    flex: 0 0 auto;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 14px;
}
input[type="text"] {
    flex: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
}

button {
    padding: 10px 15px;
    background-color: #0077cc;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

button:hover {
    background-color: #005fa3;
}

.right-panel {
    height: 650px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 260px; /* wider */
}

#important-topics {
    height: 100%;
    width: auto;
    padding: 16px;
    border: 1px solid #ccc;
    border-radius: 10px;
    font-size: 16px;
    box-sizing: border-box;
    line-height: 1.5;
}

.nav-button {
    padding: 10px 15px;
    background-color: #0077cc;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
}

.nav-button:hover {
    background-color: #005fa3;
}

.message.loading {
    font-style: italic;
    opacity: 0.7;
}

.chat-layout {
    display: flex;
    flex-direction: row-reverse; /* This flips the order */
    gap: 20px;
}

.left-panel {
    flex: 1;
    width: 300px;
    height: 100%;
}




.right-panel {
    flex: 1; /* Takes 1 part of the available space */
    background: #ffffff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}


.content-wrapper {
    display: flex;
    flex-direction: row;
    gap: 20px; /* Add space between the left and right panels */
}