/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #fff;
    min-height: 100vh;
    color: #111;
    line-height: 1.6;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 10px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header styles - Mobile optimized */
header {
    text-align: center;
    padding: 15px 10px;
}

header h1 {
    font-size: 1.8em;
    color: #111;
    text-shadow: none;
    margin-bottom: 6px;
    font-weight: 700;
    line-height: 1.2;
}

.subtitle {
    color: #444;
    font-size: 1em;
    font-weight: 300;
    padding: 0 15px;
    line-height: 1.4;
}

/* Step container styles - Mobile first */
.step {
    background: #fff;
    border-radius: 12px;
    padding: 20px 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    backdrop-filter: none;
    display: none;
    flex: 1;
    margin-bottom: 10px;
    border: 1px solid #eee;
}

.step.active {
    display: block;
}

.step h2 {
    color: #111;
    font-size: 1.4em;
    margin-bottom: 10px;
    text-align: center;
    line-height: 1.3;
    padding: 0 5px;
}

.step-description {
    text-align: center;
    color: #666;
    margin-bottom: 20px;
    font-size: 0.95em;
    padding: 0 10px;
    line-height: 1.5;
}

/* Options grid - Enhanced for mobile */
.options-container {
    margin-bottom: 20px;
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

.option-card {
    background: #fafbfc;
    border: 2px solid #eee;
    border-radius: 10px;
    padding: 16px 12px;
    cursor: pointer;
    text-align: center;
    min-height: 70px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    color: #111;
}

.option-card.selected {
    background: #f0f0f0;
    color: #000;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-color: #bbb;
}

.option-card h3 {
    font-size: 1.05em;
    margin-bottom: 5px;
    font-weight: 600;
    line-height: 1.3;
    color: #111;
}

.option-card p {
    font-size: 0.8em;
    opacity: 0.85;
    line-height: 1.3;
    margin: 0;
    color: #333;
}

/* Custom input section - Mobile enhanced */
.custom-input-section {
    background: #fafbfc;
    border-radius: 10px;
    padding: 16px 12px;
    margin: 15px 0;
    border-left: 4px solid #eee;
}

.custom-input-section label {
    display: block;
    font-weight: 600;
    color: #111;
    margin-bottom: 8px;
    font-size: 0.95em;
}

.custom-input-section input,
.custom-input-section textarea {
    width: 100%;
    padding: 14px 12px;
    border: 2px solid #eee;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    background: #fff;
    touch-action: manipulation;
    font-family: inherit;
    color: #111;
}

.custom-input-section textarea {
    min-height: 80px;
    resize: vertical;
    line-height: 1.4;
}

.custom-input-section input:focus,
.custom-input-section textarea:focus {
    outline: none;
    border-color: #bbb;
    box-shadow: 0 0 0 2px #eee;
}

/* Input with wand button container */
.input-with-wand {
    position: relative;
    display: flex;
    align-items: stretch;
}

.input-with-wand textarea {
    flex: 1;
    padding-right: 50px;
}

.wand-btn {
    position: absolute;
    right: 8px;
    top: 8px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
    z-index: 1;
}

.wand-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    transform: scale(1.05);
}

.wand-btn:active {
    transform: scale(0.95);
    background: #dee2e6;
}

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

.wand-btn:disabled:hover {
    background: #f8f9fa;
    border-color: #dee2e6;
    transform: none;
}

/* Navigation - Mobile optimized with better touch targets */
.navigation {
    display: flex;
    gap: 10px;
    padding: 15px 0 5px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.next-btn,
.back-btn {
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1em;
    min-height: 48px;
    touch-action: manipulation;
    text-align: center;
    flex: 1;
    max-width: 200px;
    min-width: 120px;
    background: #f5f5f5;
    color: #111;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.next-btn:active:not(:disabled), .back-btn:active:not(:disabled) {
    transform: translateY(1px);
    background: #eee;
}

.next-btn:not(:disabled) {
    border: 2px solid #28a745;
}

.next-btn:disabled {
    background: #eee;
    cursor: not-allowed;
    opacity: 0.6;
}

.back-btn {
    background: #f5f5f5;
    color: #444;
}

.back-btn:active {
    transform: translateY(1px);
    background: #eee;
}

/* Persona results styles */
.persona-summary {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.persona-details h3 {
    color: #111;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.persona-details h3:first-child {
    margin-top: 0;
}

.persona-details p {
    margin-bottom: 12px;
    line-height: 1.6;
}

.source-data {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #4c63d2;
    margin-top: 20px;
    display: none; /* Hide from end users */
}



/* Loading styles */
.loading-section {
    text-align: center;
    padding: 40px 20px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4c63d2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.loading-section p {
    color: #4c63d2;
    font-weight: 600;
    margin-bottom: 8px;
}

.loading-subtext {
    color: #666;
    font-size: 0.9em;
    font-weight: normal;
}

/* Persona content styles */
.persona-content .persona-intro {
    background: linear-gradient(135deg, #f5f7ff 0%, #e8ecff 100%);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border-left: 4px solid #4c63d2;
}

.persona-content .persona-intro p {
    font-size: 1.1em;
    font-weight: 500;
    color: #333;
    line-height: 1.6;
    margin-bottom: 0;
}

.persona-section {
    background: #f8f9fa;
    padding: 18px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 3px solid #4c63d2;
}

.persona-section h4 {
    color: #4c63d2;
    font-size: 1.1em;
    margin-bottom: 10px;
    font-weight: 600;
}

.persona-section p {
    line-height: 1.6;
    margin-bottom: 8px;
}

.persona-section ul {
    margin-left: 20px;
    margin-bottom: 0;
}

.persona-section li {
    margin-bottom: 6px;
    line-height: 1.5;
    position: relative;
}

.persona-section li:before {
    content: '→';
    color: #4c63d2;
    font-weight: bold;
    position: absolute;
    left: -15px;
}

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

/* Media queries for responsive design */
@media (min-width: 480px) {
    .container {
        padding: 20px;
    }
    
    header {
        margin-bottom: 30px;
    }
    
    header h1 {
        font-size: 2.2em;
    }
    
    .subtitle {
        font-size: 1.1em;
    }
    
    .step {
        padding: 30px 25px;
    }
    
    .step h2 {
        font-size: 1.6em;
    }
    
    .options-grid {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }
    
    .option-card {
        padding: 20px 16px;
    }
    
    .option-card h3 {
        font-size: 1.1em;
    }
    
    .option-card p {
        font-size: 0.85em;
    }
    
    .navigation {
        padding: 20px 0 10px;
    }
    
    .next-btn,
    .back-btn {
        padding: 16px 32px;
        font-size: 1.05em;
    }
    
    .persona-section {
        padding: 22px;
    }
    
    .persona-section h4 {
        font-size: 1.2em;
    }
    
    .persona-section p,
    .persona-section li {
        font-size: 1em;
    }
}

@media (min-width: 768px) {
    .container {
        padding: 30px;
    }
    
    header {
        margin-bottom: 40px;
        padding: 20px;
    }
    
    header h1 {
        font-size: 2.5em;
    }
    
    .subtitle {
        font-size: 1.2em;
    }
    
    .step {
        padding: 40px 35px;
    }
    
    .step h2 {
        font-size: 1.8em;
        margin-bottom: 15px;
    }
    
    .step-description {
        font-size: 1em;
        margin-bottom: 30px;
    }
    
    .options-container {
        margin-bottom: 30px;
    }
    
    .options-grid {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }
    
    .option-card {
        padding: 24px 20px;
        min-height: 120px;
    }
    
    .option-card h3 {
        font-size: 1.15em;
        margin-bottom: 8px;
    }
    
    .option-card p {
        font-size: 0.9em;
    }
    
    .custom-input-section {
        padding: 20px;
        margin: 20px 0;
    }
    
    .custom-input-section label {
        font-size: 1em;
        margin-bottom: 10px;
    }
    
    .custom-input-section input,
    .custom-input-section textarea {
        padding: 16px;
    }
    
    .custom-input-section textarea {
        min-height: 100px;
    }
    
    .navigation {
        padding: 30px 0 15px;
    }
    
    .next-btn,
    .back-btn {
        padding: 18px 36px;
        font-size: 1.1em;
        max-width: 250px;
    }
    
    .persona-summary {
        flex-direction: row;
        gap: 30px;
    }
    
    .persona-details {
        flex: 2;
    }
    
    .persona-details h3 {
        font-size: 1.4em;
        margin-bottom: 20px;
    }
    
    .persona-details p {
        font-size: 1em;
        line-height: 1.7;
    }
    

    
    .persona-content .persona-intro {
        padding: 25px;
        margin-bottom: 25px;
    }
    
    .persona-content .persona-intro p {
        font-size: 1.15em;
    }
    
    .persona-section {
        padding: 25px;
        margin-bottom: 20px;
    }
    
    .persona-section h4 {
        font-size: 1.25em;
        margin-bottom: 15px;
    }
    
    .persona-section p,
    .persona-section li {
        font-size: 1.05em;
        line-height: 1.7;
    }
    
    .persona-section ul {
        margin-left: 25px;
    }
    
    .persona-section li {
        margin-bottom: 8px;
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* iOS specific fixes */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    .custom-input-section input,
    .custom-input-section textarea {
        font-size: 16px;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    .step {
        background: rgba(255, 255, 255, 0.92);
    }
}

/* Save functionality styles */
.header-actions {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.view-saved-btn {
    background: #f5f5f5;
    color: #111;
    border: 1px solid #eee;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.view-saved-btn:hover {
    background: #eee;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.jv-btn {
    background: #f5f5f5;
    color: #111;
    border: 1px solid #eee;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    margin-left: 0.5rem;
}

.jv-btn:hover {
    background: #eee;
    transform: translateY(-2px);
    text-decoration: none;
    color: #111;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.save-btn {
    background: #fff;
    color: #111;
    border: 1px solid #28a745;
    padding: 12px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-left: 10px;
    touch-action: manipulation;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.save-btn:hover {
    background: #f0f0f0;
    border-color: #218838;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

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

.save-btn:disabled {
    background: #eee;
    border-color: #ccc;
    color: #888;
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
    box-shadow: none;
}

.save-btn:disabled:hover {
    background: #eee;
    border-color: #ccc;
    color: #888;
    transform: none;
    box-shadow: none;
}

/* Modal styles */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

.modal-header {
    background: #fff;
    color: #111;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
}

.close-btn {
    background: none;
    border: none;
    color: #111;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.close-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 1.5rem;
    max-height: 60vh;
    overflow-y: auto;
}

/* Search container styles */
.search-container {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.search-container input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.search-container input:focus {
    outline: none;
    border-color: #4c63d2;
    box-shadow: 0 0 0 2px rgba(76, 99, 210, 0.1);
}

/* Save Persona Modal Styling */
.save-persona-form {
    text-align: center;
    padding: 1rem;
}

.save-persona-form label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.save-persona-form input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    margin-bottom: 1.5rem;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.save-persona-form input:focus {
    outline: none;
    border-color: #4c63d2;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.cancel-btn, .confirm-save-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cancel-btn {
    background: #6c757d;
    color: white;
}

.cancel-btn:hover {
    background: #5a6268;
}

.confirm-save-btn {
    background: #28a745;
    color: white;
}

.confirm-save-btn:hover {
    background: #218838;
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.empty-state p {
    margin-bottom: 0.5rem;
}

.saved-persona-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.saved-persona-card:hover {
    background: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.saved-persona-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.persona-title-section {
    flex: 1;
    margin-right: 1rem;
}

.persona-title-section h4 {
    margin: 0 0 0.25rem 0;
    color: #333;
    font-size: 1.1rem;
}

.persona-user-name {
    margin: 0;
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
}

/* New styles for updated persona display */
.persona-user-name-large {
    margin: 0 0 0.25rem 0;
    color: #333;
    font-size: 1.3rem;
    font-weight: 600;
}

.persona-title-small {
    margin: 0;
    color: #666;
    font-size: 1rem;
    font-weight: 500;
}

.saved-persona-header h4 {
    margin: 0;
    color: #333;
    font-size: 1.1rem;
    flex-grow: 1;
    margin-right: 1rem;
}

.saved-persona-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.load-btn {
    background: #fff;
    color: #111;
    border: 1px solid #28a745;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.load-btn:hover {
    background: #f0f0f0;
    border-color: #218838;
    transform: translateY(-1px);
}

.delete-btn {
    background: #fff;
    color: #111;
    border: 1px solid #dc3545;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.delete-btn:hover {
    background: #f0f0f0;
    border-color: #c82333;
    transform: translateY(-1px);
}

.saved-persona-details {
    font-size: 0.9rem;
    color: #666;
}

.saved-persona-details p {
    margin: 0.25rem 0;
}

.saved-persona-details strong {
    color: #333;
}

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

/* Mobile adjustments for save functionality */
@media (max-width: 768px) {
    .header-actions {
        position: static;
        margin-top: 1rem;
    }
    
    .view-saved-btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
    }
    
    .saved-persona-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .saved-persona-actions {
        margin-top: 0.5rem;
    }
    
    .save-btn {
        font-size: 0.9rem;
        padding: 10px 14px;
    }
}

/* Toast Notification Styles */
.toast-container {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 1100;
    display: flex;
    flex-direction: column-reverse;
    gap: 0.5rem;
    pointer-events: none;
}

.toast {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: auto;
    min-width: 280px;
    max-width: 400px;
    border-left: 4px solid;
}

.toast.toast-show {
    transform: translateX(0);
    opacity: 1;
}

.toast-success {
    border-left-color: #28a745;
}

.toast-info {
    border-left-color: #17a2b8;
}

.toast-warning {
    border-left-color: #ffc107;
}

.toast-error {
    border-left-color: #dc3545;
}

.toast-content {
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.toast-message {
    color: #333;
    font-weight: 500;
    flex-grow: 1;
    margin-right: 0.5rem;
    font-size: 0.9rem;
}

.toast-close {
    background: none;
    border: none;
    color: #999;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.toast-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #666;
}

/* Toast mobile adjustments */
@media (max-width: 768px) {
    .toast-container {
        bottom: 0.5rem;
        right: 0.5rem;
        left: 0.5rem;
    }
    
    .toast {
        min-width: auto;
        max-width: none;
    }
    
    .toast-content {
        padding: 0.8rem;
    }
    
    .toast-message {
        font-size: 0.85rem;
    }
} 