@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Brand Colors */
    --brand-primary: #E83182;
    --brand-primary-hover: #d42872;
    --brand-secondary: #394149;
    --brand-neutral: #EBE6E5;
    --brand-text-dark: #212121;
    --brand-text-muted: #ABB8C3;
    --brand-success: #00D084;
    --brand-border: #e5e5e5;
}

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

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--brand-secondary);
    min-height: 100vh;
    color: var(--brand-text-dark);
    line-height: 1.6;
}

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

/* Site Header */
.site-header {
    background: var(--brand-secondary);
    color: white;
    padding: 0;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-mascot {
    width: 120px;
    height: 120px;
    object-fit: contain;
}

.brand-text h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
}

.brand-text .tagline {
    font-size: 0.95rem;
    opacity: 0.8;
    margin: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-help {
    background: var(--brand-primary);
    color: white;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    font-weight: 500;
}

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

.help-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Site Footer */
.site-footer {
    background: var(--brand-secondary);
    color: white;
    margin-top: 40px;
    padding: 40px 20px;
}

.footer-content {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 10px;
}

.footer-mascot {
    width: 72px;
    height: 72px;
    object-fit: contain;
}

.footer-brand h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0;
}

.footer-credit {
    color: var(--brand-text-muted);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.footer-link {
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.footer-link:hover {
    color: var(--brand-primary);
}

.footer-tagline {
    font-size: 0.8rem;
    color: var(--brand-text-muted);
}

.progress-bar {
    display: flex;
    justify-content: space-between;
    background: rgba(255,255,255,0.15);
    border-radius: 50px;
    padding: 10px 20px;
    margin-bottom: 30px;
}

.progress-step {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,0.5);
    font-size: 0.9rem;
}

.progress-step.active {
    color: white;
}

.progress-step.completed {
    color: var(--brand-success);
}

.step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255,255,255,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.progress-step.active .step-number {
    background: var(--brand-primary);
    color: white;
}

.progress-step.completed .step-number {
    background: var(--brand-success);
    color: white;
}

.step {
    display: none;
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.step.active {
    display: block;
}

.step-header {
    margin-bottom: 25px;
}

.step-header h2 {
    color: var(--brand-text-dark);
    margin-bottom: 10px;
}

.helper-text {
    color: var(--brand-text-muted);
    font-size: 0.95rem;
}

.privacy-note {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.input-options {
    text-align: center;
    margin-bottom: 20px;
}

.or-divider {
    display: block;
    margin-top: 10px;
    color: #888;
    font-size: 0.9rem;
}

.upload-area {
    margin-bottom: 20px;
}

.file-upload {
    border: 2px dashed #ddd;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    transition: border-color 0.3s;
    margin-bottom: 15px;
}

.file-upload:hover {
    border-color: var(--brand-primary);
}

.upload-area.drag-over .file-upload {
    border-color: var(--brand-primary);
    background-color: rgba(232, 49, 130, 0.05);
}

.file-label {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--brand-text-muted);
}

.upload-hint {
    font-size: 0.85rem;
    color: #999;
}

.upload-icon {
    font-size: 2rem;
}

#file-input {
    display: none;
}

.file-name {
    color: var(--brand-primary);
    font-weight: 500;
}

.text-divider {
    text-align: center;
    color: #888;
    margin: 15px 0;
    font-size: 0.9rem;
}

textarea {
    width: 100%;
    min-height: 200px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
}

textarea:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(232, 49, 130, 0.1);
}

.warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 15px 0;
    color: #856404;
}

.hidden {
    display: none !important;
}

.section-box {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
}

.section-title {
    margin: 0 0 20px 0;
    color: var(--brand-text-dark);
    font-size: 1.2rem;
    font-weight: 600;
}

.context-section-box {
    background: rgba(232, 49, 130, 0.05);
    border: 1px solid rgba(232, 49, 130, 0.15);
}

.context-explainer {
    color: #555;
    font-size: 0.95rem;
    margin-bottom: 20px;
    line-height: 1.5;
}

.context-field {
    margin-bottom: 20px;
}

.context-field:last-child {
    margin-bottom: 0;
}

.context-field label {
    display: block;
    font-weight: 600;
    color: var(--brand-text-dark);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.optional-tag {
    font-weight: 400;
    color: #888;
    font-size: 0.85rem;
    margin-left: 5px;
}

.context-field textarea {
    width: 100%;
    min-height: 70px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    box-sizing: border-box;
}

.context-field textarea:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(232, 49, 130, 0.1);
}

.field-helper {
    display: block;
    margin-top: 6px;
    font-size: 0.85rem;
    color: var(--brand-text-muted);
}

.step-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 25px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

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

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

.btn-primary:hover:not(:disabled) {
    background: var(--brand-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(232, 49, 130, 0.3);
}

.btn-secondary {
    background: var(--brand-neutral);
    color: var(--brand-text-dark);
}

.btn-secondary:hover:not(:disabled) {
    background: #ddd8d7;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--brand-primary);
    color: var(--brand-primary);
}

.btn-outline:hover {
    background: rgba(232, 49, 130, 0.1);
}

.loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--brand-neutral);
    border-top-color: var(--brand-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

.themes-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.theme-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    border-left: 4px solid var(--brand-primary);
}

.theme-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
    gap: 15px;
}

.theme-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--brand-text-dark);
    flex: 1;
    min-width: 0;
}

.theme-name input {
    font-size: 1.1rem;
    font-weight: 600;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 12px;
    width: 100%;
    box-sizing: border-box;
}

.theme-actions {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
}

.theme-actions button {
    padding: 5px 10px;
    font-size: 0.8rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    background: #e0e0e0;
}

.theme-actions button:hover {
    background: #d0d0d0;
}

.theme-actions button.delete {
    color: #dc3545;
}

.theme-description {
    color: #555;
    margin-bottom: 8px;
}

.theme-description textarea {
    min-height: 60px;
    font-size: 0.95rem;
}

.theme-rationale {
    font-size: 0.85rem;
    color: #888;
    font-style: italic;
}

.add-theme-section {
    margin-top: 15px;
}

.refine-focus-section {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid var(--brand-border);
}

.refine-focus-header {
    text-align: center;
}

.btn-link {
    background: none;
    border: none;
    color: var(--brand-primary);
    cursor: pointer;
    font-size: 0.95rem;
    text-decoration: underline;
    padding: 0;
}

.btn-link:hover {
    color: var(--brand-primary-hover);
}

.refine-focus-content {
    margin-top: 15px;
}

.refine-focus-content .helper-text {
    margin-bottom: 10px;
    color: var(--brand-secondary);
}

.refine-focus-content textarea {
    width: 100%;
    margin-bottom: 15px;
}

.refine-focus-content .btn {
    width: 100%;
}

.quotes-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.theme-quotes {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
}

.theme-quotes h3 {
    color: var(--brand-primary);
    margin-bottom: 5px;
}

.saturation-indicator {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 15px;
}

.quote-card {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    border-left: 3px solid var(--brand-primary);
}

.quote-text {
    font-style: italic;
    margin-bottom: 8px;
    color: var(--brand-text-dark);
}

.quote-source {
    font-size: 0.85rem;
    color: var(--brand-text-muted);
}

.quote-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.quote-actions button {
    padding: 4px 10px;
    font-size: 0.8rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.quote-actions .copy-btn {
    background: var(--brand-primary);
    color: white;
}

.quote-actions .delete-btn {
    background: #f8d7da;
    color: #721c24;
}

.quote-actions select {
    padding: 4px 8px;
    font-size: 0.8rem;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.summary-config {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
}

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

.config-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--brand-text-dark);
}

.config-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
}

.config-group input[type="text"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    margin-top: 10px;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 10px;
    border-radius: 8px;
    transition: background 0.2s;
}

.radio-label:hover {
    background: #e9ecef;
}

.radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
}

.summary-container {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
}

.summary-container h3 {
    margin-bottom: 15px;
    color: var(--brand-text-dark);
}

#summary-text {
    min-height: 300px;
    margin-bottom: 15px;
}

.summary-actions {
    display: flex;
    gap: 10px;
}

.individual-summaries {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
}

.theme-summary-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    border-left: 4px solid var(--brand-primary);
}

.theme-summary-card h4 {
    margin: 0 0 15px 0;
    color: var(--brand-text-dark);
    font-size: 1.1rem;
}

.theme-summary-text {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.6;
    resize: vertical;
}

.results-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--brand-primary);
    color: white;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    display: block;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.export-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
}

.export-section h3 {
    margin-bottom: 15px;
}

.export-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.next-steps {
    background: #e8f5e9;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
}

.next-steps h3 {
    color: #2e7d32;
    margin-bottom: 15px;
}

.next-steps ul {
    list-style: none;
}

.next-steps li {
    padding: 8px 0;
    padding-left: 25px;
    position: relative;
}

.next-steps li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #4caf50;
}

.data-notice {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
}

.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--brand-secondary);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    z-index: 1000;
    transition: opacity 0.3s;
}

.toast.hidden {
    opacity: 0;
    pointer-events: none;
}

.merge-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.merge-modal-content {
    background: white;
    border-radius: 12px;
    padding: 25px;
    max-width: 400px;
    width: 90%;
}

.merge-modal h3 {
    margin-bottom: 15px;
}

.merge-modal select {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.merge-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Help Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal.hidden {
    display: none;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.help-modal-content {
    padding: 0;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 16px;
    border-bottom: 1px solid #eee;
}

.modal-header h2 {
    margin: 0;
    color: var(--brand-secondary);
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: #888;
    line-height: 1;
    padding: 0;
}

.modal-close:hover {
    color: var(--brand-primary);
}

.modal-body {
    padding: 24px;
}

.help-scrollable {
    max-height: 70vh;
    overflow-y: auto;
}

/* Help Sections */
.help-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.help-section h3 {
    color: var(--brand-primary);
    font-size: 1.05rem;
    margin-bottom: 12px;
}

.help-content {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--brand-text-dark);
}

.help-content p {
    margin-bottom: 10px;
}

.help-content ul {
    margin: 8px 0 12px 20px;
    padding: 0;
}

.help-content li {
    margin-bottom: 6px;
}

.help-content em {
    display: block;
    background: #f8f9fa;
    padding: 10px 12px;
    border-radius: 6px;
    margin-top: 8px;
    color: var(--brand-secondary);
}

/* Quick Start Section */
.quick-start {
    margin-bottom: 30px;
}

.quick-start h3 {
    margin-bottom: 20px;
    color: var(--brand-text-dark);
    font-size: 1.1rem;
}

.quick-start-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.qs-step {
    background: var(--brand-neutral);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
}

.qs-number {
    width: 36px;
    height: 36px;
    background: var(--brand-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin: 0 auto 12px;
}

.qs-step h4 {
    margin: 0 0 8px 0;
    font-size: 0.95rem;
    color: var(--brand-text-dark);
}

.qs-step p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--brand-text-muted);
    line-height: 1.4;
}

/* Help Tips */
.help-tips {
    margin-top: 24px;
}

.help-tips h3 {
    margin-bottom: 16px;
    color: var(--brand-text-dark);
    font-size: 1.1rem;
}

.tip-box {
    background: #e8f4fd;
    border-left: 4px solid #3b82f6;
    padding: 12px 16px;
    border-radius: 0 8px 8px 0;
    margin-bottom: 12px;
    font-size: 0.9rem;
    color: #1e40af;
}

.tip-box strong {
    display: block;
    margin-bottom: 4px;
}

@media (max-width: 600px) {
    .quick-start-steps {
        grid-template-columns: 1fr;
    }
    
    .header-content {
        flex-direction: column;
        height: auto;
        padding: 16px 20px;
        gap: 12px;
    }
    
    .header-brand {
        text-align: center;
    }
    
    .brand-text h1 {
        font-size: 1.5rem;
    }
}

@media (max-width: 600px) {
    .progress-step .step-label {
        display: none;
    }
    
    .results-summary {
        grid-template-columns: 1fr;
    }
    
    .step-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}
