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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    padding: 30px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #667eea;
}

header h1 {
    color: #333;
    font-size: 2.5em;
    margin-bottom: 10px;
}

.subtitle {
    color: #666;
    font-size: 1.1em;
}

.section {
    margin-bottom: 30px;
}

#setup-section {
    text-align: center;
    padding: 40px;
}

#start-form {
    max-width: 400px;
    margin: 0 auto;
}

#start-form label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
    color: #333;
    text-align: left;
}

#start-form input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1em;
    margin-bottom: 20px;
}

#start-form button {
    width: 100%;
    padding: 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1.1em;
    cursor: pointer;
    transition: background 0.3s;
}

#start-form button:hover {
    background: #5568d3;
}

.persona-selector {
    margin-bottom: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.persona-selector h3 {
    margin-bottom: 15px;
    color: #333;
}

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

.persona-btn {
    flex: 1;
    min-width: 200px;
    padding: 15px 20px;
    background: white;
    border: 2px solid #667eea;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.persona-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.persona-btn.active {
    background: #667eea;
    color: white;
    border-color: #5568d3;
}

.persona-btn h4 {
    margin-bottom: 5px;
}

.persona-btn p {
    font-size: 0.9em;
    opacity: 0.9;
}

.chat-container {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 30px;
}

.chat-window {
    height: 400px;
    overflow-y: auto;
    padding: 20px;
    background: #fafafa;
}

.welcome-message {
    text-align: center;
    color: #666;
    padding: 40px 20px;
}

.welcome-message p {
    margin-bottom: 15px;
    line-height: 1.6;
}

.message {
    margin-bottom: 15px;
    padding: 12px 16px;
    border-radius: 8px;
    max-width: 80%;
    word-wrap: break-word;
}

.message.user {
    background: #667eea;
    color: white;
    margin-left: auto;
    text-align: right;
}

.message.bot {
    background: #e0e0e0;
    color: #333;
}

.message-header {
    font-size: 0.85em;
    font-weight: bold;
    margin-bottom: 5px;
    opacity: 0.8;
}

.message-time {
    font-size: 0.75em;
    opacity: 0.6;
    margin-top: 5px;
}

.chat-input-container {
    display: flex;
    padding: 15px;
    background: white;
    border-top: 1px solid #e0e0e0;
}

#message-input {
    flex: 1;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1em;
}

#message-input:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

#send-button {
    padding: 12px 24px;
    margin-left: 10px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    transition: background 0.3s;
}

#send-button:hover:not(:disabled) {
    background: #5568d3;
}

#send-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.proposal-section {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    margin-top: 30px;
}

.proposal-section h3 {
    margin-bottom: 15px;
    color: #333;
}

.proposal-section form label {
    display: block;
    margin-top: 15px;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
}

.proposal-section form input,
.proposal-section form textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1em;
    font-family: inherit;
}

.proposal-section form textarea {
    resize: vertical;
}

.proposal-section form button {
    margin-top: 20px;
    padding: 12px 30px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1.1em;
    cursor: pointer;
    transition: background 0.3s;
}

.proposal-section form button:hover {
    background: #218838;
}

.status-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 6px;
    color: white;
    font-weight: bold;
    display: none;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.status-message.success {
    background: #28a745;
    display: block;
}

.status-message.error {
    background: #dc3545;
    display: block;
}

/* Context Screen Styles */
.context-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #667eea;
}

.context-header h2 {
    color: #333;
    margin: 0;
}

.context-content {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

.context-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.context-card h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.context-card p {
    margin-bottom: 10px;
    line-height: 1.6;
    color: #555;
}

.context-card ul {
    margin-left: 20px;
    margin-bottom: 10px;
}

.context-card li {
    margin-bottom: 8px;
    line-height: 1.6;
    color: #555;
}

.context-card strong {
    color: #333;
}

.narrative-card {
    line-height: 1.8;
}

.narrative-card p {
    margin-bottom: 15px;
    text-align: justify;
}

.narrative-card em {
    font-style: italic;
    color: #667eea;
}

.context-note {
    font-style: italic;
    color: #666;
    margin-bottom: 20px !important;
}

.form-preview {
    margin-top: 15px;
}

.form-field-preview {
    background: white;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
}

.form-field-preview label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: bold;
}

.form-hint {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px !important;
    font-style: italic;
}

.form-example {
    font-size: 0.85em;
    color: #888;
    margin-bottom: 0 !important;
    padding-left: 15px;
    border-left: 2px solid #667eea;
}

.context-footer {
    text-align: center;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
}

/* Button Styles */
.btn-primary {
    padding: 12px 30px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1.1em;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    padding: 10px 20px;
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    border-radius: 6px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background: #667eea;
    color: white;
}

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

.main-header h2 {
    margin: 0;
    color: #333;
}

/* Carousel Redesign - Clean Card Design */
.context-carousel {
    position: relative;
    max-width: 80vw;
    width: 100%;
    margin: 0 auto 2rem;
    padding: 0 1rem;
}

.carousel-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
    background: #ffffff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    height: 80vh;
    max-height: 80vh;
}

.carousel-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
    height: 100%;
    width: 100%;
}

.carousel-slide {
    min-width: 100%;
    width: 100%;
    flex-shrink: 0;
    position: relative;
    height: 100%;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
    box-sizing: border-box;
    overflow: hidden;
}

/* Content container - fills entire slide */
.slide-content {
    position: relative;
    width: 100%;
    height: 100%;
    max-height: 100%;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
    overflow: hidden;
}

/* Redesigned Context Card - Fills entire slide */
.slide-content .context-card {
    background: #ffffff;
    padding: 3rem;
    border-radius: 0;
    box-shadow: none;
    width: 100%;
    height: 100%;
    max-height: 100%;
    color: #1f2937;
    border-top: 4px solid #667eea;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    z-index: 1;
}

.slide-content .context-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.slide-content .context-card h3 {
    color: #667eea;
    margin-bottom: 1.5rem;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e5e7eb;
}

.slide-content .context-card p {
    color: #374151;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.slide-content .context-card ul,
.slide-content .context-card ol {
    color: #374151;
    margin-left: 2rem;
    margin-bottom: 1.5rem;
    line-height: 1.9;
}

.slide-content .context-card li {
    color: #374151;
    margin-bottom: 1rem;
    line-height: 1.7;
    font-size: 1.1rem;
    padding-left: 0.5rem;
}

.slide-content .context-card strong {
    color: #1f2937;
    font-weight: 700;
}

.slide-content .context-card em {
    color: #667eea;
    font-style: italic;
    font-weight: 500;
}

/* Form preview styling */
.slide-content .context-card .form-preview {
    margin-top: 1.5rem;
}

.slide-content .context-card .form-field-preview {
    background: #f8f9fa;
    padding: 1.25rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    border-left: 3px solid #667eea;
}

.slide-content .context-card .form-field-preview label {
    color: #1f2937;
    font-weight: 600;
    display: block;
    margin-bottom: 0.5rem;
}

.slide-content .context-card .form-hint {
    color: #6b7280;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    font-style: italic;
}

.slide-content .context-card .form-example {
    color: #9ca3af;
    font-size: 0.9rem;
    padding-left: 1rem;
    border-left: 2px solid #e5e7eb;
}

.slide-content .context-card .context-note {
    color: #6b7280;
    font-style: italic;
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

/* Mobile Layout */
@media (max-width: 767px) {
    .context-carousel {
        max-width: 100%;
        padding: 0;
    }
    
    .carousel-wrapper {
        height: 100vh;
        max-height: 100vh;
    }
    
    .carousel-slide {
        height: 100vh;
        max-height: 100vh;
        padding: 0;
    }
    
    .slide-content .context-card {
        padding: 2rem 1.5rem;
        border-radius: 0;
        max-height: 100%;
    }
    
    .slide-content .context-card h3 {
        font-size: 1.5rem;
        margin-bottom: 1.25rem;
        padding-bottom: 0.75rem;
    }
    
    .slide-content .context-card p {
        font-size: 1rem;
        margin-bottom: 1.25rem;
    }
    
    .slide-content .context-card li {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .slide-content .context-card ul,
    .slide-content .context-card ol {
        margin-left: 1.5rem;
    }
}

/* Navigation Buttons - Middle vertically, on sides */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: #ffffff;
    color: #667eea;
    border: 2px solid #667eea;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 30;
    pointer-events: auto;
}

.carousel-btn:hover {
    background: #667eea;
    color: #ffffff;
    border-color: #667eea;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transform: translateY(-50%) scale(1.05);
}

.carousel-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.carousel-btn.prev {
    left: 1rem;
}

.carousel-btn.next {
    right: 1rem;
}

.carousel-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.carousel-icon {
    width: 1.5rem;
    height: 1.5rem;
}

/* Mobile Button Positioning */
@media (max-width: 767px) {
    .carousel-btn {
        width: 2rem;
        height: 2rem;
    }
    
    .carousel-btn.prev {
        left: 0.5rem;
    }
    
    .carousel-btn.next {
        right: 0.5rem;
    }
    
    .carousel-icon {
        width: 1rem;
        height: 1rem;
    }
}

/* Carousel Footer */
.carousel-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding: 0 0.5rem;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.carousel-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: #d1d5db;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.carousel-dot:hover {
    background: #9ca3af;
    transform: scale(1.2);
}

.carousel-dot.active {
    background: #667eea;
    width: 0.75rem;
    height: 0.75rem;
}

.carousel-counter {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
    padding: 0.25rem 0.75rem;
    background: #f3f4f6;
    border-radius: 9999px;
}

/* Enhanced Button for First Visit */
.btn-primary-action {
    background: #667eea !important;
    color: white !important;
    border: none !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 6px -1px rgba(102, 126, 234, 0.3), 0 2px 4px -1px rgba(102, 126, 234, 0.2) !important;
    transition: all 0.2s ease !important;
}

.btn-primary-action:hover {
    background: #5568d3 !important;
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(102, 126, 234, 0.3), 0 4px 6px -2px rgba(102, 126, 234, 0.2) !important;
}

/* Mobile Footer Adjustments */
@media (max-width: 767px) {
    .carousel-footer {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .carousel-counter {
        font-size: 0.75rem;
    }
}

