/* Product Strategy Modal Styles - Matching 5-Whys Appearance */

/* Modal Overlay Styles */
.analysis-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5) !important;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 1rem;
}

/* Modal Styles */
.product-strategy-modal-content {
    background: white;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    max-width: 100vw;
    width: 65vw;
    max-height: 90vh;
    overflow-y: auto;
    margin: auto;
    display: flex;
    flex-direction: column;
}

.modal-header {
    background: linear-gradient(135deg, #0A66C3 0%, #1d4ed8 100%);
    color: white;
    position: relative;
    padding: 2rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex: 1;
}

.back-to-apps-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    color: white;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    flex-shrink: 0;
    text-decoration: none;
}

.back-to-apps-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.back-icon {
    width: 1rem;
    height: 1rem;
    stroke-width: 2;
}

.header-divider {
    width: 1px;
    height: 2rem;
    background: rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

.header-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 2;
    text-align: center;
}

.header-title-section h2 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: left;
    justify-content: left;
    gap: 0.75rem;
    line-height: 1.2;
}

.header-subtitle {
    color: rgba(255, 255, 255, 0.9);
    margin: 0.75rem 0 0 0;
    font-size: 1rem;
    line-height: 1.5;
    font-weight: 400;
    text-align: center;
}

.header-right {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

/* Single line layout for header elements */
.header-single-line {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
}

.header-single-line .back-to-apps-btn {
    flex-shrink: 0;
}

.header-single-line .header-divider {
    flex-shrink: 0;
}

.header-single-line .header-title-section {
    flex: 1;
    display: flex;
    align-items: left;
    justify-content: left;
}

.header-single-line .header-title-section h2 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    line-height: 1.2;
}

.header-single-line .header-subtitle {
    display: none; /* Hide subtitle in single line layout */
}

.modal-body {
    padding: 2rem;
    flex: 1;
    overflow-y: auto;
}

/* Space utility classes */
.space-y-6 > * + * {
    margin-top: 1.5rem;
}

/* Blue info boxes matching 5-Whys */
.bg-blue-50 {
    background-color: #eff6ff;
}

.border-blue-200 {
    border-color: #bfdbfe;
}

.border {
    border-width: 1px;
    border-style: solid;
}

.rounded-lg {
    border-radius: 0.5rem;
}

.p-4 {
    padding: 1rem;
}

.font-medium {
    font-weight: 500;
}

.text-blue-900 {
    color: #1e3a8a;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.text-blue-800 {
    color: #1e40af;
}

.text-sm {
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.leading-relaxed {
    line-height: 1.625;
}

/* Grid layout for AI outputs */
.grid {
    display: grid;
}

.grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.gap-4 {
    gap: 1rem;
}

.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.gap-2 {
    gap: 0.5rem;
}

/* Yellow tips box */
.bg-yellow-50 {
    background-color: #fefce8;
}

.border-yellow-200 {
    border-color: #fde047;
}

.text-yellow-900 {
    color: #713f12;
}

.text-yellow-800 {
    color: #854d0e;
}

.space-y-1 > * + * {
    margin-top: 0.25rem;
}

/* Input Section */
.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    font-weight: 500;
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.input-group label.required::after {
    content: " *";
    color: #e53e3e;
}

.input-group textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    min-height: 100px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.input-group textarea:focus {
    outline: none;
    border-color: #1976d2;
}

.input-help {
    margin-top: 0.5rem;
}

.input-help small {
    color: #666;
    font-size: 0.85rem;
}

/* Recent Versions Section */
.recent-versions-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid #e9ecef;
}

.recent-versions-section h3 {
    margin: 0 0 0.5rem 0;
    color: #333;
    font-size: 1.1rem;
    font-weight: 600;
}

.recent-versions-help {
    color: #666;
    margin: 0 0 1rem 0;
    font-size: 0.9rem;
}

.recent-versions-list {
    max-height: 200px;
    overflow-y: auto;
}

.version-item {
    border: 1px solid #e0e7ef;
    border-radius: 8px;
    margin-bottom: 12px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: background-color 0.2s;
}

.version-item:hover {
    background-color: #f8fafc;
}

.version-info {
    flex: 1;
}

.version-title {
    font-weight: 500;
    color: #333;
    margin-bottom: 0.25rem;
}

.version-meta {
    font-size: 0.85rem;
    color: #666;
}

.version-number {
    margin-left: 0.5rem;
    background: #e2e8f0;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

.version-preview {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #4f8cff;
    font-size: 0.9rem;
    margin-right: 0.75rem;
}

.load-version-btn {
    background: #f5f6fa;
    border: 1px solid #e0e7ef;
    border-radius: 6px;
    padding: 0.25rem 0.625rem;
    color: #4f8cff;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.load-version-btn:hover {
    background: #e2e8f0;
}

/* Modal Actions */
.modal-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 32px;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
}

.cancel-btn {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    color: #6c757d;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.cancel-btn:hover {
    background: #e9ecef;
    color: #495057;
}

.analyze-btn {
    background: #1976d2;
    border: 1px solid #1976d2;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.analyze-btn:hover {
    background: #1565c0;
    border-color: #1565c0;
}

.analyze-btn:disabled {
    background: #ccc;
    border-color: #ccc;
    cursor: not-allowed;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .product-strategy-modal-content {
        width: 95vw;
        margin: 0.5rem;
    }
    
    .modal-header {
        padding: 1.5rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .header-single-line {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .header-divider {
        display: none;
    }
    
    .back-to-apps-btn {
        align-self: flex-start;
    }
    
    .header-title-section h2 {
        font-size: 1.5rem;
    }
    
    .grid-cols-2 {
        grid-template-columns: 1fr;
    }
    
    .version-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .version-preview {
        max-width: 100%;
        margin-right: 0;
    }
}
