/**
 * ICP & Pain Points Generator - Frontend Styles
 */

/* Container Styles */
.icp-painpoints-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
}

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

.icp-painpoints-header h2 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 2.2em;
    font-weight: 600;
}

.icp-painpoints-description {
    color: #7f8c8d;
    font-size: 1.1em;
    margin-bottom: 0;
}

/* Form Styles */
.icp-painpoints-form {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    border: 1px solid #e1e8ed;
}

.icp-painpoints-fields {
    display: grid;
    gap: 20px;
    margin-bottom: 25px;
}

.icp-field-group {
    position: relative;
}

.icp-field-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95em;
}

.required {
    color: #e74c3c;
    margin-left: 3px;
}

.icp-field-input,
.icp-field-select,
.icp-field-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s ease;
    background: #fff;
    box-sizing: border-box;
}

.icp-field-input:focus,
.icp-field-select:focus,
.icp-field-textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.icp-field-input.error,
.icp-field-select.error,
.icp-field-textarea.error {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.field-error {
    display: block;
    color: #e74c3c;
    font-size: 0.85em;
    margin-top: 5px;
    font-weight: 500;
}

.icp-field-textarea {
    resize: vertical;
    min-height: 100px;
}

/* Email Section */
.icp-email-section {
    display: none;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    border-left: 4px solid #3498db;
}

.email-section-header {
    margin-bottom: 15px;
}

.email-section-header h3 {
    color: #2c3e50;
    margin: 0 0 5px 0;
    font-size: 1.2em;
}

.email-section-header p {
    color: #7f8c8d;
    margin: 0;
    font-size: 0.9em;
}

.email-fields {
    display: grid;
    gap: 15px;
}

/* Submit Button */
.icp-submit-btn {
    width: 100%;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.icp-submit-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #2980b9 0%, #1f5f8b 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.3);
}

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

.icp-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.icp-submit-btn.loading {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
}

.btn-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
}

.icp-submit-btn.loading .btn-spinner {
    display: inline-block;
}

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

/* Results Container */
.icp-results-container {
    display: none;
    margin-top: 40px;
}

.icp-analysis-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
}

.icp-analysis-header h2 {
    margin: 0 0 10px 0;
    font-size: 2em;
    font-weight: 700;
}

.analysis-summary {
    margin: 0;
    font-size: 1.1em;
    opacity: 0.9;
}

/* Persona Tabs */
.icp-personas-container {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    border: 1px solid #e1e8ed;
    overflow: hidden;
}

.persona-tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #e1e8ed;
    overflow-x: auto;
}

.icp-persona-tab {
    flex: 1;
    padding: 15px 20px;
    border: none;
    background: transparent;
    color: #7f8c8d;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    min-width: 120px;
}

.icp-persona-tab:hover {
    background: #e9ecef;
    color: #495057;
}

.icp-persona-tab.active {
    background: #fff;
    color: #2c3e50;
    border-bottom-color: #3498db;
}

/* Persona Content */
.persona-content {
    position: relative;
}

.persona-panel {
    display: none;
    padding: 30px;
    animation: fadeIn 0.3s ease-in-out;
}

.persona-panel.active {
    display: block;
}

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

.persona-header {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #ecf0f1;
}

.persona-header h3 {
    color: #2c3e50;
    margin: 0 0 8px 0;
    font-size: 1.5em;
    font-weight: 700;
}

.persona-description {
    color: #7f8c8d;
    margin: 0;
    font-size: 1.05em;
    line-height: 1.5;
}

/* Detail Sections */
.persona-details {
    display: grid;
    gap: 25px;
}

.detail-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    border-left: 4px solid #3498db;
}

.detail-section h4 {
    color: #2c3e50;
    margin: 0 0 12px 0;
    font-size: 1.1em;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-section h4 i {
    font-size: 1.2em;
    color: #3498db;
}

.detail-content {
    color: #495057;
    line-height: 1.6;
}

.detail-content p {
    margin: 0 0 10px 0;
}

.detail-content p:last-child {
    margin-bottom: 0;
}

.detail-content ul,
.detail-content ol {
    margin: 10px 0;
    padding-left: 20px;
}

.detail-content li {
    margin-bottom: 5px;
}

.detail-content strong {
    color: #2c3e50;
    font-weight: 600;
}

/* Action Buttons */
.analysis-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.icp-copy-btn,
.icp-download-btn,
.icp-new-analysis-btn {
    padding: 12px 20px;
    border: 2px solid #3498db;
    background: #fff;
    color: #3498db;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.icp-copy-btn:hover,
.icp-download-btn:hover,
.icp-new-analysis-btn:hover {
    background: #3498db;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.icp-copy-btn.copied {
    background: #27ae60;
    border-color: #27ae60;
    color: #fff;
}

/* Basic Analysis Fallback */
.icp-analysis-basic {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    border: 1px solid #e1e8ed;
}

.icp-analysis-basic h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.8em;
    font-weight: 700;
}

.analysis-content {
    color: #495057;
    line-height: 1.8;
    margin-bottom: 25px;
    font-size: 1.05em;
}

/* Enhanced Analysis Content Styling */
.icp-personas-wrapper {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.icp-persona-card {
    background: #ffffff;
    border: 2px solid #e8ecef;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.icp-persona-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border-color: #3498db;
}

.persona-title {
    color: #2c3e50;
    font-size: 1.8em;
    font-weight: 700;
    margin: 0 0 20px 0;
    padding-bottom: 15px;
    border-bottom: 3px solid #3498db;
}

.section-heading {
    color: #34495e;
    font-size: 1.5em;
    font-weight: 600;
    margin: 25px 0 15px 0;
    padding-left: 15px;
    border-left: 4px solid #3498db;
}

.subsection-heading {
    color: #2c3e50;
    font-size: 1.2em;
    font-weight: 600;
    margin: 20px 0 10px 0;
    padding: 10px 15px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecef 100%);
    border-radius: 6px;
    border-left: 4px solid #9b59b6;
}

.content-paragraph {
    margin: 12px 0;
    line-height: 1.8;
    color: #495057;
}

.content-paragraph strong {
    color: #2c3e50;
    font-weight: 600;
}

.content-list {
    margin: 15px 0;
    padding-left: 25px;
}

.content-list li {
    margin: 10px 0;
    line-height: 1.7;
    color: #495057;
}

.bullet-item {
    list-style-type: disc;
    padding-left: 10px;
}

.bullet-item::marker {
    color: #3498db;
    font-size: 1.2em;
}

.numbered-item {
    list-style-type: decimal;
    padding-left: 10px;
}

.numbered-item::marker {
    color: #3498db;
    font-weight: 600;
}

/* Section-specific styling */
.subsection-heading:contains("Demographics"),
.subsection-heading:contains("Firmographics") {
    border-left-color: #3498db;
}

.subsection-heading:contains("Wants"),
.subsection-heading:contains("Desires") {
    border-left-color: #e74c3c;
}

.subsection-heading:contains("Needs"),
.subsection-heading:contains("Requirements") {
    border-left-color: #f39c12;
}

.subsection-heading:contains("Pain Points"),
.subsection-heading:contains("Challenges") {
    border-left-color: #e67e22;
}

.subsection-heading:contains("Messaging"),
.subsection-heading:contains("Communication") {
    border-left-color: #1abc9c;
}

.subsection-heading:contains("How to Reach"),
.subsection-heading:contains("Channels") {
    border-left-color: #9b59b6;
}

/* Message Styles */
.icp-message {
    padding: 15px 20px;
    border-radius: 8px;
    margin: 15px 0;
    display: none;
    font-weight: 500;
}

#icp-error-message {
    background: #fdf2f2;
    color: #e74c3c;
    border: 1px solid #f5c6cb;
}

#icp-success-message {
    background: #f0f9f0;
    color: #27ae60;
    border: 1px solid #c3e6cb;
}

/* Icons */
.icon-user::before { content: "👤"; }
.icon-heart::before { content: "❤️"; }
.icon-target::before { content: "🎯"; }
.icon-alert::before { content: "⚠️"; }
.icon-message::before { content: "📧"; }
.icon-megaphone::before { content: "📢"; }
.icon-copy::before { content: "📋"; }
.icon-download::before { content: "📥"; }
.icon-refresh::before { content: "🔄"; }

/* Responsive Design */
@media (max-width: 768px) {
    .icp-painpoints-container {
        padding: 15px;
    }
    
    .icp-painpoints-form {
        padding: 20px;
    }
    
    .persona-tabs {
        flex-direction: column;
    }
    
    .icp-persona-tab {
        flex: none;
        text-align: left;
        border-bottom: 1px solid #e1e8ed;
        border-right: none;
    }
    
    .icp-persona-tab.active {
        border-bottom: 1px solid #e1e8ed;
        border-left: 4px solid #3498db;
    }
    
    .icp-persona-card {
        padding: 20px;
    }
    
    .persona-title {
        font-size: 1.5em;
    }
    
    .section-heading {
        font-size: 1.3em;
    }
    
    .subsection-heading {
        font-size: 1.1em;
        padding: 8px 12px;
    }
    
    .persona-panel {
        padding: 20px;
    }
    
    .analysis-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .icp-copy-btn,
    .icp-download-btn,
    .icp-new-analysis-btn {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .icp-painpoints-header h2 {
        font-size: 1.8em;
    }
    
    .icp-analysis-header h2 {
        font-size: 1.6em;
    }
    
    .persona-header h3 {
        font-size: 1.3em;
    }
    
    .detail-section {
        padding: 15px;
    }
}

/* Print Styles */
@media print {
    .icp-painpoints-form,
    .analysis-actions,
    .persona-tabs {
        display: none !important;
    }
    
    .persona-panel {
        display: block !important;
        page-break-inside: avoid;
        margin-bottom: 30px;
    }
    
    .icp-painpoints-container {
        max-width: none;
        padding: 0;
    }
    
    .detail-section {
        break-inside: avoid;
        background: #f8f9fa !important;
        -webkit-print-color-adjust: exact;
    }
    
    .icp-persona-card {
        page-break-inside: avoid;
        margin-bottom: 30px;
        border: 2px solid #333 !important;
        -webkit-print-color-adjust: exact;
    }
    
    .persona-title,
    .section-heading,
    .subsection-heading {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* Loading Animation */
.icp-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #7f8c8d;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #ecf0f1;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 15px;
}

/* Accessibility */
.icp-persona-tab:focus,
.icp-field-input:focus,
.icp-field-select:focus,
.icp-field-textarea:focus,
.icp-submit-btn:focus,
.icp-copy-btn:focus,
.icp-download-btn:focus,
.icp-new-analysis-btn:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .icp-field-input,
    .icp-field-select,
    .icp-field-textarea {
        border-width: 3px;
    }
    
    .detail-section {
        border-left-width: 6px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

